All indicators

Indicator: OBV Oscillator

Mar 28, 2014

Static chart image
Volume BasedSignalsOscillatorsDivergences

The OBV Oscillator indicator transforms the traditional On Balance Volume (OBV) into a centered oscillator to better identify volume-price momentum shifts and potential trend reversals. By subtracting an exponential moving average from the cumulative OBV, this tool highlights the relative fluctuations in volume flow, making it easier to spot divergences and overextended conditions.

Usage

The Usage section focuses on identifying shifts in volume-driven momentum. Traders typically look for zero-line crossovers to confirm changes in market sentiment.

  • Zero-Line Crossovers: When the oscillator crosses above zero, it indicates that current volume-price pressure is stronger than the historical average (defined by the length), suggesting bullish momentum. Conversely, a cross below zero suggests bearish momentum.
  • Divergence Detection: This tool is particularly effective for spotting divergences. If the price reaches a new high but the OBV Oscillator fails to do so, it may signal weakening buying pressure and a potential trend exhaustion.
  • Trend Confirmation: The color-coded plot (green for positive, red for negative) provides an immediate visual cue for the prevailing volume trend.

Details

The script is based on the original concepts by LazyBear and calculates the standard On Balance Volume by adding volume on up-days and subtracting it on down-days. To transform this cumulative total into an oscillator, the script applies an Exponential Moving Average (EMA) to the OBV and subtracts it from the raw OBV value.

This process de-trends the OBV, removing the long-term cumulative bias and focusing on short-to-medium-term fluctuations. The formula used is: OBV Oscillator = OBV - EMA(OBV, length)

This implementation includes built-in alerts for zero-line crossovers and utilizes a dynamic area plot to visualize the magnitude of volume momentum.

Settings

  • Length: Determines the period used for the Exponential Moving Average (EMA). A higher length creates a smoother oscillator more suited for long-term trends, while a shorter length increases sensitivity to minor volume shifts.
  • Source: Specifies the price data used to calculate the OBV (typically the closing price).

FAQ

How do I interpret the zero line in the OBV Oscillator? The zero line represents the point where the current On Balance Volume is equal to its EMA. Positions above zero indicate positive volume accumulation relative to the selected period, while positions below zero indicate distribution.

Can this indicator be used for divergence trading? Yes, the OBV Oscillator is designed to make volume divergences more visible compared to the standard cumulative OBV line, helping traders identify when volume is not supporting price movement.

How can I access the OBV Oscillator? 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.