ta.pvi
Positive Volume Index
Positive Volume Index. Tracks price changes on days when volume increases from the previous day.
Syntax
ta.pviReturns
series float
Code Examples
//@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.
Related Pine Script Functions
ta.nvi - Negative Volume Index
Learn about ta.nvi built-in variable in Pine Script. Track smart money activity on low-volume days.
ta.obv - On Balance Volume
Learn about ta.obv built-in variable in Pine Script. Access On Balance Volume for volume-based trend confirmation.
ta.pvt - Price-Volume Trend
Learn about ta.pvt built-in variable in Pine Script. Access Price-Volume Trend for percentage-weighted volume analysis.
ta.accdist - Accumulation/Distribution
Learn about ta.accdist built-in variable in Pine Script. Access the Accumulation/Distribution Index for money flow analysis.
ta.mfi() - Money Flow Index
Learn how to use ta.mfi() in Pine Script. Syntax, parameters, code examples for the volume-weighted RSI indicator.