All indicators

Divergence Detector RSI + MACD + AO Oscillator Reversal

Mar 28, 2024

Static chart image
SignalsOscillatorsDashboardDivergencesPivot Based (Retrospective)

The Divergence Detector RSI + MACD + AO Oscillator tool identifies regular bullish and bearish divergences between price action and three popular momentum oscillators to highlight potential trend reversals.

Usage

The indicator can be used to spot trend exhaustion and upcoming reversals by comparing price peaks and troughs with the peaks and troughs of a selected oscillator. Users can switch between RSI, MACD, and AO depending on their preference for momentum or trend-following analysis.

For example, a Positive Regular Divergence (RD+) occurs when price makes a lower low while the oscillator makes a higher low, suggesting a bullish reversal. Conversely, a Negative Regular Divergence (RD-) occurs when price makes a higher high while the oscillator makes a lower high, suggesting a bearish reversal.

The tool includes a data table that tracks:

  • Exist: Displays a "+" if a divergence is currently detected.
  • Consecutive: Counts how many times the same type of divergence has appeared in sequence.
  • Divergence Quality: Rates the setup as "Normal," "Good," or "Strong" based on the consecutive count.
  • Change Phase: Indicates if the oscillator crossed the zero line between the two peaks/troughs of the divergence.

Details

The script utilizes a fractal-based pivot detection logic to identify meaningful highs and lows. It filters signals based on a 50-period EMA to ensure divergences are identified within the context of the prevailing trend direction. The logic supports three distinct modes:

  • MACD: Uses the MACD Histogram for detection.
  • RSI: Uses the Relative Strength Index (adjusted to a 50-centerline) to find overextended momentum shifts.
  • AO: Uses the Awesome Oscillator's median-price-based histogram to identify market momentum cycles.

Settings

Logic Setting

  • Fractal Periods: Determines the number of bars required to confirm a pivot high or low. Higher values result in more significant but delayed signals.
  • Divergence Detect Method: Selects the underlying oscillator used for detection (MACD, RSI, or AO).

Display Setting

  • Show Table: Toggles the visibility of the information table in the top-right corner.
  • Show Label: Toggles the visual markers (+RD/-RD) on the oscillator chart.

FAQ

How do I access Divergence Detector RSI + MACD + AO Oscillator?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Can this indicator detect hidden divergences?

No, this specific indicator is designed to identify "Regular Divergence" only, which is primarily used for spotting trend reversals.

Which oscillator is best for divergence detection?

There is no single "best" oscillator; RSI is often preferred for identifying overbought/oversold exhaustion, while MACD and AO are effective for identifying shifts in trend momentum.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.