ta.obvOn Balance Volume
On Balance Volume. Accumulates volume with the sign of each close-to-close change: adds on rising bars, subtracts on falling bars, and adds zero when the close is unchanged. This is a volume proxy, not buyer/seller identification.
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
Study divergence as a hypothesis, not a timed reversal forecast
Identify breakout confirmation with OBV trend
Use OBV slope for momentum analysis
Related Functions
Frequently Asked Questions
Generate ta.obv Code with AI
Draft Pine Script using ta.obv with Pineify's AI Coding Agent, then review the arguments and test the result on your chart. Usage depends on your plan and available credits.
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 in Pine Script. Calculate cumulative price movement using true highs and lows; this formula does not use volume.
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.