Docs

ta.obv

Track cumulative volume signed by each bar's direction to confirm a trend.

itm
ta.obv(bars)

On-Balance Volume: the running total of each bar's volume, signed by the direction of its close against the previous close. It accumulates from the first bar of the run and reads volume from bars. An unchanged close adds nothing. Like ta.vwap and ta.cum it does not reset at the session open.

Parameters

A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.

NameKindTypeUnitDefaultRangeDescription
barsConstantbarsbarsna-Which bars to read: a declared series, or na for the chart's own.

Output

NameTypeUnit
valuenumber-

Warm-up and missing values

Warm-up
2 bars.
Missing values
na until a second bar has been seen (the first close-to-close direction needs two bars) and one of them carried a volume. A bar with na volume leaves the running total where it was and does not reset it.

Example

itm
ta.obv()
itm
plot(ta.obv(), "On balance volume")