All indicators

Price Divergence Detector V3 revised by JustUncleL

Dec 4, 2016

Static chart image
Price Action BasedVolume BasedSignalsOscillatorsDivergences

The Price Divergence Detector V3 revised by JustUncleL indicator identifies regular and hidden divergences between price action and various technical oscillators to highlight potential trend reversals or continuations. This tool supports multiple calculation methods, including RSI, MACD, and Ehlers IdealRSI, providing a versatile framework for divergence analysis across different market conditions.

Usage

The Usage section describes how the script can be used to identify market momentum shifts. Traders can utilize this indicator to spot discrepancies between price highs/lows and oscillator peaks/troughs.

  • Regular Divergence: Occurs when price makes a higher high but the oscillator makes a lower high (Bearish), or price makes a lower low while the oscillator makes a higher low (Bullish). These are typically used to anticipate trend reversals.
  • Hidden Divergence: Occurs when price makes a higher low but the oscillator makes a lower low (Bullish), or price makes a lower high while the oscillator makes a higher high (Bearish). These often signal trend continuation.
  • Detection Method: Users can switch between various oscillators (e.g., Stochastic, Volume, CCI) to see how different momentum or volume-based metrics correlate with price action.
  • Visual Cues: The indicator plots labels ("R" for Regular, "H" for Hidden) and circles on the chart at the point of fractal detection (offset by 2 bars to confirm the pivot).

Details

The script utilizes a fractal-based logic to identify significant peaks and troughs in the selected oscillator. It compares the values of these oscillator fractals against the corresponding price action at those specific points in time.

Key implementation details include:

  • Fractal Logic: A pivot is confirmed when the central bar is higher (for tops) or lower (for bottoms) than the two preceding and two following bars.
  • Custom Methods: Includes advanced calculations such as the Ehlers IdealRSI, which uses a simplified MESA cycle period for dynamic smoothing, and the Bollinger Bands %B method.
  • Trend Accumulated Volume (TVA): A unique method that accumulates volume based on bar polarity or EMA direction to find volume-based divergences.

Settings

General Settings

  • Method: Selects the oscillator used for divergence detection (RSI, MACD, Stochastic, Volume, Accumulation/Distribution, Fisher Transform, CCI, BB %B, Ideal RSI, Elders Force Index, or Trend Acc Volume).
  • Show Labels: Toggles the visibility of the "R" and "H" text labels on the chart.
  • Show Channel: Displays the underlying fractal connections as a visual channel.
  • Show Hidden Divergence: Enables or disables the detection and plotting of hidden divergences.
  • Show Regular Divergence: Enables or disables the detection and plotting of regular divergences.
  • Use EMA Trend direction for Trend Acc Volume: When the TVA method is selected, this determines if volume accumulation follows EMA slope or bar close price.

Oscillator Parameters

  • Length for Method (except MACD): Sets the lookback period for most oscillators (e.g., RSI length, CCI length).
  • MACD Source: Determines the price source (Close, HL2, etc.) for MACD calculations.
  • MACD Fast/Slow/Smooth: Adjusts the specific EMA lengths and signal line smoothing for the MACD method.

FAQ

How do I interpret the labels on the chart? Labels marked with an "R" indicate a Regular Divergence, suggesting a possible trend reversal. Labels marked with an "H" indicate a Hidden Divergence, suggesting the current trend may continue.

Why are the signals offset by two bars? The script uses fractal detection, which requires two bars to the right of a peak or trough to confirm it is a local high or low. The signals are plotted on the bar where the confirmation occurs.

How can I access this indicator? 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.