VolumePine Script v6Built-in Variable

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

Syntax
ta.obv

Returns

series float

Code Examples

Pine Script v6 Example
//@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.