HMA

Calculates the Hull Moving Average indicator.

Accepts the following parameters:

Parameter NameTypeDefault ValueNotes
applyToSeries<Number>--
periodNumber--

Returns: Series<Number>

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

1 function HMA(applyTo, period):
2 WMA(
3 applyTo: 2 * WMA(applyTo, period / 2) - WMA(applyTo, period),
4 period: period // 2
5 )