VolumePine Script v6Built-in Variable

ta.nviNegative Volume Index

Negative Volume Index. Tracks proportional price changes on bars whose volume is lower than the preceding bar; it is not restricted to daily charts.

TradingView language reference

Syntax

Syntax
ta.nvi

Returns

series float

Code Examples

Pine Script v6 Example
//@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

Study price changes on lower-volume bars

Identify divergences between NVI and price

Use NVI/PVI pair for comprehensive volume analysis

Compare lower-volume and higher-volume price behavior without identifying participants

Related Functions

Frequently Asked Questions

ta.nvi is the Negative Volume Index: a cumulative index that updates on bars where volume is lower than the prior bar, based on the proportional price change.

No. The informed-participant interpretation is a hypothesis, not an identification feature. NVI reads price and volume, so it cannot determine whether institutions or retail traders caused a move.

Compare both: NVI for low-volume price behavior and PVI for high-volume behavior. Cross-check trends and divergences with price for a fuller volume picture.

Generate ta.nvi Code with AI

Draft Pine Script using ta.nvi 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.