All indicators

Price Divergence Detector V0

Aug 28, 2015

Static chart image
Dynamic OverlaysVolume BasedSignalsOscillatorsDivergences

The Price Divergence Detector V0 indicator is a multi-method detection tool designed to identify regular and hidden divergences directly on the price chart using several technical oscillators. By automating the comparison between price action and momentum or volume data, it helps traders pinpoint potential trend reversals and continuations across various asset classes.

Usage

The script can be used to identify four distinct types of divergence:

  • Regular Bullish Divergence: Price makes a lower low while the indicator makes a higher low, suggesting a potential upward reversal.
  • Regular Bearish Divergence: Price makes a higher high while the indicator makes a lower high, suggesting a potential downward reversal.
  • Hidden Bullish Divergence: Price makes a higher low while the indicator makes a lower low, often indicating trend continuation to the upside.
  • Hidden Bearish Divergence: Price makes a lower high while the indicator makes a higher high, often indicating trend continuation to the downside.

Users can toggle between different methods such as RSI, MACD, or Stochastics to see how different momentum perspectives align with price action. Labels can be enabled to quickly distinguish between Regular ("R") and Hidden ("H") signals.

Details

The indicator utilizes a fractal-based approach to identify significant pivot points in the chosen calculation method. Specifically:

  1. Fractal Detection: It searches for local peaks and valleys within a 5-bar window.
  2. Comparison Logic: Once a fractal is confirmed (with a 2-bar lag), the script compares the current price and indicator values at that point to the previous confirmed fractal levels.
  3. Methods:
    • RSI: Standard Relative Strength Index.
    • MACD: Moving Average Convergence Divergence histogram.
    • Stoch: Stochastic Oscillator.
    • Volume: Simple Moving Average of volume data.
    • Acc/Dist: Accumulation/Distribution line with smoothing.

Settings

  • Method: Selects the underlying calculation used to detect divergences (RSI, MACD, Stoch, Volume, or Acc/Dist).
  • Show Labels?: Toggles the visibility of "R" and "H" labels above/below the price pivots.
  • Show Channel?: Displays a visual path connecting the detected pivot points on the chart.
  • RSI/STOCH/Volume/ACC-DIST Smooth: Sets the length or smoothing period for the chosen method (excluding MACD).
  • MACD Source: The price source used for MACD calculations.
  • MACD Fast: The fast period for the MACD EMA.
  • MACD Slow: The slow period for the MACD EMA.
  • MACD Smooth Signal: The signal line smoothing period for the MACD.

FAQ

How do I interpret the "R" and "H" labels?

"R" stands for Regular Divergence, which typically indicates a potential trend reversal. "H" stands for Hidden Divergence, which typically suggests a continuation of the existing trend.

Why do signals appear with a delay?

The indicator uses a fractal-based detection method that requires confirmation from subsequent bars to ensure a peak or valley has truly formed. In this script, signals are plotted with an offset to align with the actual pivot bar.

How can I get access to Price Divergence Detector V0?

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

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.