OPEN-SOURCE SCRIPT

RSI Divergence Hunter [JOAT]

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

istantanea

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.

istantanea

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

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.