Docs

ta.pvt

Track cumulative volume scaled by each bar's fractional price change.

itm
ta.pvt(bars)

Price-Volume Trend: the running total of (close - close[1]) / close[1] * volume, volume read from bars. That is ta.roc(close, 1)/100 times volume: the fractional return, not the percentage. Accumulated from the first bar of the run with no session anchor.

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 one-bar return needs two) and one carried a volume. 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. A previous close of zero contributes nothing, because the return is undefined there.

Example

itm
ta.pvt()
itm
plot(ta.pvt(), "Price volume trend")