ta.nvi
Follow the index that moves only on bars with lower volume than the bar before.
ta.nvi(bars)Negative Volume Index: starts at 100 and, on each bar whose volume is strictly lower than the previous bar's, compounds the bar's return: index := index + index * (close - close[1]) / close[1]. Every other bar carries it forward unchanged. Volume and close are read from bars. The 100 seed is a scale, so any ratio or crossing against a moving average of the index is unaffected by it.
Parameters
A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.
| Name | Kind | Type | Unit | Default | Range | Description |
|---|---|---|---|---|---|---|
bars | Constant | bars | bars | na | - | Which bars to read: a declared series, or na for the chart's own. |
Output
| Name | Type | Unit |
|---|---|---|
value | number | - |
Warm-up and missing values
- Warm-up
- 1 bar.
- Missing values
- Seeded at 100 on the first bar with a usable close and volume, so it is na only before that. A bar this cannot be computed on leaves the running total where it was. It does not reset it and does not restart the accumulation. An unchanged or rising volume carries the index forward unchanged, which is the operator's whole point.
Example
ta.nvi()plot(ta.nvi(), "Negative volume")