Skip to content
AlgoBeam

On-Balance VolumeOBV

Over time, has volume been piling up on the bars that closed higher or on the bars that closed lower?

VolumeOscillatorBeginner

On a chart

On-Balance Volume on NASDAQ:AAPL, daily bars. The widget is interactive — change the instrument or the timeframe and check whether the description still holds.

StudySTD;On_Balance_Volume
Live market data by TradingView

How it works

On-Balance Volume is the simplest possible way to give volume a sign. Each bar's entire volume is added to a running total when the close is above the previous close and subtracted when it is below. Nothing else enters the calculation. The result is a single cumulative line whose slope answers one question: across the period you are looking at, was more activity attached to up closes or to down closes?

The crudeness is deliberate, and it is both the strength and the weakness. Because a one-tick gain and a five-percent gain contribute identically, the line is insensitive to the size of individual moves and therefore very stable — it will not be thrown around by one violent session the way a magnitude-weighted line is. The cost is that it treats a session that opened sharply lower and clawed back to close a cent up as pure accumulation, which is plainly not what happened.

The level of the line is meaningless. It depends entirely on the arbitrary value the series was seeded with and on how far back your data goes, so two charts of the same instrument will show different numbers. Only shape matters: is it rising, falling, flat, and does its shape agree with price? That is why practitioners draw trendlines and mark swing highs and lows on the OBV pane itself rather than reading values off the axis.

The two classical uses are confirmation and divergence. In a healthy advance OBV makes higher highs alongside price, indicating that the volume is genuinely arriving on the up bars. When price grinds to a new high while OBV rolls over or flattens, the advance is being carried by fewer or smaller transactions and the move is described as unconfirmed. Around a range, an OBV line that quietly rises while price goes sideways is the textbook accumulation signature — supply is being taken without price being marked up yet.

Compared with its neighbours, OBV sits at one end of a spectrum. Price Volume Trend applies the same cumulative idea but scales each contribution by the percentage move, so it responds to magnitude. The Accumulation/Distribution line ignores the previous close entirely and weights volume by where the close sat inside the bar's own range. Running two of them side by side is informative: when OBV rises and PVT does not, the up closes were numerous but small.

Calculation

The arithmetic in words, in the order it happens.

Seed a running total at an arbitrary value, conventionally zero. For each bar, compare the close with the previous close. If it is higher, add the whole of that bar's volume to the total. If it is lower, subtract the whole of it. If the two closes are exactly equal, leave the total unchanged. Only the sign of the change is used — the magnitude of the price move never enters the arithmetic. The plotted line is that cumulative total, so its absolute level is a function of the starting point and carries no information.

Source

An AlgoBeamScript implementation of the formula above, written by us from the arithmetic so the code and the calculation agree line for line.

Loading the implementation…

Runs unchanged on the platform and in the AlgoBeamTS runtime. The language reference is in the documentation.

Inputs

Defaults are the values most charting packages ship with. They are conventions, not optimal settings — the right length depends on your instrument and your holding period.

InputDefaultWhat it changes
SmoothingNoneAn optional moving average drawn over the OBV line. Adding one — 20 periods is a common choice — makes crossovers of line and average usable as a slow trigger, at the price of adding lag to a series that is already cumulative and therefore slow.
Starting value0The seed for the running total. It shifts the whole line vertically and changes nothing about its shape, which is precisely why the vertical axis on an OBV pane should never be read as a quantity.

How to read it

What practitioners take from the plot. Read these as descriptions of market state, not as entry signals.

OBV making higher highs together with price
The advance is being accompanied by volume on the up bars. This is confirmation of an existing move, not an entry trigger.
Price at a new high, OBV at a lower high
Bearish divergence: the new price extreme was reached on less committed participation. It can repeat several times before anything happens, so it needs a price-level invalidation to be tradable.
OBV rising while price moves sideways in a range
Accumulation. Supply is being absorbed at flat prices, which frequently precedes a break of the range upwards.
OBV breaking its own trendline before price breaks its
The flow behind the trend changed before the price structure did. Treated as an early warning, and the most defensible way to use the line because it is a shape comparison rather than a level reading.
OBV flat through a strong rally
Up and down volume are cancelling out. Buyers are not dominating the tape even though price is climbing, which is typical of drift, short covering or index-driven moves.

Limitations

Where this indicator misleads. None of these are fixed by a better parameter.

  • The binary sign discards everything about the size of the move. A session that fell four percent and closed one cent above the previous close counts as full accumulation, which produces genuinely misleading readings around volatile reversals.
  • Because the series is cumulative, a single outlier session — an index rebalance, an expiry, a block cross — permanently shifts the line and contaminates every trendline drawn on it afterwards.
  • It assumes a meaningful close. In twenty-four-hour markets the daily close is a bookkeeping convention chosen by the data provider, so the same crypto pair can produce visibly different OBV lines on different platforms.
  • Divergences are the main advertised use and the least reliable part of it. They persist for long stretches in strong trends, and rules built on divergence alone, without a trend filter or a defined stop, rarely survive honest testing.

Educational reference. This page explains how an indicator is built and how it is commonly read. It is not investment advice, not a recommendation and not a signal service. No indicator is profitable on its own — each is a way of describing a market, and any rule built on one has to be tested with realistic costs before it is traded.

Ready when you are

Reading it is half of it.

The write-up tells you how On-Balance Volume is supposed to behave. A backtest tells you how it actually behaved on your instrument, over your timeframe, with spread and commission included.

  • No card required
  • Cancel anytime
  • 14-day Ultimate trial