volume indicator
OBV backtesting — On-Balance Volume
On-Balance Volume (OBV) is a running cumulative total that adds a candle’s volume when price closes up and subtracts it when price closes down, tracking whether volume is flowing into or out of a market over time. It has no upper or lower bound and no configurable settings — its value comes entirely from its slope, read either on its own or alongside a separate price-based condition.
How OBV works
OBV starts at an arbitrary baseline and, for every candle, adds the full volume if the close is higher than the prior close, subtracts the full volume if it is lower, and leaves the running total unchanged on an unchanged close. There is no smoothing or lookback window — every historical candle permanently affects the running total, which is why OBV is read by its trend and slope rather than any absolute level. CandleTest computes OBV with TradingView-parity math. Traders watch OBV’s slope — rising or falling — as a read on whether volume is confirming or fighting the price trend, often pairing it with a price-based entry, such as only taking a breakout when OBV is rising — both testable as no-code rules.
Example OBV strategies to backtest
Enter long when the close crosses above a moving average (e.g. the SMA) and OBV is rising — only taking trend entries when volume flow confirms the price move. Exit when OBV is falling.
Enter long when OBV is rising. Exit when OBV is falling — a pure volume-momentum system that ignores price structure entirely.
Every rule above is buildable in the no-code strategy builder — pick conditions, press run, and get win rate, drawdown and equity curve on real exchange data with fees and leverage modeled.
OBV FAQ
What does the OBV line actually measure?
It is a running tally of whether volume has generally been accumulating on up-closes or down-closes since the start of the chart, so it has no fixed scale — only its direction and rate of change carry information, not its absolute value.
Why does OBV have no settings to configure?
It is a pure cumulative sum with no smoothing window by design — every candle is added or subtracted in full. That is also why CandleTest’s only OBV condition is its slope, rising or falling; there is no separate smoothed line to compare it against inside the strategy builder.
What is OBV divergence and does it work?
Divergence is when OBV moves opposite to price — for example price making new highs while OBV fails to — read as a warning that the move lacks volume support. It is a popular concept, but like any pattern-based signal its actual predictive value varies by market and needs to be backtested with a concrete rule rather than eyeballed.
Is CandleTest’s OBV the same as TradingView’s?
Yes — the cumulative add/subtract logic follows TradingView conventions and is unit-tested for parity against known values.