ta.nvi
Negative Volume Index
Negative Volume Index. Tracks price changes on days when volume decreases from the previous day.
Syntax
ta.nviReturns
series float
Code Examples
//@version=6
indicator("Negative Volume Index")
plot(ta.nvi, color=color.yellow)
// the same on pine
f_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 or nz(close[1], 0.0) == 0.0
ta_nvi := prevNvi
else
ta_nvi := (volume < nz(volume[1], 0.0)) ? prevNvi + ((close - close[1]) / close[1]) * prevNvi : prevNvi
result = ta_nvi
plot(f_nvi())Trading Applications
Track smart money activity on low-volume days
Identify divergences between NVI and price
Use NVI/PVI pair for comprehensive volume analysis
Detect institutional accumulation patterns
Related Functions
Frequently Asked Questions
Generate ta.nvi Code with AI
Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.nvi and other built-in functions instantly.
Related Pine Script Functions
ta.pvi - Positive Volume Index
Learn about ta.pvi built-in variable in Pine Script. Track crowd behavior on high-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.