hma
Hull Moving Average
hma(source, period)
Parameters
| Name | Type | Description |
|---|---|---|
source |
source | Data series to calculate HMA on - price field (close, open, high, low) or indicator output |
period |
int | Number of periods for the moving average |
Formula
```
HMA = WMA(2 * WMA(n/2) - WMA(n), sqrt(n))
Where:
- n = period
- WMA(n/2) = weighted MA with half period
- WMA(n) = weighted MA with full period
- Final WMA uses sqrt(n) as the period
```
Examples
hma(close, 9); # 9-period Hull MA (fast, responsive)
hma(close, 20); # 20-period Hull MA (standard)
x = hma(close, 50); close > x; # Price above 50-period HMA
Returns
Hull moving average value with reduced lag compared to traditional MAs ## References - TradingView: `ta.hma()` - Developed by Alan Hull ## Notes - Uses WMA internally (3-level nested calculation) - More responsive than SMA/EMA with similar smoothness - sqrt(period) provides the smoothing in final step