ta.obv
On Balance Volume
On Balance Volume. Measures buying and selling pressure as a cumulative indicator that adds volume on up days and subtracts volume on down days.
Syntax
ta.obvReturns
series float
Code Examples
//@version=6
indicator("On Balance Volume")
plot(ta.obv, color=color.yellow)
// the same on pine
f_obv() =>
ta.cum(math.sign(ta.change(close)) * volume)
plot(f_obv())Trading Applications
Confirm price trends with volume pressure
Detect divergences for early reversal signals
Identify breakout confirmation with OBV trend
Use OBV slope for momentum analysis
Related Functions
Frequently Asked Questions
Generate ta.obv Code with AI
Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.obv and other built-in functions instantly.
Related Pine Script Functions
ta.pvt - Price-Volume Trend
Learn about ta.pvt built-in variable in Pine Script. Access Price-Volume Trend for percentage-weighted volume analysis.
ta.accdist - Accumulation/Distribution
Learn about ta.accdist built-in variable in Pine Script. Access the Accumulation/Distribution Index for money flow analysis.
ta.wad - Williams A/D
Learn about ta.wad built-in variable in Pine Script. Access Williams Accumulation/Distribution for true range volume analysis.
ta.mfi() - Money Flow Index
Learn how to use ta.mfi() in Pine Script. Syntax, parameters, code examples for the volume-weighted RSI indicator.
ta.wvad - Williams Variable A/D
Learn about ta.wvad built-in variable in Pine Script. Access Williams Variable Accumulation/Distribution.