OPEN-SOURCE SCRIPT

Divergence Indicator RSI, MACD,, Hidden Reversal Signals LunqFX

1 240
Divergence Indicator is a multi-engine divergence scanner for TradingView that reads RSI, MACD and OBV at every confirmed swing and only draws a divergence when the engines agree — so instead of the usual flood of weak one-oscillator signals, you get a few graded, high-conviction ones. Every divergence is rated by strength: ★★★ all three engines confirm (rare, strongest), ★★ two confirm, single-engine noise is filtered out by default. It detects regular divergences (price makes a new extreme, oscillators refuse — potential reversal) and hidden divergences (trend continuation), on any market — forex, crypto, stocks, indices, gold — and any timeframe. Built in Pine Script v6, fully non-repainting. Keywords: divergence indicator, RSI divergence, MACD divergence, OBV divergence, hidden divergence, regular divergence, reversal, momentum, exhaustion, multi oscillator scanner.

◆ WHY MULTI-ENGINE
Any single oscillator diverges constantly — that's why classic divergence tools feel random. Requiring independent confirmation from momentum (RSI), trend-momentum (MACD) and volume flow (OBV) removes most false positives: when all three refuse to follow price, the move is genuinely running out of fuel.

◆ WHAT IT DRAWS
Divergence lines on price — solid neon violet for bullish, neon amber for bearish; dashed for hidden divergences.
Star-graded labels — ★★ / ★★★ with tooltips explaining exactly what diverged.
Exhaustion candles — a unique display layer: candles glow at full neon while price and engines agree, and fade as engines stop confirming — you see a divergence brewing before it prints.
Status strip dashboard — a horizontal HUD along the bottom: last signal + strength, a live engine board (P / RSI / MACD / OBV direction arrows), a FUEL meter, and bull/bear counters.

◆ HOW IT WORKS
Swings are detected with confirmed pivots (N closed bars each side).
At each new confirmed pivot the scanner compares price and each engine against the previous pivot: price lower low + engine higher low = regular bull; price higher low + engine lower low = hidden bull (mirrored for highs).
The number of agreeing engines (1–3) becomes the star rating; signals below your minimum are skipped.
The live engine board and fuel meter track slope agreement in real time — display-only context that never alters signals.

◆ HOW TO USE IT
Treat ★★★ regular divergences as your primary reversal alerts — look for entries with your own structure/levels.
Use hidden divergences to join the trend on pullbacks.
Watch the FUEL meter: when it drains and candles fade, tighten stops on trend trades.
Raise Min strength to 3 for only the rarest, cleanest signals; lower pivot bars for faster (but noisier) detection.

◆ SETTINGS
Pivot left/right bars, max gap between swings, minimum strength, hidden divergences on/off, engine toggles (RSI/MACD/OBV), RSI length, exhaustion candles, label size, dashboard position/size.

◆ ALERTS
Bullish divergence · Bearish divergence (fire when a confirmed signal prints).

◆ LIMITATIONS
Signals confirm with a pivot delay (right bars) — that is the honest cost of zero repaint; lower it for speed, raise it for reliability.
On symbols without volume data the OBV engine adds no information — disable it there.
Divergence marks exhaustion, not timing — always combine with structure and risk management.

◆ ORIGINALITY & NON-REPAINTING
Original work: the three-engine agreement grading, the exhaustion-candle layer, the live engine board and the fuel meter are my own implementation — no third-party code. All divergences are built from confirmed pivots only; a drawn line or label never moves or disappears.

Educational analysis tool, not financial advice. © LunqFX.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.