Hull moving average

hmamoving_averagesForge API 1

Fast, smooth average built from two weighted averages.

Inputs

NameTypeDefaultRange
sourcesourceclose
periodint162 to 5000

Outputs

NameTypeRequiredDescription
hmavalueOptionalcolor theme.accent, style line, width 1
Warm-up
period + round_half_up(sqrt(period)) - 2 bars (18 at the defaults)
Repaints
No
Parity
None

Formula

half = floor(period / 2 + 0.5), root = floor(sqrt(period) + 0.5)

HMA = WMA(2 * WMA(x, half) - WMA(x, period), root)