KER

Calculates the Kaufman's Efficiency Ratio indicator.

Accepts the following parameters:

Parameter NameTypeDefault ValueNotes
applyToSeries<Number>
close
-
periodNumber20-

Returns: Series<Number>

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

1234
function KER(applyTo = close, period = 20):
change = Math.Abs(applyTo - applyTo[period])
volatility = Sum(Math.Abs(applyTo - applyTo[1]), period)
change / volatility * 100