VolumePine Script v6Built-in Variable

ta.pviPositive Volume Index

Positive Volume Index. Tracks proportional close changes on bars whose volume exceeds the prior bar; it is not limited to daily charts.

TradingView language reference

Syntax

Syntax
ta.pvi

Returns

series float

Code Examples

Pine Script v6 Example
//@version=6
indicator("Positive Volume Index")

plot(ta.pvi, color=color.yellow)

// the same on pine
f_pvi() =>
    float ta_pvi = 1.0
    float prevPvi = (nz(ta_pvi[1], 0.0) == 0.0) ? 1.0 : ta_pvi[1]
    if nz(close, 0.0) == 0.0 or nz(close[1], 0.0) == 0.0
        ta_pvi := prevPvi
    else
        ta_pvi := (volume > nz(volume[1], 0.0)) ? prevPvi + ((close - close[1]) / close[1]) * prevPvi : prevPvi
    result = ta_pvi

plot(f_pvi())

Trading Applications

Study price behavior on higher-volume bars

Compare higher-volume and lower-volume price behavior with NVI

Keep participant identity unknown; price and volume do not identify traders

Describe price changes conditional on higher volume without claiming causation

Related Functions

Frequently Asked Questions

ta.pvi is the Positive Volume Index: a cumulative index that updates when volume exceeds the prior bar, scaled by the percent change in close.

PVI reacts on higher-volume bars; NVI reacts on lower-volume bars. Together they split price behavior by volume regime.

Use PVI trend and divergences with price on liquid sessions, and compare with NVI. Confirm signals with price structure and risk management.

Generate ta.pvi Code with AI

Draft Pine Script using ta.pvi with Pineify's AI Coding Agent, then review the arguments and test the result on your chart. Usage depends on your plan and available credits.