ta.pvi - Pine Script Variable
ta.pvi
Section titled “ta.pvi”Overview
Section titled “Overview”Positive Volume Index.
floatQualifier
Section titled “Qualifier”series
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("Positive Volume Index")plot(ta.pvi, color=color.yellow)// the same on pinef_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 ornz(close[1], 0.0) == 0.0 ta_pvi := prevPvielse ta_pvi := (volume > nz(volume[1], 0.0)) ? prevPvi + ((close - close[1]) / close[1]) * prevPvi : prevPvi result = ta_pviplot(f_pvi())