All indicators

OBV with Volume/Momentum Divergence

Jul 7, 2022

Static chart image
Volume BasedSignalsOscillatorsDivergencesPivot Based (Retrospective)

The OBV with Volume/Momentum Divergence indicator provides a comprehensive approach to trend reversal detection by combining On-Balance Volume (OBV) with momentum oscillators like RSI and MACD. It identifies regular and hidden divergences across volume and momentum data to filter out false signals and highlight high-probability setups.

Usage

The indicator plots an OBV oscillator and identifies various levels of divergence between the price and the oscillator data. These divergences are categorized and visually represented by different line colors to help traders gauge the strength of a potential reversal:

  • Strong Divergence (Volume + RSI + MACD): Shown in dark green/red, this indicates that price action is contradicted by volume and two different momentum metrics.
  • Moderate Divergence (Volume + RSI or Volume + MACD): Shown in light green/red, indicating a confluence between volume and one momentum metric.
  • Standard Divergence (Volume Only): Shown in gray, representing a standard OBV divergence.

The Timeframe Scaling feature is particularly useful for traders who switch between timeframes frequently. When enabled, it adjusts the OBV oscillator's values to ensure the visual amplitude remains consistent, preventing the indicator from becoming "squashed" or "blown out" when moving from a 5-minute chart to a daily chart.

Details

The script is based on the original concepts by vyperphi696 and LazyBear but expands upon them by integrating Momentum (RSI and MACD Histogram) into the divergence logic. The indicator calculates divergences by detecting pivot highs and lows in the OBV oscillator and comparing them to price pivots within a specific lookback range.

The inclusion of momentum filters aims to improve the "signal-to-noise" ratio. For example, a bullish divergence on OBV is considered stronger if the RSI and MACD are also making higher lows while the price makes a lower low.

Settings

  • OBV Length: Sets the period for the EMA subtraction used to create the OBV oscillator.
  • RSI Length: Determines the period used for the Relative Strength Index momentum check.
  • MACD Settings (Fast/Slow/Signal): Configures the parameters for the MACD Histogram calculation.
  • Pivot Lookback (Right/Left): Defines the number of bars required on either side of a point to confirm a pivot high or low.
  • Lookback Range (Max/Min): Sets the window of bars within which the script searches for a previous pivot to compare for divergence.
  • Timeframe Scaling: A toggle to normalize indicator scaling across different timeframes for a smoother visual experience.

FAQ

How do I interpret the different line colors? The colors represent the "confluence" of the divergence. Darker colors represent a triple confluence of Volume, RSI, and MACD. Lighter colors indicate Volume plus one momentum oscillator, and gray indicates a standard Volume-only divergence.

What is the difference between regular and hidden divergence in this tool? Regular divergence typically indicates a potential trend reversal, while hidden divergence often suggests a trend continuation. Both can be toggled or viewed via the plot shapes and lines.

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