Trend indicators

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.

· Founder of PatternsWizard
Checked 8 min read
HMA(20), with EMA(20) and SMA(20)
On this page
  1. How the Hull moving average is calculated
  2. Lag and noise compared with other averages
  3. Trading the turning points
  4. The turns on the chart above
  5. Does it work?
  6. Frequently asked questions

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

87,39672,59857,800Jul 1, 2026Aug 29, 2026Oct 28, 2026
  • Price, daily candles (hollow up, filled down)
  • HMA(20) (solid line)
  • EMA(20) (solid line, second color)
  • SMA(20) (dashed line)
HMA(20), with EMA(20) and SMA(20) on Bitcoin, daily, July 1, 2026 to October 28, 2026. Illustration of how the indicator reads, not a backtest.

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

Price jumps to a new levelFull-period WMA: the slowestHalf-period WMA: closer to priceTwice the half minus the full: overshootsHull: that line, smoothed over a short window
Schematic, not market data. Exact computation on an abstract step with a period of 16: half period 8, smoothing over 4 bars.

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.

AverageBitcoin lagBitcoin crossingsETF lagETF crossings
SMA(20)10 bars6110 bars70
HMA(20)3 bars1183 bars109
SMA(50)26 bars3125 bars31
HMA(50)6 bars546 bars77

Lag of each average, in bars, on daily prices

SMA(20)10 bars10 barsEMA(20)6 bars7 barsHMA(20)3 bars3 barsSMA(50)26 bars25 barsEMA(50)16 bars20 barsHMA(50)6 bars6 bars
  • Bitcoin
  • S&P 500 ETF
Our computation; the inputs and the method are in the text.Lag: the shift from 0 to 40 bars that best lines the average up with past closes, as described above. Bitcoin to October 28, 2026 from May 7, 2025 (20 bars) and August 5, 2025 (50 bars); ETF from September 4, 2024 and January 14, 2025. The EMA lines are measured the same way.

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 lengthFromTradesWinning closed tradesResultHolding
Bitcoin, HMA(20)April 12, 20255820 of 57+54.50%−2.49%
Bitcoin, HMA(55)June 1, 20252710 of 26+4.94%−22.23%
S&P 500 ETF, HMA(20)July 19, 20247324 of 72−16.33%+43.47%
S&P 500 ETF, HMA(55)November 1, 2024279 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

Bitcoin, HMA(20)+54.5%−2.5%Bitcoin, HMA(55)+4.9%−22.2%S&P 500 ETF, HMA(20)−16.3%+43.5%S&P 500 ETF, HMA(55)+2.9%+38.3%
  • Turning-point rule
  • Holding
Our computation; the inputs and the method are in the text.Long after a turn up, short after a turn down, at the next open, always in the market. From the first entry (April 12 and June 1, 2025 on Bitcoin; July 19 and November 1, 2024 on the ETF) to the close of October 28, 2026, open position included.

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.

Sources

  1. Alan Hull, Hull Moving Average
  2. MetaTrader 5 Help, Moving Average (linear weighted moving average)
, Founder of PatternsWizard

Passionate about finance, quantitative trading and data analysis. Amaury built the PatternsWizard test bench, which detects each pattern on full price history and measures what happened next against random entries.

PatternsWizard tests chart and candlestick patterns on full market history, against random entries. How we test patterns.

179 patterns testedRandom-walk self-test passed

All trend indicators articles