hma
Hull Moving Average
hma(source, period)
Parameters
| Name | Type | Description |
|---|---|---|
source |
field | Data series to calculate HMA on |
period |
int | Number of periods for the moving average |
Formula
HMA = WMA(2 * WMA(n/2) - WMA(n), sqrt(n))
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
float
Range
period must be 2-400
Notes
Uses WMA internally (3-level nested calculation); sqrt(period) provides the final smoothing step
References
TradingView: ta.hma(); developed by Alan Hull