VolumePine Script v6Built-in Variable

ta.pviPositive Volume Index

Positive Volume Index. Tracks price changes on days when volume increases from the previous day.

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

Track crowd behavior on high-volume days

Pair with NVI for complete volume analysis

Identify retail vs institutional activity

Detect volume-driven price movements

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

Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.pvi and other built-in functions instantly.