All indicators

Modified OBV w/ Divergence Detection

Mar 22, 2020

Static chart image
Volume BasedSignalsDivergencesMoving Averages

The Modified OBV w/ Divergence Detection indicator provides a smoothed version of the classic On Balance Volume (OBV) combined with a signal line and automated divergence detection to identify potential trend reversals and momentum shifts.

Usage

The tool is primarily used to identify trend direction and momentum exhaustion through crossovers and price-volume discrepancies. A bullish bias is established when the OBV-M line crosses above the signal line, while a bearish bias is established when it crosses below.

The indicator includes several visual aids to assist with interpretation:

  • Crossovers: Used to denote potential entry and exit points.
  • Bar Coloring: When enabled, the chart bars change color based on the relationship between the OBV-M and its signal line (e.g., green for bullish states, red for bearish states).
  • Divergence Labels: "R" labels indicate Regular Divergences (reversal signals), while "H" labels indicate Hidden Divergences (trend continuation signals).

Details

This script is based on the "OBV-M" created by Vitali Apirine, originally featured in the April 2020 issue of Technical Analysis of Stocks & Commodities (TASC). It builds upon Joe Granville's On Balance Volume by applying a moving average to the raw OBV data to filter out noise. This implementation further enhances the concept by offering multiple moving average types for smoothing and integrating a fractal-based divergence detection algorithm.

Settings

Main Settings

  • OBV-M MA Type: Selects the smoothing method for the OBV calculation (EMA, SMA, VWMA, or WMA).
  • OVBM MA Length: Sets the lookback period for the initial OBV smoothing.
  • OBV-M Signal Length: Sets the lookback period for the signal line calculated from the OBV-M.
  • Enable Bar Color by Trade?: Toggles chart bar recoloring based on crossover states.

Divergence Settings

  • Show Labels?: Toggles the visibility of "R" and "H" divergence labels.
  • Show Channel?: Displays the fractal levels used to determine divergences.
  • Filter Divergences?: Enables additional logic to filter signals based on price change and bar length.
  • Divergence minimum/maximum bar length: Defines the required distance between peaks/troughs for a divergence to be valid.
  • Divergence minimum/maximum absolute price change %: Sets the threshold for price movement between fractal points to qualify as a divergence.

FAQ

How do I access Modified OBV w/ Divergence Detection?

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

What is the difference between regular and hidden divergences?

Regular divergences suggest a possible trend reversal, appearing when price makes a higher high but the indicator makes a lower high. Hidden divergences suggest trend continuation, appearing when the indicator makes a higher high but price makes a lower high.

Can I change the smoothing method?

Yes, the indicator allows you to choose between EMA, SMA, VWMA, and WMA for both the OBV-M line and its corresponding signal line to better suit different market conditions.

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.