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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.