ROC

Calculates the Rate of Change indicator.

Accepts the following parameters:

Parameter NameTypeDefault ValueNotes
applyToSeries<Number>
close
-
periodNumber12-

Returns: Series<Number>

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

12
function ROC(applyTo = close, period = 12):
(applyTo - applyTo[period]) / applyTo[period] * 100