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.
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
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
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.
Related Pine Script Functions
ta.nvi - Negative Volume Index
Learn about ta.nvi in Pine Script. Track proportional price changes on bars with lower volume than the preceding bar.
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.