# Hull moving average

`hma`

Fast, smooth average built from two weighted averages.

## Inputs

| Name | Type | Default | Range |
| --- | --- | --- | --- |
| source | source | close |  |
| period | int | 16 | 2 to 5000 |

## Outputs

| Name | Kind |
| --- | --- |
| hma | value |

Warm-up: period + round_half_up(sqrt(period)) - 2 bars (18 at the defaults).

Repaints: No.

## Formula

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

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