ta.pvt
Track cumulative volume scaled by each bar's fractional price change.
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.
| Name | Kind | Type | Unit | Default | Range | Description |
|---|---|---|---|---|---|---|
bars | Constant | bars | bars | na | - | Which bars to read: a declared series, or na for the chart's own. |
Output
| Name | Type | Unit |
|---|---|---|
value | number | - |
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
ta.pvt()plot(ta.pvt(), "Price volume trend")