What Is the On Balance Volume Indicator (OBV)?
What is the On Balance Volume indicator? All three formula lines, why the OBV number means nothing on its own, and why OBV is not a daily-only calculation.
On Balance Volume is a running total that adds a bar's volume when the bar closed above the previous close and subtracts it when the bar closed below. When the close is unchanged, the total stays where it is.
The rest of OBV is a question of how you read the line, and the level itself is not the part you read.
What is the On Balance Volume indicator?
A cumulative volume total, steered by the close-to-close direction of price. Up close, add the bar's volume. Down close, subtract it. Flat close, leave it alone.
Joe Granville published it in 1963. StockCharts names the book, "his 1963 book Granville's New Key to Stock Market Profits", and labels the premise as his rather than as settled fact: "Granville theorized that volume precedes price."
What is the OBV formula?
Three lines. StockCharts prints all three in bar-neutral words:
"If the closing price is above the prior close price then: Current OBV = Previous OBV + Current Volume If the closing price is below the prior close price then: Current OBV = Previous OBV - Current Volume If the closing prices equals the prior close price then: Current OBV = Previous OBV (no change)"
TradingView's calculation section says the same thing without the word day in it, using "Current Closing Price" and "Prior Closing Price". Its third condition reads "If Current Closing Price is equal to the Prior Closing Price then: Previous OBV = Current OBV".
Why the flat-close line matters:
- A flat close is common. On a quiet instrument, or on a short timeframe where a bar covers a few minutes, closes repeat often.
- Without the rule, the obvious guesses are to add the volume anyway or to skip the bar, and the two guesses build two different lines.
- OBV is cumulative, so one mishandled bar shifts every value after it and the two readings stay apart.
Where to find OBV in ChartLabs
ChartLabs has it, spelled On-Balance Volume. It is in the chart's Indicators menu, in the Standard list under the Volume heading, and it opens in its own pane below the price. Price Volume Trend, Volume Ratio and Accumulation/Distribution sit under the same heading.
Our build draws two lines in that pane: the running total, labelled OBV, and a simple average of the total, labelled MAOBV. The one calculation setting is MA Length, and it defaults to 30, so the second line averages the last 30 values of the total rather than of price. The total itself follows the three rules above, including the flat-close one.
What does the OBV number mean?
Nothing on its own. The running total starts from whatever bar your chart's history begins on, so the level is an artifact of where the data starts rather than a measurement of anything.
StockCharts says it outright: "The absolute value of OBV is not important. Chartists should instead focus on the characteristics of the OBV line."
Two charts of the same instrument can show OBV values nowhere near each other and both be correct. Read the slope, the direction changes, and whether the line agrees with price.
Does OBV work on intraday charts, or only daily?
It is computed per bar, whatever the bar is.
Some references write it up as a daily indicator anyway. IG's guide says OBV "measures the volume trend of an asset relative to its price movements and is calculated on a daily basis", and under its own heading "Not suitable for day trading" it adds: "As the OBV is calculated at market close, it's typically not that useful for a day trader to identify buying and selling signals throughout the day." Fidelity writes the arithmetic in days too, as "adding the day's volume to a cumulative total" and "If today's close is greater than yesterday's close". The arithmetic Fidelity prints is correct; the vocabulary assumes a daily stock chart.
MetaTrader's function for the indicator is:
int iOBV(string symbol, ENUM_TIMEFRAMES period, ENUM_APPLIED_VOLUME applied_volume);
The chart's timeframe is an argument you pass in. On a 5-minute chart the close used is the 5-minute close.
The limitation underneath IG's heading is real, but it is not a property of the daily chart: a cumulative line built on closes tells you nothing about what happened inside a bar. That holds on every timeframe, and it is a reason to choose your bar size deliberately.
How do you read an OBV divergence?
Price makes a higher high and OBV does not, or price makes a lower low and OBV does not. Fidelity names both directions:
- "When price continues to make higher peaks and OBV fails to make higher peaks, the upward trend is likely to stall or fail. This is called a negative divergence."
- "When price continues to make lower troughs and OBV fails to make lower troughs, the downward trend is likely to stall or fail. This is called a positive divergence."
A divergence tells you the volume total stopped confirming the price move. It says nothing about when, whether, or in which direction anything resolves. It can also happen for an uninteresting reason: one outsized volume bar shifts the total and leaves the line out of step for a while. TrendSpider lists that among the indicator's limitations, as "Susceptible to sudden volume changes".
Is OBV an oscillator?
No. It is an unbounded cumulative total with no scale, no midline and no upper or lower bound. An oscillator moves inside a range you can read levels from, and OBV has no range to read. That is why it sits in its own pane under price rather than between fixed overbought and oversold lines.
Which volume does OBV use on a currency pair?
Whatever volume figure the platform hands it, and platforms differ on what that figure is. MetaTrader makes the choice explicit: the function above takes the volume type as an argument, and its sample script passes VOLUME_TICK. So the same OBV rule on the same pair can be accumulating two different quantities on two platforms, while the slope still means what the formula says it means on each of them. Check your platform's own documentation for which figure it feeds in.
On ChartLabs charts, the legend shows the bar's volume as you move the cursor across the chart.
OBV or the Accumulation/Distribution line?
They split a bar's volume differently. OBV commits the bar's entire volume to one side, decided only by whether the close was above or below the previous close. The Accumulation/Distribution line splits each bar's volume by where the close sat inside that bar's own high-to-low range, so a close in the middle of a wide bar contributes far less than a close at its extreme.
OBV is blunter and simpler: a close one tick higher counts the same as a close that ran the full range. The A/D line is finer, and it cares nothing about the previous bar.
How do you test an OBV rule?
By logging, for every entry you take, whether OBV's slope agreed with price, then counting the outcomes yourself.
A loop that works on any platform:
- Write the rule down in one sentence, including what OBV has to be doing at entry.
- Step the chart forward one bar at a time, so you cannot see what came next.
- For every entry, log whether OBV's slope agreed with price, diverged from it, or was flat.
- Keep going until the divergence cases appear often enough to be worth comparing.
- Sort your closed trades by what you logged and compare the groups.
Step five needs a filterable trade log rather than a folder of screenshots. Manual bar-by-bar testing in ChartLabs is built around that: you step through real historical data and place trades by hand, every trade saves a snapshot of the chart state you had at the moment of entry, and you can tag trades and filter the analytics by tag afterwards. You can add custom indicators of your own from the Indicators menu, and write indicators in Pine Script in a built-in editor. Drawings and sub-panel indicators save as you work, with each instance styled separately, which matters for a line you want to keep across sessions.
For the mechanics end to end, see our beginner's guide to backtesting a strategy. For the pair-specific parts, forex backtesting.
Next step
If you want to know what an OBV divergence preceded on your instrument and your timeframe, that is a counting job, and it needs a chart you can step through bar by bar. ChartLabs has a 7-day free trial with no credit card, then one plan at $20 a month or $200 a year. Start a free trial and run it on cleaned data from Dukascopy.
Related Topics
Related
Forex Backtesting: Test Your Strategy on Real Data
A practical guide to backtesting forex strategies: why session dynamics, spread variation, and pair-specific behavior change your results, what clean historical data actually means, and a five-step process for testing a strategy before you risk real capital.
Backtesting a Trading Strategy: A Beginner's Guide
What backtesting is, why it matters, and how to run one step by step: defining your rules, choosing clean historical data, stepping through the chart trade by trade, logging results, and reading the metrics that tell you whether your strategy has a real edge.