Oscillators Overlay with Multi-Oscillator Divergence
Every major oscillator on one chart. Divergence confirmed across all of them at once.
Divergence is one of the most powerful signals in technical analysis - but it is also one of the most unreliable when it comes from a single oscillator. Any one indicator can produce false divergence signals. When multiple independent oscillators detect the same divergence on the same bar simultaneously, the probability that something meaningful is happening rises significantly.
This script does two things. It projects any one of fifteen oscillators directly onto the price chart as an overlay - no separate pane required. And it simultaneously runs a divergence engine across all suitable oscillators at once, labelling price bars where multiple indicators agree, and telling you exactly which ones detected each signal and why it matters.
Oscillator Overlay
Fifteen oscillators are available for projection directly onto the price chart: Awesome Oscillator, Chaikin Oscillator, CCI, Distance Oscillator, Elder-Ray Bear and Bull Power, Elliott Wave Oscillator, Klinger Oscillator, Money Flow Index, MACD, Rate of Change, RSI, Stochastic, Stochastic RSI, Volume Oscillator, and Wave Trend.
Each oscillator is scaled to fit within the price chart - above or below price depending on preference, with configurable height and vertical offset. Oscillators with signal lines display the signal line alongside the oscillator line. Oscillators with histograms display the histogram as colour-coded bars. Reference levels for overbought, oversold, and midline are drawn as dashed lines where applicable. A tooltip on the indicator label explains what the selected oscillator measures and how to interpret its values.
The Distance Oscillator - a custom instrument measuring the percentage deviation of price from its moving average - is the default selection and deserves particular mention. Unlike momentum oscillators that measure rate of change, the Distance Oscillator measures where price currently sits relative to its mean, making it effective at identifying both trend extension and mean-reversion setups.
Multi-Oscillator Divergence
The divergence engine runs simultaneously across fourteen oscillators - including both the oscillator line and histogram for Distance, MACD, EWO, and Wave Trend where applicable, giving up to fourteen independent divergence readings per bar.
Four divergence types are detected on each bar:
Regular Bullish - price makes a lower low while the oscillator makes a higher low. Selling pressure is weakening. Potential reversal upward.
Hidden Bullish - price makes a higher low while the oscillator makes a lower low. The underlying upward trend is intact despite the oscillator's appearance. Continuation signal.
Regular Bearish - price makes a higher high while the oscillator makes a lower high. Buying pressure is fading. Potential reversal downward.
Hidden Bearish - price makes a lower high while the oscillator makes a higher high. The underlying downward pressure is intact. Continuation signal.
When divergence is detected, a label appears on the price bar showing the divergence type (R for Regular, H for Hidden) and the number of oscillators that agreed. Hovering the label reveals the full list - which oscillators fired, the price and oscillator conditions that triggered each, and a plain-language interpretation of what the signal means.
Minimum Confluence Filter
A configurable minimum confluence threshold controls how many oscillators must agree before a label appears. At 1, any single oscillator detection produces a label - useful for catching early signals. At 2 or 3, only bars where multiple oscillators agree are flagged - fewer signals, but each carries more weight. Higher values filter aggressively for only the highest-confidence confluences.
Oscillator Exclusions
Four oscillators are included in the overlay but excluded from divergence scanning - Chaikin, Elder-Ray, Klinger, and Volume Oscillator. These are excluded deliberately: their construction makes divergence detection structurally unreliable, and including them would produce misleading confluence counts. All fourteen oscillators used in divergence scanning are appropriate for pivot-based divergence analysis.
Alerts
Two alert systems operate independently. The multi-oscillator combined alert fires when any new divergence meeting the minimum confluence threshold is detected on a confirmed bar, listing all active oscillators per divergence type in a single message. The single-oscillator alert system fires separately for the selected display oscillator - covering signal line crosses, center line crosses, overbought/oversold band crosses, histogram colour changes, and divergence detection individually.
All fifteen oscillator parameters are independently configurable. Pivot lookback, maximum and minimum lookback range, minimum confluence, label size, and all divergence type toggles are fully controlled. The overlay placement, height, and vertical offset are independently adjustable.