Hull Moving Average (HMA): Alan Hull's Formula, Its Lag Measured, and a Test of Its Turning Points on Real Prices
The Hull moving average from its author's own formula: how the weighted averages cancel most of the lag, what that costs in noise, and what trading its turning points gave on daily Bitcoin and the S&P 500 ETF.
On this page
The Hull moving average (HMA) is a weighted moving average built to remove most of the lag of an ordinary average while keeping the line smooth. Its author, Alan Hull, writes that he developed it in 2005 while working on another indicator. It takes a weighted average over half the period, doubles it, subtracts a weighted average over the full period, and smooths the result with a short weighted average over the square root of the period. Hull's own advice is to trade its turning points, not price crossing it. Below we compare it with ordinary averages on real daily prices and test the turning point rule on the last 600 daily bars of each, from March 8, 2025 for Bitcoin and June 7, 2024 for the ETF, to October 28, 2026.
Hull moving average (20) on daily Bitcoin, with the EMA and SMA of the same length
- Price, daily candles (hollow up, filled down)
- HMA(20) (solid line)
- EMA(20) (solid line, second color)
- SMA(20) (dashed line)
How the Hull moving average is calculated
A weighted moving average (WMA) of n bars weights the latest bar n, the one before n − 1, and so on down to 1. The half-length WMA is closer to price than the full-length one; doubling it and subtracting the full-length WMA pushes the line further toward the latest price, past where an average would normally sit. That overshoots in noisy markets, so the last step smooths it with a WMA over the square root of n, rounded down.
How the Hull formula cancels lag
Lag and noise compared with other averages
We measured lag as the shift k, from 0 to 40 bars, that minimizes the mean of |averaget / closet−k − 1|, on daily Bitcoin and the S&P 500 ETF (dividend-adjusted), to October 28, 2026, after three lengths of warm-up: the 20-bar lines from May 7, 2025 on Bitcoin and September 4, 2024 on the ETF, the 50-bar lines from August 5, 2025 and January 14, 2025. Over the same periods we counted how often the close crossed each line. Measured with the gap in price instead of percent, the Bitcoin SMA(50) lag is 25 bars instead of 26; the Hull values do not change.
| Average | Bitcoin lag | Bitcoin crossings | ETF lag | ETF crossings |
|---|---|---|---|---|
| SMA(20) | 10 bars | 61 | 10 bars | 70 |
| HMA(20) | 3 bars | 118 | 3 bars | 109 |
| SMA(50) | 26 bars | 31 | 25 bars | 31 |
| HMA(50) | 6 bars | 54 | 6 bars | 77 |
Lag of each average, in bars, on daily prices
- Bitcoin
- S&P 500 ETF
The Hull average does what Hull says: on our data it lagged a quarter to a third as much as a simple average of the same length. The price paid is in crossings: the close crossed a 20-bar Hull line nearly twice as often as a 20-bar simple average on Bitcoin. That is why Hull himself warns against crossover signals, and the chart above shows the EMA and SMA of the same length for comparison. The bar chart adds the EMA of each length: its lag sits between the two. The moving average guide has the same measurement for the EMA and WMA.
Trading the turning points
Hull recommends using the HMA's turning points as entry and exit signals. We tested the simplest version on both series: go long at the next open when the HMA turns up, reverse to short at the next open when it turns down, always in the market, before costs.
| Market and length | From | Trades | Winning closed trades | Result | Holding |
|---|---|---|---|---|---|
| Bitcoin, HMA(20) | April 12, 2025 | 58 | 20 of 57 | +54.50% | −2.49% |
| Bitcoin, HMA(55) | June 1, 2025 | 27 | 10 of 26 | +4.94% | −22.23% |
| S&P 500 ETF, HMA(20) | July 19, 2024 | 73 | 24 of 72 | −16.33% | +43.47% |
| S&P 500 ETF, HMA(55) | November 1, 2024 | 27 | 9 of 26 | +2.90% | +38.30% |
Holding is measured from the first entry of each test to the close of October 28, 2026; each result includes a position still open on that day. Fewer than four trades in ten won with either length. On Bitcoin, which went nowhere or fell over these periods, a system that could go short beat holding; on the rising ETF, every turn down reversed it into a short, and the 20-bar version lost money while holding gained 43%. A trade lasted 9.8 bars on average with the 20-bar HMA on Bitcoin, and 12 of its 57 closed trades were over within three bars.
Trading HMA turning points against holding, before costs
- Turning-point rule
- Holding
The turns on the chart above
The chart shows daily Bitcoin from July 1 to October 28, 2026, with HMA(20). On July 1 the rule was short, from June 22 at 63,312; the HMA turned up on July 3 and the short was closed on July 4 at 62,583.26, a gain of 1.15%. The 16 trades that followed, 15 closed in the window and one still open, went as follows:
- July 4 to August 19, six trades; through August 18 the close stayed between 62,290 and 66,556.16: −0.40%, −4.35% (a one-bar short on July 14), −1.03%, −0.45%, −1.83% and −1.96%;
- long from August 19 at 64,725.42 to August 31 at 77,682: +20.02%;
- three losing trades in early September: −3.42%, −2.35% and −3.09%;
- long September 19 to 30: +3.44%; then −3.43% and −3.71% on two quick reversals in early October;
- short October 8 to 21: +0.35%; long October 21 to 25: −2.58%;
- short from October 25 at 80,888.15, still open on October 28 at a close of 81,343.50: −0.56%.
Three of the 15 closed trades won, and one of them, the August rally, paid for most of the losses: a fast line catches the start of a trend early, and pays for it with many false turns in between.
Does it work?
We have no long-run measurement of the Hull average: our bench tests chart patterns detected by rule against random entries, not indicators (see our methodology). The tests above cover two markets from 2024 or 2025 to October 2026, before costs. They show the lag and noise trade-off, not an edge. For other fast averages, see the ALMA and the Williams Alligator, or the full list of trend indicators.
Frequently asked questions
What is the Hull moving average formula?
HMA = WMA(2 × WMA(close, n / 2) − WMA(close, n), √n), with the half period and the square root rounded down to whole numbers, as Alan Hull writes it.
What is the best setting for the Hull moving average?
The MetaStock code Hull publishes uses 20 as its default input. Shorter lengths turn more often; on our data a 55-bar Hull average made fewer than half as many trades as a 20-bar one. There is no setting that suits every market.
Is the Hull moving average better than the EMA?
It lags less: on our daily data, about 3 bars for a 20-bar HMA against 6 to 7 for a 20-bar EMA, measured in our moving average guide. It is also noisier, so it gives more false turns. Better depends on whether you value speed or fewer signals.
How do you trade the Hull moving average?
Hull recommends its turning points: up for an entry or exit to the long side, down for the short side. He advises against trading price crossings of the line. On our two daily series the turning point rule beat holding on falling Bitcoin and lost to holding on the rising S&P 500 ETF.
Who invented the Hull moving average?
Alan Hull, who writes on his website that he developed it in 2005.
