ta.nvi - Pine Script Variable
ta.nvi
Section titled “ta.nvi”Overview
Section titled “Overview”Negative Volume Index.
floatQualifier
Section titled “Qualifier”series
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("Negative Volume Index")plot(ta.nvi, color=color.yellow)// the same on pinef_nvi() => float ta_nvi = 1.0 float prevNvi = (nz(ta_nvi[1], 0.0) == 0.0) ? 1.0 : ta_nvi[1]if nz(close, 0.0) == 0.0 ornz(close[1], 0.0) == 0.0 ta_nvi := prevNvielse ta_nvi := (volume < nz(volume[1], 0.0)) ? prevNvi + ((close - close[1]) / close[1]) * prevNvi : prevNvi result = ta_nviplot(f_nvi())