OPEN-SOURCE SCRIPT
RSI Divergence Hunter [JOAT]

RSI Divergence Hunter [JOAT]
Automatically detects the four classic RSI divergence types on confirmed pivots and frames each one as a trade.

What it is
Divergence between price and momentum is one of the oldest reversal and continuation reads, but marking it by hand is subjective and easy to force. This indicator detects all four divergence types algorithmically on confirmed pivots, so what you see is defined and repeatable, and then attaches a full trade structure to each. It is an original divergence engine, not a plain RSI plot.
How it works
• RSI core — the relative strength index measures the speed and size of recent moves. It is the momentum reference every divergence is measured against.
• Confirmed pivots — the engine waits for pivots on both price and RSI to confirm a set number of bars back before comparing them. Because pivots are only evaluated once confirmed, a plotted divergence does not repaint into or out of existence.
• The four types — regular bullish (price lower low, RSI higher low) and regular bearish (price higher high, RSI lower high) point to potential reversals; hidden bullish and hidden bearish point to trend continuation after a pullback. Each is drawn with a connecting line on both price and RSI and labelled by type.
• Zones and gating — overbought and oversold zones give context, and a minimum-gap control keeps divergence signals from stacking on lower timeframes.
Trade levels
Each qualifying divergence draws a red risk box to the stop and a green reward box to the third target, with inner dividers and right-edge labels for entry, stop and each take-profit at your R multiples. The stop is anchored beyond the pivot that formed the divergence.
The dashboard
An adjustable divergence-scope panel shows the current RSI value and zone, the most recent divergence type detected, the active signal, a conviction estimate, and a live first-target-before-stop tally from closed bars only.
How to use it
• Works on any asset and timeframe.
• Treat regular divergences as counter-trend reversal cues and hidden divergences as with-trend continuation cues — the distinction matters.
• Combine with structure or a trend filter; divergence works well as confluence, not in isolation.
Settings
RSI length and source, pivot strength, which divergence types to display, overbought/oversold levels, risk multiple and target R multiples, plus visual and dashboard controls.
Originality and usefulness
The contribution is a complete, confirmed-pivot detector for all four divergence classes with clear per-type labelling and integrated, non-repainting trade framing. By fixing the definition of a divergence and waiting for pivot confirmation, it removes much of the hindsight bias that makes manual divergence unreliable.

Notes and limitations
• Divergence signals can persist and reappear in strong trends; a divergence is a condition, not a timing guarantee.
• Confirmed pivots introduce a natural delay equal to the pivot strength — this is the cost of not repainting.
• The tally reflects only past bars on the current chart and is not a forecast.
• Educational and analytical tool, not financial advice.
— made with passion by officialjackofalltrades
Automatically detects the four classic RSI divergence types on confirmed pivots and frames each one as a trade.
What it is
Divergence between price and momentum is one of the oldest reversal and continuation reads, but marking it by hand is subjective and easy to force. This indicator detects all four divergence types algorithmically on confirmed pivots, so what you see is defined and repeatable, and then attaches a full trade structure to each. It is an original divergence engine, not a plain RSI plot.
How it works
• RSI core — the relative strength index measures the speed and size of recent moves. It is the momentum reference every divergence is measured against.
• Confirmed pivots — the engine waits for pivots on both price and RSI to confirm a set number of bars back before comparing them. Because pivots are only evaluated once confirmed, a plotted divergence does not repaint into or out of existence.
• The four types — regular bullish (price lower low, RSI higher low) and regular bearish (price higher high, RSI lower high) point to potential reversals; hidden bullish and hidden bearish point to trend continuation after a pullback. Each is drawn with a connecting line on both price and RSI and labelled by type.
• Zones and gating — overbought and oversold zones give context, and a minimum-gap control keeps divergence signals from stacking on lower timeframes.
Trade levels
Each qualifying divergence draws a red risk box to the stop and a green reward box to the third target, with inner dividers and right-edge labels for entry, stop and each take-profit at your R multiples. The stop is anchored beyond the pivot that formed the divergence.
The dashboard
An adjustable divergence-scope panel shows the current RSI value and zone, the most recent divergence type detected, the active signal, a conviction estimate, and a live first-target-before-stop tally from closed bars only.
How to use it
• Works on any asset and timeframe.
• Treat regular divergences as counter-trend reversal cues and hidden divergences as with-trend continuation cues — the distinction matters.
• Combine with structure or a trend filter; divergence works well as confluence, not in isolation.
Settings
RSI length and source, pivot strength, which divergence types to display, overbought/oversold levels, risk multiple and target R multiples, plus visual and dashboard controls.
Originality and usefulness
The contribution is a complete, confirmed-pivot detector for all four divergence classes with clear per-type labelling and integrated, non-repainting trade framing. By fixing the definition of a divergence and waiting for pivot confirmation, it removes much of the hindsight bias that makes manual divergence unreliable.
Notes and limitations
• Divergence signals can persist and reappear in strong trends; a divergence is a condition, not a timing guarantee.
• Confirmed pivots introduce a natural delay equal to the pivot strength — this is the cost of not repainting.
• The tally reflects only past bars on the current chart and is not a forecast.
• Educational and analytical tool, not financial advice.
— made with passion by officialjackofalltrades
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.