# OBV

Also known as: on-balance volume, OBV-Modified.
A Volume & Order Flow concept (Cumulative flow lines) in the LuxAlgo Library, with 1 indicator implementation.

## What is OBV?

OBV (on-balance volume) is a cumulative volume line introduced by Joe Granville in 1963. The rule is deliberately simple: if a bar closes above the prior close, add its entire volume to a running total; if it closes below, subtract it; if the close is unchanged, do nothing. Every bar's volume is treated as all buying or all selling based purely on the close-to-close direction, which makes OBV a blunt but assumption-light proxy for whether volume is flowing with advances or with declines.

The line's absolute value is meaningless, since it depends on where your data starts; the information is in its slope, its swings, and its agreement with price. When price makes a new high and OBV confirms with its own high, the advance is carrying participation. When price makes an extreme that OBV refuses to match, that [OBV divergence](https://www.luxalgo.com/library/concept/obv-divergence/) suggests the move is running on thinner volume. Granville's premise was that volume precedes price, so he also watched OBV break its own [trendline](https://www.luxalgo.com/library/concept/trendline/) or range ahead of price. The crude assignment rule is the known weakness: a bar barely positive on huge volume counts as fully bullish, so most traders read OBV alongside structure rather than alone.

Granville himself is half the story. His thesis, that smart money accumulates quietly and the public arrives late, made OBV the tracking instrument for the footprints: the line trending while price ranges was his signature evidence of accumulation or distribution in progress. He became one of the most famous market commentators of his era, his pronouncements moving markets outright in the early 1980s before some spectacular missed calls humbled the legend. The indicator outlived the showmanship because its core mechanic, compounding direction and participation into one auditable line, asks a question every era keeps needing answered.

The modern ecosystem treats OBV as raw material as much as a finished tool. Divergence detectors automate the swing comparisons; transformed variants normalize the unbounded line, an RSI of OBV being the common construction, so threshold and zone logic can apply; moving-average overlays and range-break reads systematize Granville's early-break thesis; and multi-line ribbons pair OBV with its intrabar-weighted cousins. The permanent caveats travel with all of them: the all-or-nothing signing, sensitivity to a single giant bar, and volume feeds whose quality, on [tick-count](https://www.luxalgo.com/library/concept/relative-volume/) proxies especially, bounds everything the line can honestly claim.

## How to calculate OBV

OBV needs only closes and volume, built bar by bar from an arbitrary starting value, commonly zero.

1. Compare the current close to the prior close.
2. If the close is higher, add the bar's full volume to the previous OBV value; if lower, subtract it; if equal, carry the previous value forward.
3. Plot the running total and ignore its absolute level. Read direction, swing highs and lows, and trendlines drawn on the line itself.
4. Compare OBV's swings with price's swings: confirmation supports the trend, and non-confirmation flags a divergence worth investigating.
5. Optionally normalize: an RSI or Z-score of the OBV series converts the unbounded line into a bounded oscillator, enabling zone and threshold reads the raw line cannot support.

## How it's calculated

A running cumulative total of volume, added on up closes and subtracted on down closes, showing whether volume pressure is flowing into or out of a market.

```
if C_t > C_(t-1): OBV_t = OBV_(t-1) + V_t
if C_t < C_(t-1): OBV_t = OBV_(t-1) - V_t
if C_t = C_(t-1): OBV_t = OBV_(t-1)
OBV_0 = 0

  OBV_t: on-balance volume at bar t
  OBV_(t-1): OBV at the previous bar
  OBV_0: seed value (commonly 0)
  C_t: close of bar t
  C_(t-1): close of the previous bar
  V_t: volume of bar t
  t: bar index
```

Only the slope and shape of the line matter; the absolute level depends on the arbitrary seed and on where the data series starts.

OBV-Modified (OBV-M) smooths the raw line with a moving average and adds a signal line, commonly 7 and 10 period EMAs.

Published by Joseph Granville in 1963.

## How traders use it

- For trend confirmation: OBV printing new highs alongside price argues the advance is participated in, while a flat OBV under a rising price warns the rally is volume-light.
- For divergences: a price extreme that OBV fails to match is an early caution, handled like any [regular divergence](https://www.luxalgo.com/library/concept/regular-bullish-bearish-divergence/): a warning that needs price confirmation, not a standalone reversal signal.
- For early breaks: because volume can shift before price, some traders watch for OBV to break a range or trendline first and then look for price to follow; the sequence is a tendency Granville described, not a guarantee.
- As an input series: OBV is often smoothed with a moving average or fed into oscillator-style transforms to steady its bar-to-bar jumpiness before signals are taken from it.
- In transformed variants: an RSI computed on OBV bounds the line into 0-100 territory, letting overbought, oversold and divergence conventions apply to participation the way they usually apply to price.

## OBV vs other volume flow lines

- **Accumulation/Distribution Line** (https://www.luxalgo.com/library/concept/accumulation-distribution-line/): The A/D line weights each bar's volume by where the close lands inside the bar's range, while OBV assigns all volume by close-to-close direction. They disagree most on gaps and on bars that close mid-range.
- **Volume Price Trend** (https://www.luxalgo.com/library/concept/volume-price-trend/): VPT scales volume by the percentage price change instead of taking all of it, so a small up-close adds a little and a large one adds a lot; OBV is all-or-nothing.
- **Money Flow Index** (https://www.luxalgo.com/library/concept/money-flow-index/): MFI turns volume-weighted price movement into a bounded 0-100 oscillator with overbought and oversold zones; OBV is unbounded and cumulative, read through slope and divergence rather than levels.

## FAQ

### What does the OBV value actually mean?

Nothing on its own. OBV starts from an arbitrary number, so its level reflects your data history, and comparing values across symbols or feeds is meaningless. The reading comes from its shape: rising or falling slope, the pattern of its swings versus price, and breaks of trendlines or ranges drawn on the line itself.

### Is OBV a reliable indicator by itself?

It is blunt by design: a bar closing up by one tick on huge volume counts as fully bullish, and gaps or quiet sessions can distort the line. Used alone it produces plenty of noise. Its practical role is as a confirmation and divergence tool read next to price structure, not a standalone signal generator.

### Who invented OBV?

Joe Granville popularized on-balance volume in his 1963 book Granville's New Key to Stock Market Profits, built on the premise that volume precedes price. Similar cumulative-volume ideas had circulated earlier, but Granville's close-to-close formulation is the one that stuck and is what charting platforms compute today.

### What did Granville mean by volume precedes price?

That accumulation and distribution show up in participation before they show up in quotes: informed buying absorbs supply quietly, building an OBV uptrend while price still ranges, and the eventual price move merely announces what the volume line already recorded. OBV breaking its own trendline or range ahead of price was his practical test. It is a tendency with famous examples and plenty of counterexamples, not a law.

### How does OBV handle gaps?

Entirely through the close-to-close comparison: a gap up that closes above the prior close books the whole bar's volume as buying, however the session traded after the open. That makes OBV blind to intrabar rejection but fully sensitive to gap direction, the exact mirror of the A/D line, which reads close position within the range and never sees gaps at all. On gap-prone symbols the two lines disagree often, and the disagreement identifies which mechanism dominated.

### Does OBV work on forex and crypto volume?

Only as well as the volume feed underneath. Spot forex substitutes tick counts, activity events rather than size, so OBV there tracks something real but different from participation; crypto volume is genuine but venue-fragmented and occasionally synthetic. The line still functions on a single consistent feed, read relatively, with conviction discounted accordingly; on centrally reported equities and futures it means what Granville intended.

## Implementations in the Library

- On Balance Volume (LuxAlgo, the standard build of the classic formula): https://www.luxalgo.com/library/indicator/on-balance-volume/

## Related concepts

- Money Flow Index: https://www.luxalgo.com/library/concept/money-flow-index/
- Weis Wave Volume: https://www.luxalgo.com/library/concept/weis-wave-volume/
- OBV Divergence: https://www.luxalgo.com/library/concept/obv-divergence/
- Accumulation/Distribution Line: https://www.luxalgo.com/library/concept/accumulation-distribution-line/
- Chaikin Oscillator: https://www.luxalgo.com/library/concept/chaikin-oscillator/
- Chaikin Money Flow: https://www.luxalgo.com/library/concept/chaikin-money-flow/
- Twiggs Money Flow: https://www.luxalgo.com/library/concept/twiggs-money-flow/
- Williams A/D: https://www.luxalgo.com/library/concept/williams-a-d/
- Price Volume Trend: https://www.luxalgo.com/library/concept/price-volume-trend/
- Negative Volume Index: https://www.luxalgo.com/library/concept/negative-volume-index/

---

Source: https://www.luxalgo.com/library/concept/obv/ (LuxAlgo Library, the encyclopedia of trading & technical analysis). Free to use with attribution: https://www.luxalgo.com/library/license/