All indicators

CDC Divergences

Oct 11, 2021

Static chart image
Volume BasedSignalsOscillatorsDivergences

The CDC Divergences indicator identifies regular bullish and bearish divergences by comparing price action with various momentum and volume-based oscillators. It serves as a streamlined tool for traders to spot potential trend reversals when price makes new extremes that are not confirmed by the underlying indicator.

Usage

The indicator highlights divergences on the chart using labels and shapes. Traders can use these signals to identify exhaustion in the current trend:

  • Bullish Divergence: Occurs when price makes a Lower Low (marked with a green triangle) but the selected oscillator makes a higher low. This suggests a weakening bearish momentum.
  • Bearish Divergence: Occurs when price makes a Higher High (marked with a red triangle) but the selected oscillator makes a lower high. This suggests a weakening bullish momentum.

Traders can switch between different oscillators in the settings to see how momentum or volume flows correlate with price. For example, using the "Volume" setting allows for detecting price/volume divergences, while "RSI" or "MACD" focuses on momentum.

Details

The script utilizes pivot point logic to identify significant highs and lows in price action. Once a pivot is confirmed (based on the Lookback Left and Right settings), the script compares the value of the selected secondary indicator at that specific point in time to the previous pivot value. The indicator currently focuses on regular divergences for simplicity. It includes a multi-source feature for price, allowing users to check for divergences using specific price points like High/Low instead of just the Close.

Settings

Higher highs / Lower lows

  • Price Source: Determines the primary price data used for pivot detection.
  • Use different sources for High and Low: When enabled, allows separate sources for high pivots and low pivots (e.g., using High and Low instead of Close).
  • Pivot Lookback Left/Right: Sets the number of bars required to the left and right to confirm a pivot point. Higher values result in more significant but delayed signals.
  • Check Against: Selects the oscillator to use for divergence detection (RSI, MACD, Stoch, Volume, or OBV).

RSI Calculations

  • RSI Source/Length: Configures the period and source for the RSI calculation.
  • Overbought/Oversold: Defines the threshold levels for RSI-based divergence filtering.

MACD Calculations

  • MACD Source: The data source for MACD.
  • MACD Lookback Fast/Slow: Sets the EMA periods for the MACD line.

Stochastic Oscillator Calculations

  • %k Length / Smoothing: Configures the Stochastic period and initial smoothing.
  • %d smoothing: Sets the period for the signal line.
  • Use value: Choose between %d, %k, or the min/max of both for divergence checks.
  • Overbought/Oversold: Defines the threshold levels for Stochastic-based divergence filtering.

FAQ

How do I access CDC Divergences?

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

Can I track divergences with volume?

Yes, by selecting "Volume" or "OBV" in the "Check Against" setting, the indicator will compare price pivots with volume activity.

Why are the signals delayed?

Divergences are based on pivot points, which require a "Right Lookback" period to confirm that a high or low has actually formed. Adjusting the "Right" lookback setting will change the confirmation delay.

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.