21 — Volume Indicators

On-Balance Volume#

Debated1 min read
◆ The PatternA running total of volume, signed by each day’s direction: does volume confirm the move or not

On-Balance Volume — Joe Granville's cumulative volume indicator (1963).

If Close > Prior Close → OBV += Volume
If Close < Prior Close → OBV -= Volume
If Close = Prior Close → OBV unchanged

The absolute value doesn't matter — the slope reveals accumulation or distribution.

"Volume precedes price":
• OBV rising + price flat → accumulation → expect breakout UP
• OBV falling + price flat → distribution → expect breakdown DOWN
• Divergence between OBV and price = powerful signal
Worked example

Add the day’s volume on an up close, subtract it on a down close. Days 13–15 add −95,000, +64,000 and +71,000, taking OBV from −39,000 to +1,000. Days 11 and 15 both close at 104, but OBV was 36,000 then and 1,000 now: the same price, with less volume behind the way back.

The example data: 15 days, used in every indicator here
DayHighLowCloseVolume
11019910050,000
210310010262,000
310310010148,000
410510110470,000
510810410785,000
610810510660,000
711010610990,000
811010710872,000
910810410580,000
1010510210366,000
1110510210455,000
1210410110275,000
13102989995,000
141029910164,000
1510510110471,000
Where it misleads
  • A day’s whole volume is counted as buying or selling from the sign of the close, so a day up one cent counts as much as a day up 5%.
  • The level is arbitrary — it depends on where you start counting. Only its direction and divergences carry information.
  • Divergences between OBV and price are common, and most resolve without a reversal.
In code
direction = np.sign(df['close'].diff()).fillna(0)
df['obv'] = (direction * df['volume']).cumsum()
Python, in your browser — edit the code and run it again

Assumes import numpy as np, import pandas as pd, and a DataFrame df with columns high, low, close and volume — the 15 days above.

Sources
  • J. Granville, Granville’s New Key to Stock Market Profits, Prentice-Hall, 1963
  • L. Blume, D. Easley & M. O’Hara, “Market Statistics and Technical Analysis: The Role of Volume”, Journal of Finance 49(1), 1994 — why volume can carry information

Last reviewed October 2026 · How this site checks its content · Report a mistake

Pattern bridge: Cumulative volume adds up conviction — a cumulative sum (CDF-like) of directional volume. In ML, backpropagation accumulates gradients through the graph. The accumulation/distribution line refines the idea, weighting volume by where the close lands in the day’s range.
Linked from 1
← Previous
Standard Deviation
Open in the full reader, with the topic sidebar