OPEN-SOURCE SCRIPT
Multi-Oscillator Divergence Confluence

Most divergence tools track a single oscillator, which leaves you with a long list of candidates and no way to tell the strong ones from the marginal ones. This indicator checks three oscillators at the same price pivot — RSI, MACD histogram and MFI — and reports a setup only when a chosen number of them agree. The label shows the agreement count, so a 3/3 divergence is immediately distinguishable from a 1/3.
How it works
Confirmed price pivots are stored together with a snapshot of every oscillator at that pivot. When a new pivot forms, it is compared against the immediately preceding pivot — the standard definition of divergence — provided the two lie within your configured distance range. For a bullish setup, price must make a lower low while the enabled oscillators make higher lows; bearish is mirrored. The number of oscillators that agree is counted in that single pass, and the setup is drawn only if the count reaches your minimum.
The three oscillators are deliberately chosen to measure different things — momentum, trend momentum and money flow. A cumulative volume line was avoided on purpose: it tends to agree with the price trend by construction, which would make the agreement count meaningless.
Settings
Oscillators required to agree (default: all three). Lowering it surfaces more setups; on BTCUSD daily over roughly two years, the same data produced about 20 setups at 3/3 and about 45 at 1/3.
Each oscillator can be disabled individually, with its own length input. The label denominator and the threshold follow the number you leave enabled.
Pivot lookback (left/right) and the minimum/maximum distance between the two pivots.
Optional "Any pivot in range" mode scans every stored pivot instead of only the previous one. This finds more setups but produces considerably more signals.
Lines and labels can be turned off independently.
Alerts
Two alert conditions for any qualifying bullish or bearish divergence, plus two more for the case where every enabled oscillator agrees.
Notes and limitations
Pivot confirmation requires the configured number of right-side bars, so setups are always reported with that delay. This is inherent to pivot-based detection and is the honest trade-off for not repainting: once a setup is drawn, it stays where it was drawn.
Only regular divergences are detected — hidden divergences are not included. MFI uses volume data, which is tick-based in forex; disable it there if you prefer to work with price-only oscillators.
Agreement across oscillators describes a stronger disagreement between price and momentum. It does not make a reversal more likely to succeed, and many divergences resolve as continuation. This is an analysis tool, not a trading system: it does not size positions, manage risk or predict outcomes.
How it works
Confirmed price pivots are stored together with a snapshot of every oscillator at that pivot. When a new pivot forms, it is compared against the immediately preceding pivot — the standard definition of divergence — provided the two lie within your configured distance range. For a bullish setup, price must make a lower low while the enabled oscillators make higher lows; bearish is mirrored. The number of oscillators that agree is counted in that single pass, and the setup is drawn only if the count reaches your minimum.
The three oscillators are deliberately chosen to measure different things — momentum, trend momentum and money flow. A cumulative volume line was avoided on purpose: it tends to agree with the price trend by construction, which would make the agreement count meaningless.
Settings
Oscillators required to agree (default: all three). Lowering it surfaces more setups; on BTCUSD daily over roughly two years, the same data produced about 20 setups at 3/3 and about 45 at 1/3.
Each oscillator can be disabled individually, with its own length input. The label denominator and the threshold follow the number you leave enabled.
Pivot lookback (left/right) and the minimum/maximum distance between the two pivots.
Optional "Any pivot in range" mode scans every stored pivot instead of only the previous one. This finds more setups but produces considerably more signals.
Lines and labels can be turned off independently.
Alerts
Two alert conditions for any qualifying bullish or bearish divergence, plus two more for the case where every enabled oscillator agrees.
Notes and limitations
Pivot confirmation requires the configured number of right-side bars, so setups are always reported with that delay. This is inherent to pivot-based detection and is the honest trade-off for not repainting: once a setup is drawn, it stays where it was drawn.
Only regular divergences are detected — hidden divergences are not included. MFI uses volume data, which is tick-based in forex; disable it there if you prefer to work with price-only oscillators.
Agreement across oscillators describes a stronger disagreement between price and momentum. It does not make a reversal more likely to succeed, and many divergences resolve as continuation. This is an analysis tool, not a trading system: it does not size positions, manage risk or predict outcomes.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.