OPEN-SOURCE SCRIPT
Updated

Divergence Confluence 7: 7-Indicator Divergence Scanner

477
Divergence Confluence 7

Divergence Confluence 7 is a multi-indicator divergence scanner designed to identify and measure divergence agreement across seven popular technical indicators.

The script analyzes:

• RSI
• MACD
• Stochastic
• OBV
• MFI
• CCI
• Awesome Oscillator

Instead of relying on a single divergence signal, the indicator counts how many of the seven indicators detect a divergence at the same price pivot.

How it works

Bullish divergence occurs when price forms a Lower Low while the indicator forms a Higher Low.

Bearish divergence occurs when price forms a Higher High while the indicator forms a Lower High.

The indicator displays the total confirmation as an easy-to-read score:

BULLISH 5/7 → 5 of 7 indicators confirm bullish divergence.

BEARISH 6/7 → 6 of 7 indicators confirm bearish divergence.

A live table also shows which individual indicators are contributing to the current divergence count.

Features

• 7-indicator divergence analysis
• Bullish and bearish regular divergences
• X/7 confluence scoring
• Individual indicator confirmation table
• Configurable pivot sensitivity
• Configurable maximum distance between pivots
• Adjustable indicator parameters
• Minimum divergence confirmation filter
• TradingView alert conditions for 3/7+, 5/7+ and 7/7 signals

Important

Divergences are confirmed using price pivots. Because pivot confirmation requires candles to the right of the pivot, signals can appear several candles after the actual price turning point.

Divergence should be treated as a confirmation tool rather than a standalone trading strategy. Always combine signals with market structure, trend, volume, risk management and other relevant context.

This indicator currently focuses on regular bullish and bearish divergences.
Release Notes
Fixed tooltips, no changes in the logic
Release Notes
Upgrade in copyright info
Release Notes
Update of the script/tags
Release Notes
Update Summary — What Changed
  • The divergence engine has been fully corrected.
  • The script now reads oscillator and price values directly from the actual pivot candle, instead of using shifted values.
  • This fixes the issue where valid divergences were not being detected or were triggering inconsistently.


Key Improvements:
  • Corrected divergence logic for all 7 indicators (RSI, MACD, Stoch, OBV, MFI, CCI, AO).
  • Removed incorrect [rightBars] offset from pivot calculations.
  • Divergences are now evaluated on true pivot points.
  • Bullish and bearish signals now match visual divergences on the chart.
  • Confluence table and labels updated to reflect corrected logic.


Result:
The indicator now identifies divergences exactly where they occur, without missing valid signals or generating false ones.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.