Docs

ta.pvi

Follow the index that moves only on bars with higher volume than the bar before.

itm
ta.pvi(bars)

Positive Volume Index: starts at 100 and, on each bar whose volume is strictly higher than the previous bar's, compounds the bar's return: index := index + index * (close - close[1]) / close[1]. Every other bar carries it forward unchanged. Volume and close are read from bars. The 100 seed is the same one ta.nvi uses.

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
1 bar.
Missing values
Seeded at 100 on the first bar with a usable close and volume, so it is na only before that. A bar this cannot be computed on leaves the running total where it was. It does not reset it and does not restart the accumulation. An unchanged or falling volume carries the index forward unchanged.

Example

itm
ta.pvi()
itm
plot(ta.pvi(), "Positive volume")