NegativeVolumeIndex

Calculates the Negative Volume Index indicator.

Accepts the following parameters:

Parameter NameTypeDefault ValueNotes
applyToSeries<Number>
close
-

Returns: Series<Number>

NegativeVolumeIndex is a built-in function - you can use it directly. Below is an example implementation:

1234
function NegativeVolumeIndex(applyTo = close):
series NVI: once: 100 if isknown volume and isknown applyTo else unknown rest: NVI + ((applyTo - applyTo[1]) / applyTo[1]) * NVI if volume <= volume[1] else NVI