OPEN-SOURCE SCRIPT
50% Retrace of Previous HTF Candles

50% Retrace of Previous HTF Candles
This indicator plots the 50% midpoint of the most recently completed candle on five higher timeframes: Daily, 4-Hour, 1-Hour, 30-Minute, and 15-Minute.
Each level is drawn as a horizontal line that starts at the exact close of the previous higher-timeframe candle and ends a short distance after the current bar. A clear label sits to the right of each line so you can quickly see which timeframe it belongs to.
How it works
The script pulls the high and low of the last fully closed candle on each timeframe using request.security(), then calculates the simple midpoint: (High + Low) / 2. Because it only uses completed candles, the levels do not repaint.
Why these timeframes?
These five timeframes cover a useful range of market structure:
Together they give a layered view of recent higher-timeframe midpoints without cluttering the chart with every possible timeframe.
Why this is useful
Many traders watch the midpoint of recent higher-timeframe candles as potential areas of interest. Price often reacts around these 50% levels — either finding support/resistance or treating them as mean-reversion reference points. Having multiple HTF midpoints visible at once gives useful context without constantly switching timeframes.
Customization
You can toggle each timeframe on or off independently, change the colors, adjust the line width and style, and modify the labels if you prefer different wording. Everything is controlled from the indicator settings.
Currently uses a coral color palette designed to stay visible on both light and dark charts.
Simple, clean, and focused on one practical concept.
This indicator plots the 50% midpoint of the most recently completed candle on five higher timeframes: Daily, 4-Hour, 1-Hour, 30-Minute, and 15-Minute.
Each level is drawn as a horizontal line that starts at the exact close of the previous higher-timeframe candle and ends a short distance after the current bar. A clear label sits to the right of each line so you can quickly see which timeframe it belongs to.
How it works
The script pulls the high and low of the last fully closed candle on each timeframe using request.security(), then calculates the simple midpoint: (High + Low) / 2. Because it only uses completed candles, the levels do not repaint.
Why these timeframes?
These five timeframes cover a useful range of market structure:
- Daily – Captures the broader daily bias and key structural levels.
- 4H – Common intermediate timeframe used by many day and swing traders.
- 1H – Bridges higher timeframes with intraday price action.
- 30m & 15m – Provide finer, more responsive levels for shorter-term entries and exits.
Together they give a layered view of recent higher-timeframe midpoints without cluttering the chart with every possible timeframe.
Why this is useful
Many traders watch the midpoint of recent higher-timeframe candles as potential areas of interest. Price often reacts around these 50% levels — either finding support/resistance or treating them as mean-reversion reference points. Having multiple HTF midpoints visible at once gives useful context without constantly switching timeframes.
Customization
You can toggle each timeframe on or off independently, change the colors, adjust the line width and style, and modify the labels if you prefer different wording. Everything is controlled from the indicator settings.
Currently uses a coral color palette designed to stay visible on both light and dark charts.
Simple, clean, and focused on one practical concept.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.