P
PipsGrowth

Key Takeaways

Difficulty:Beginner
Reliability:Moderate
Category:volume
Timeframes:1H, 4H, Daily

On-Balance Volume (OBV)

volumešŸ“Š 1H, 4H, Daily

Cumulative indicator that adds volume on up days and subtracts on down days. Shows buying/selling pressure.

Formula

Code
If Close > Close(prev): OBV = OBV(prev) + Volume
If Close < Close(prev): OBV = OBV(prev) - Volume

Detailed Explanation

On-Balance Volume (OBV) was developed by Joe Granville. It creates a running total of volume, adding volume on up days and subtracting on down days.

Key Concept:
Volume precedes price. Changes in OBV often lead price movements.

Trading Applications:
- Trend Confirmation: OBV trending with price
- Divergence: OBV and price disagreement
- Breakout Confirmation: Volume supporting breakouts

Trading Setup Example

Entry, stop loss, and take profit levels.

šŸ“ˆ Buy Setup
On-Balance Volume (OBV)ConfirmEntryTake ProfitStop LossCandlesVolIndicatorBUY
šŸ“‰ Sell Setup
On-Balance Volume (OBV)ConfirmEntryTake ProfitStop LossCandlesVolIndicatorSELL

Always wait for signal confirmation before entering a trade.

Where This Indicator Works Best

Trend context and market position.

šŸ“ˆ Bullish Context
Low VolumeConfirmationHigh Vol ↑
šŸ“‰ Bearish Context
Low VolumeConfirmationHigh Vol ↓

Confirms price moves through volume analysis.

Live Chart — On-Balance Volume (OBV)

See On-Balance Volume (OBV) in action on a live chart. Try changing the settings and timeframe.

šŸ“ˆ Bullish Signals

OBV rising while price consolidates, bullish divergence

šŸ“‰ Bearish Signals

OBV falling while price consolidates, bearish divergence

Python Implementation

OBV calculation

Python
import pandas_ta as ta
df['OBV'] = ta.obv(df['close'], df['volume'])

TradingView Pine Script

JavaScript
//@version=5
indicator("OBV")
obv = ta.obv
plot(obv, "OBV", color=color.blue)
šŸ“Š Use TradingView for Advanced Charting
Professional analysis tools with 100+ technical indicators
Get TradingView Pro

MT5 MQL5 Code

C++
int obv_handle = iOBV(_Symbol, _Period, VOLUME_TICK);
double obv[];
CopyBuffer(obv_handle, 0, 0, 100, obv);

Common Mistakes

āœ—Using OBV without volume data (forex spot)
āœ—Ignoring OBV divergences

Confirmation Signals

Price breakout
Trend indicators

Best For

Volume confirmationDivergence tradingTrend validation

šŸ’” Pro Tips

  • •OBV divergence is a powerful leading indicator
  • •Works best in markets with reliable volume data
  • •Trend in OBV should confirm price trend
Last updated: February 8, 2026

Educational Disclaimer

This content is for educational purposes only and does not constitute financial or investment advice. Trading involves significant risk and you may lose your capital. Always consult a licensed financial advisor before making investment decisions.

Frequently Asked Questions

On-Balance Volume (OBV) - Complete Guide with Python & TradingView Code