OPEN-SOURCE SCRIPT
HTF Reversal Divergence Mapper - Hitz2kk

This indicator combines higher time frame reversal structure with lower time frame momentum divergence to help identify entry locations inside a newly confirmed reversal zone.
The core idea is simple: instead of taking every divergence signal in isolation, the script waits for a confirmed higher time frame reversal candle, then only looks for divergence opportunities that develop inside that candle’s range. This creates a more structured workflow for traders who want lower time frame precision without losing higher time frame context.
What the indicator measures
The script first scans a user-selected higher time frame and identifies reversal candles using two configurable pattern groups:
• Engulfing reversals
o bullish engulfing after a bearish candle
o bearish engulfing after a bullish candle
• Wick-based reversals
o bullish rejection candles with a strong lower wick relative to body size
o bearish rejection candles with a strong upper wick relative to body size
Only confirmed higher time frame candles are stored. Once a valid reversal candle closes, the script records its open, high, low, close, and direction.
After that, the indicator monitors the chart timeframe for RSI pivot divergence:
• Bullish divergence
o price makes a lower low
o RSI makes a higher low
• Bearish divergence
o price makes a higher high
o RSI makes a lower high
A divergence signal is only shown when it occurs:
1. after a confirmed higher time frame reversal candle,
2. within the user-defined active bar window after confirmation,
3. and inside the stored higher time frame candle range.
This filtering is designed to reduce random divergence signals and focus only on divergence that develops within an already defined reversal structure.
What appears on the chart
The indicator can display several visual features:
• an active HTF zone box showing the range of the last confirmed reversal candle,
• dotted horizontal levels marking that candle’s high and low,
• a projected candle on the right side of price showing the most recent confirmed higher time frame reversal candle,
• a label identifying the candle as bullish or bearish,
• breakout labels when price trades above the stored HTF high or below the stored HTF low.
Alerts included
The script includes alerts for:
• bullish divergence inside a bullish HTF reversal zone,
• bearish divergence inside a bearish HTF reversal zone,
• break above the most recent confirmed HTF reversal high,
• break below the most recent confirmed HTF reversal low.
How traders may use it
This indicator is built for traders who use a top-down process:
• define directional bias from a higher time frame reversal,
• use lower time frame divergence to refine timing,
• use the HTF high/low as reference points for confirmation or invalidation.
The tool is suited to futures, forex, indices, and crypto, especially for traders who want a more structured way to combine reversal context, momentum shift, and breakout levels.
What makes this script different
This is not a generic divergence plotter and not a basic engulfing detector. The indicator is designed around the interaction between:
• confirmed higher time frame reversal candles,
• lower time frame RSI pivot divergence,
• and price location relative to the stored HTF candle range.
The focus is on mapping lower time frame entries inside a higher time frame reversal framework rather than plotting every signal independently.
The core idea is simple: instead of taking every divergence signal in isolation, the script waits for a confirmed higher time frame reversal candle, then only looks for divergence opportunities that develop inside that candle’s range. This creates a more structured workflow for traders who want lower time frame precision without losing higher time frame context.
What the indicator measures
The script first scans a user-selected higher time frame and identifies reversal candles using two configurable pattern groups:
• Engulfing reversals
o bullish engulfing after a bearish candle
o bearish engulfing after a bullish candle
• Wick-based reversals
o bullish rejection candles with a strong lower wick relative to body size
o bearish rejection candles with a strong upper wick relative to body size
Only confirmed higher time frame candles are stored. Once a valid reversal candle closes, the script records its open, high, low, close, and direction.
After that, the indicator monitors the chart timeframe for RSI pivot divergence:
• Bullish divergence
o price makes a lower low
o RSI makes a higher low
• Bearish divergence
o price makes a higher high
o RSI makes a lower high
A divergence signal is only shown when it occurs:
1. after a confirmed higher time frame reversal candle,
2. within the user-defined active bar window after confirmation,
3. and inside the stored higher time frame candle range.
This filtering is designed to reduce random divergence signals and focus only on divergence that develops within an already defined reversal structure.
What appears on the chart
The indicator can display several visual features:
• an active HTF zone box showing the range of the last confirmed reversal candle,
• dotted horizontal levels marking that candle’s high and low,
• a projected candle on the right side of price showing the most recent confirmed higher time frame reversal candle,
• a label identifying the candle as bullish or bearish,
• breakout labels when price trades above the stored HTF high or below the stored HTF low.
Alerts included
The script includes alerts for:
• bullish divergence inside a bullish HTF reversal zone,
• bearish divergence inside a bearish HTF reversal zone,
• break above the most recent confirmed HTF reversal high,
• break below the most recent confirmed HTF reversal low.
How traders may use it
This indicator is built for traders who use a top-down process:
• define directional bias from a higher time frame reversal,
• use lower time frame divergence to refine timing,
• use the HTF high/low as reference points for confirmation or invalidation.
The tool is suited to futures, forex, indices, and crypto, especially for traders who want a more structured way to combine reversal context, momentum shift, and breakout levels.
What makes this script different
This is not a generic divergence plotter and not a basic engulfing detector. The indicator is designed around the interaction between:
• confirmed higher time frame reversal candles,
• lower time frame RSI pivot divergence,
• and price location relative to the stored HTF candle range.
The focus is on mapping lower time frame entries inside a higher time frame reversal framework rather than plotting every signal independently.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。