All indicators

ROC Divergence

Mar 4, 2019

Static chart image
SignalsOscillatorsDivergencesPivot Based (Retrospective)

The ROC Divergence indicator identifies Rate of Change pivot points and highlights potential trend reversals through price-indicator divergences. By monitoring the momentum of price changes, the tool aims to detect when a trend's velocity is decoupling from price action, signaling possible exhaustion.

Usage

The tool can be used to identify potential entry or exit points based on momentum shifts. Users can look for the following signals:

  • Bullish Divergence: Occurs when price makes lower lows while the ROC maintains higher lows, suggesting a potential upward reversal.
  • Bearish Divergence: Occurs when price makes higher highs while the ROC fails to reach new highs, suggesting a potential downward reversal.
  • Pivot Points: The indicator marks specific pivot highs and lows within the ROC oscillator, which can serve as early warnings of momentum changes before a full divergence is confirmed.

Details

The script calculates the Rate of Change (ROC) based on a user-defined length and source. It tracks the highest and lowest price and ROC values within a specific lookback window. Divergences are detected by comparing these extreme points. To reduce noise, the detection logic includes a one-candle delay to filter out rapidly repeating signals. Pivot points are identified when the ROC reaches a local extreme that is maintained for a specific duration.

Settings

  • Length: Sets the number of bars used to calculate the Rate of Change.
  • Source: Determines the price input used for the calculation (e.g., HLC3, Close).
  • Hide pivots?: Toggles the visibility of the "Pivot" labels on the oscillator.
  • Shorter labels?: When enabled, replaces text-based labels ("Bull", "Bear", "Pivot") with compact triangle shapes.
  • Div lookback period (bars)?: Defines the lookback window used to find the maximum and minimum values for divergence detection.

FAQ

How do I use the ROC Divergence?

You can use it to spot momentum exhaustion by looking for "Bull" or "Bear" labels, which indicate a mismatch between price movement and ROC momentum.

What is the difference between Pivots and Divergences in this script?

Pivots mark local peaks or troughs in momentum, while Divergences indicate a specific disagreement between the direction of price and the direction of momentum.

How can I access this tool?

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.