On Balance Volume
systemic:core-obvIndicatorsfunction1 crInputs
| Name | Type | Description |
|---|---|---|
| Price | floatarray | The closing price series used to determine the direction of each period's volume contribution. |
| Volume | floatarray | The trading volume series representing the number of shares, contracts, or units traded during each period. |
Outputs
| Name | Type | Description |
|---|---|---|
| OBV | floatarray | A cumulative volume indicator reflecting the running total of volume adjusted by price direction. |
Overview
On Balance Volume (OBV) is a momentum indicator developed by Joseph Granville in 1963 and introduced in his book Granville's New Key to Stock Market Profits. The core thesis behind OBV is elegantly simple: volume precedes price.
Granville observed that significant price movements are typically preceded by changes in volume. When large volumes flow into an asset without an immediate corresponding price change, the indicator suggests a price move is "loading"—like a coiled spring ready to release.
The Core Principle: OBV doesn't care about the magnitude of price changes—only their direction. If today's close is higher than yesterday's, all of today's volume is considered "buying pressure." If lower, it's "selling pressure."
This simplicity makes OBV one of the most straightforward volume-based indicators, yet its insights can be remarkably powerful for identifying hidden accumulation or distribution before price catches up.
The Formula
OBV is a cumulative indicator calculated by adding or subtracting each period's volume based on price direction:
Where:
- = Volume at time
- = Closing price at time
- = Previous OBV value
Calculation Logic
flowchart TD
START["📊 New Period Data<br/>(Price, Volume)"]
COMPARE{"Compare Today's Close<br/>to Yesterday's Close"}
UP["Today > Yesterday<br/>🟢 UP DAY"]
DOWN["Today < Yesterday<br/>🔴 DOWN DAY"]
FLAT["Today = Yesterday<br/>⚪ UNCHANGED"]
ADD["Add Volume to OBV<br/>OBV = OBV + Volume"]
SUB["Subtract Volume from OBV<br/>OBV = OBV − Volume"]
KEEP["Keep OBV Unchanged<br/>OBV = OBV"]
OUTPUT["📈 New OBV Value"]
START --> COMPARE
COMPARE -->|Higher| UP --> ADD --> OUTPUT
COMPARE -->|Lower| DOWN --> SUB --> OUTPUT
COMPARE -->|Equal| FLAT --> KEEP --> OUTPUT
Step-by-Step Example
Consider a stock over 5 days with the following data:
| Day | Close | Volume | Price Change | OBV Calculation | OBV |
|---|---|---|---|---|---|
| 1 | $10.00 | 1,000 | — | Start at 0 | 0 |
| 2 | $10.50 | 2,000 | ↑ Up | 0 + 2,000 | 2,000 |
| 3 | $10.30 | 1,500 | ↓ Down | 2,000 − 1,500 | 500 |
| 4 | $10.30 | 800 | → Unchanged | 500 + 0 | 500 |
| 5 | $10.80 | 3,000 | ↑ Up | 500 + 3,000 | 3,500 |
Notice that Day 4 had 800 shares traded, but since the price didn't change, none of that volume affected the OBV. This is a key characteristic of OBV—only directional days contribute.
Interpreting OBV
The Absolute Value Doesn't Matter
Unlike price, the actual numerical value of OBV is arbitrary—it depends entirely on where the calculation started. What matters is the trend and direction of OBV:
| OBV Behavior | Interpretation |
|---|---|
| Rising OBV | Volume is flowing into the asset (accumulation) |
| Falling OBV | Volume is flowing out of the asset (distribution) |
| Flat OBV | No clear volume conviction |
Smart Money Theory
Granville believed OBV could reveal the activity of institutional investors ("smart money") before retail traders caught on:
- Institutional accumulation: Large buyers start purchasing before a rally. OBV rises while price stays flat.
- Price follows volume: Eventually, retail buyers notice and push prices up.
- Institutional distribution: Large sellers exit at the top. OBV falls while price stays elevated.
- Price catches down: Retail holders are left with falling prices.
Key Trading Signals
1. Trend Confirmation
When OBV moves in the same direction as price, the trend is confirmed:
| Price Trend | OBV Trend | Interpretation |
|---|---|---|
| ↑ Rising | ↑ Rising | Strong uptrend with volume support |
| ↓ Falling | ↓ Falling | Strong downtrend with volume support |
2. Divergences
Divergences between OBV and price can signal potential reversals:
flowchart LR
subgraph BULL["🟢 Bullish Divergence"]
B1["Price makes<br/>LOWER lows"]
B2["OBV makes<br/>HIGHER lows"]
B3["Accumulation detected<br/>Potential reversal UP"]
end
subgraph BEAR["🔴 Bearish Divergence"]
C1["Price makes<br/>HIGHER highs"]
C2["OBV makes<br/>LOWER highs"]
C3["Distribution detected<br/>Potential reversal DOWN"]
end
B1 --> B2 --> B3
C1 --> C2 --> C3
3. Breakout Confirmation
OBV can confirm price breakouts:
- Strong breakout: Price breaks resistance AND OBV breaks its own resistance
- Weak breakout: Price breaks resistance but OBV fails to confirm (potential false breakout)
Practical Applications
Volume-Price Confirmation Strategy
Before entering a trade, use OBV to confirm that volume supports the price action:
- Identify a price trend or potential breakout
- Check if OBV confirms the direction (rising OBV for bullish, falling for bearish)
- Watch for OBV to break its own trendlines or levels
- Enter only when both price AND volume confirm
Accumulation/Distribution Detection
OBV can reveal hidden buying or selling:
- Flat price + Rising OBV: Someone is quietly accumulating shares
- Flat price + Falling OBV: Someone is quietly distributing shares
- These patterns often precede significant moves
Multi-Asset Flow Analysis
Compare OBV trends across related assets to see where capital is flowing. For example, if Bitcoin's OBV is rising while Ethereum's is falling, it may indicate rotation from ETH to BTC.
Edge Cases and Limitations
Leading Indicator Risks
As a leading indicator, OBV can produce signals before price confirms them—or produce false signals entirely. Always use OBV alongside other analysis techniques.
Gap Days Can Distort OBV
If a stock gaps up on enormous volume (e.g., earnings surprise), that single day's volume is added to OBV even though the move may be a one-time event. This can skew the indicator for an extended period.
No Magnitude Consideration
OBV treats a 10 gain with 1 million shares. Both add 1 million to OBV. Consider using Volume-Price Trend (VPT) if magnitude matters.
Low-Volume Periods
In low-volume markets or during consolidation, OBV can give erratic or meaningless signals. The indicator works best when there's meaningful volume to analyze.
Data Alignment and Multi-Input Considerations
OBV requires synchronized Price and Volume series of equal length — the module rejects mismatched lengths rather than padding one series to fit.
Critical Alignment Warning
OBV's logic depends on comparing consecutive closes:
Misaligned data can produce:
- Incorrect direction assignments when price and volume correspond to different periods
- Distorted cumulative totals that compound over the entire OBV history
Best Practice: Always source Price and Volume from the same OHLCV data feed and timeframe. OBV's cumulative nature means early misalignment errors persist throughout the entire calculation.
Missing Data (Closed-Market Bars)
A bar with no price or no volume (a weekend, holiday, or data gap) never fabricates a value: OBV emits null at that slot instead of assuming "unchanged." The running total resumes from the next fully-observed bar, comparing it against the last valid close — so a Friday-to-Monday comparison behaves exactly like a Friday-to-Saturday one would, and no volume is silently dropped or invented. OBV seeds at 0 on the first fully-observed bar; a null volume with a valid price still advances the last-valid-close used by the next comparison, since only the magnitude (not the direction) is undetermined.
Indicator Profile
quadrantChart
title OBV Indicator Profile
x-axis Low Popularity --> High Popularity
y-axis Low Reliability --> High Reliability
quadrant-1 High potential
quadrant-2 Established leaders
quadrant-3 Niche tools
quadrant-4 Popular but risky
OBV - Stocks: [0.75, 0.70]
OBV - Crypto: [0.65, 0.55]
Profile Dimensions
| Dimension | Stocks | Crypto | Explanation |
|---|---|---|---|
| Popularity | 0.75 | 0.65 | Classic indicator from 1963, widely taught and used. Cryptocurrency traders increasingly adopting volume-based analysis. |
| Reliability | 0.70 | 0.55 | Well-established for stocks with centralized volume data. Crypto reliability lower due to fragmented exchange volume and wash trading concerns. |
| Complexity | Low | Low | Simple directional logic makes OBV one of the most accessible volume indicators. |
| Versatility | High | Moderate | Works across all liquid equity markets. Crypto applicability limited by volume data quality concerns. |
| Recent Interest | Stable | Growing | Established staple in technical analysis. Crypto traders exploring volume indicators to detect whale activity. |
Further Reading
- On-Balance Volume (OBV) - Investopedia — Comprehensive guide with examples
- Volume Analysis - Investopedia — Understanding trading volume fundamentals
- Accumulation/Distribution Line - Investopedia — A related volume indicator for comparison