VolumePine Script v6Built-in Variable

ta.pvi

Positive 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

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.