OnBalanceVolume

Calculates the On Balance Volume indicator.

Accepts the following parameters:

Parameter NameTypeDefault ValueNotes
applyToSeries<Number>
close
-

Returns: Series<Number>

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

1234
function OnBalanceVolume(applyTo = close):
series OBV: once: 0 if isknown volume and isknown applyTo else unknown rest: OBV + (volume if Rises(applyTo) else -volume if Falls(applyTo) else 0)