OPEN-SOURCE SCRIPT
Period Range Analyzer

This indicator analyzes a specific periodic range, which can start from a fixed date or a defined lookback period. It draws percentage levels and colored zones between the highest and lowest price. It also displays a detailed information table, which shows the price's position within the range in "Trend" mode, and the relative strength of currency pairs in "Forex" mode. The current price position is also indicated by a label with a percentage value and the name of the corresponding zone.
User Guide
Calculation Method
This setting determines how the indicator defines the range used 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). The range (the highest and lowest price) is "floating," meaning it is recalculated with each new candle based on the last N candles.
Date Based: In this mode, the calculation starts from a fixed date and time you select. The indicator finds the opening price of the start date and continuously tracks the highest and lowest price from that point on. This mode is ideal for measuring performance from a specific event (e.g., start of a week/month/year, news).
Data Handling 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. All calculations (Open, Max, Min, Range, Percentage, Change, Trend) are based on this actual start date.
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 (levels, zones) 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. The table always displays accurate data for the entire period.
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 and the range.
Forex: This is a special mode used to measure the strength of currency and crypto 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.
Trend
This trend determination operates based on the formation order of the high and low within the analyzed range:
Its switch is located in the “Table Additional Rows” menu.
Bullish: Indicated if the low was formed before the high (on different candles). Or if they formed on the same candle, it was a bullish candle.
Bearish: Indicated if the high was formed before the low (on different candles). Or if they formed on the same candle, it 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 (Upper Threshold (%) and Lower Threshold (%) in the "Label Coloring" section) primarily determine the state (Bullish/Bearish/Neutral) of the top row of the table.
The logic is not based on the percentage change of the price movement, but on the current price's position within the range, where the bottom of the range is 0% and the top is 100%.
Upper Threshold (%): The percentage level (e.g., 60.0) above which the indicator considers the price position "Bullish" (or "Strong").
Lower Threshold (%): The percentage level (e.g., 40.0) below which the indicator considers the price position "Bearish" (or "Weak").
If the price is between the two (e.g., between 40% and 60%), the signal is Neutral.
Secondary function: These thresholds also control the color of the label next to the price, provided the "Dynamic Label Coloring" option is enabled.
User Guide
Calculation Method
This setting determines how the indicator defines the range used 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). The range (the highest and lowest price) is "floating," meaning it is recalculated with each new candle based on the last N candles.
Date Based: In this mode, the calculation starts from a fixed date and time you select. The indicator finds the opening price of the start date and continuously tracks the highest and lowest price from that point on. This mode is ideal for measuring performance from a specific event (e.g., start of a week/month/year, news).
Data Handling 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. All calculations (Open, Max, Min, Range, Percentage, Change, Trend) are based on this actual start date.
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 (levels, zones) 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. The table always displays accurate data for the entire period.
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 and the range.
Forex: This is a special mode used to measure the strength of currency and crypto 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.
Trend
This trend determination operates based on the formation order of the high and low within the analyzed range:
Its switch is located in the “Table Additional Rows” menu.
Bullish: Indicated if the low was formed before the high (on different candles). Or if they formed on the same candle, it was a bullish candle.
Bearish: Indicated if the high was formed before the low (on different candles). Or if they formed on the same candle, it 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 (Upper Threshold (%) and Lower Threshold (%) in the "Label Coloring" section) primarily determine the state (Bullish/Bearish/Neutral) of the top row of the table.
The logic is not based on the percentage change of the price movement, but on the current price's position within the range, where the bottom of the range is 0% and the top is 100%.
Upper Threshold (%): The percentage level (e.g., 60.0) above which the indicator considers the price position "Bullish" (or "Strong").
Lower Threshold (%): The percentage level (e.g., 40.0) below which the indicator considers the price position "Bearish" (or "Weak").
If the price is between the two (e.g., between 40% and 60%), the signal is Neutral.
Secondary function: These thresholds also control the color of the label next to the price, provided the "Dynamic Label Coloring" option is enabled.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
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.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
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.