OPEN-SOURCE SCRIPT

Range Percentage Analyzer

71
This indicator is a tool for analyzing the market range and trend. It calculates the extent of price movement between a specified starting point and the current price, displaying it as a percentage.
The calculation can be based on a fixed lookback period (e.g., the last 30 candles) or from a fixed start date. It also provides a clear table that shows the general trend in "Trend" mode, and the relative strength of the base and quote currencies of forex pairs (e.g., EURUSD) in "Forex" mode.

User Guide


Calculation Method

This setting determines how the indicator defines the starting point for the calculation.
Lookback Period: In this mode, the indicator uses the last N candles (the number can be specified in the "Lookback Period (bars)" field, maximum 250).
The starting point is "floating," meaning it shifts with each new candle. For example, with a setting of 30, the 30th candle from the current one will always be the starting point.
Date Based: In this mode, the calculation starts from a fixed date and time you select.
This mode is ideal for measuring performance from a specific event (e.g., news, start of a week/month).
Note: If you select a date in "Date Based" mode for which no data is available on the current timeframe (e.g., switching to a very low timeframe), the indicator will automatically use the earliest available candle as the starting point.


Start Date & Time

This setting is only active in "Date Based" mode.
Here you can specify the fixed starting point for the calculation.
The specified time is in the Exchange timezone.
Important limitation: Due to TradingView platform limits, visual elements (box, line) are only drawn for a maximum of 250 candles back.
If the set date is older than this, the calculation still applies to the entire period (from the set date), but the drawing only covers the last 250 candles.
When switching to a higher timeframe, the range may restart from a slightly later bar due to TradingView's bar alignment. For best accuracy, set your timeframe first, then select the start date.


Table Mode

This setting controls what data the information table displays.

Trend: This is the default mode, which works on any symbol (stock, index, crypto, etc.). It displays information related to the trend.

Forex: This is a special mode used to measure the strength of currency pairs.
It only works on symbols with exactly 6 characters (e.g., "EURUSD", "BTCUSD"). It treats the first 3 characters as the base currency (e.g., EUR) and the last 3 as the quote currency (e.g., USD).
If the symbol does not have 6 characters, the table will automatically display in "Trend" mode.


Extremes Trend Row

If this is enabled, the table displays an additional row that determines the trend based on the formation order of the high and low within the analyzed range.
The logic is as follows:
Bullish: Indicated if the low was formed before the high.
(Or if they formed on the same candle, which was a bullish candle).
Bearish: Indicated if the high was formed before the low.
(Or if they formed on the same candle, which was a bearish candle).
Neutral: Indicated if the high and low formed on the same candle, and it was a "doji" candle (close = open).


Upper & Lower Threshold

These settings control the logic for the "Change Trend" and "Forex Display" rows at the top of the table.
They determine when the total percentage change for the entire period is considered "Bullish/Strong", "Bearish/Weak", or "Neutral".
Upper Threshold (%): The percentage value (default 0.1%) above which the indicator considers the change "Bullish/Strong".
Lower Threshold (%): The percentage value (default -0.1%) below which the indicator considers the change "Bearish/Weak".
If the change is between the two, the signal is Neutral.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.