volume indicator
On-Balance Volume (OBV)
OBV is a cumulative volume indicator that adds the period's volume when the close is up and subtracts it when the close is down. It measures buying and selling pressure to confirm price trends.
Formula
If Close > PrevClose: OBV = PrevOBV + Volume If Close < PrevClose: OBV = PrevOBV - Volume If Close = PrevClose: OBV = PrevOBV
Common strategies
- Trend confirmation: OBV rising alongside price confirms the uptrend is volume-supported; divergence warns of weakness.
- OBV divergence: Price makes a new high but OBV doesn't — bearish divergence signaling the rally lacks volume support.
- Breakout anticipation: OBV often breaks out before price, signaling accumulation/distribution ahead of a move.
How CommonQuant uses it
CommonQuant pre-calculates OBV on all timeframes. DSL strategies can reference obv() to incorporate volume confirmation into entry and exit conditions.
Frequently asked questions
What does a rising OBV mean?
A rising OBV indicates accumulation — buyers are more aggressive on up periods. When accompanied by rising prices, it confirms the uptrend is backed by volume.
Can OBV be used alone?
OBV is best used as a confirmation indicator alongside price action and trend indicators. Used alone, it can give false signals during choppy, volume-heavy markets.