Hull moving average: less lag than EMA or SMA, but better signals?
The Hull moving average turns a few bars earlier than an EMA or SMA of the same length. That speed helps in a trend and hurts in a range, where every extra flip is a trade that pays commission and slippage. Whether its signals are better is a question for a backtest after costs, run against a plain trend rule on the same data.
By Soren Huang · Published · updated · Editorial policy
Contents
- Does the Hull moving average give better signals than EMA or SMA?
- How is the Hull moving average calculated?
- How do you choose the Hull MA length?
- How do you read trend direction from the Hull MA?
- Why does the Hull MA whipsaw in sideways markets?
- How do you backtest the Hull MA against a plain trend rule?
- Frequently asked questions
- References
Does the Hull moving average give better signals than EMA or SMA?
The Hull moving average turns earlier than an EMA or SMA of the same length, but it does not give better signals on its own. In a trending market the earlier turn gains a few bars. In a sideways market it produces more false turns, and each one is a trade that pays commission and slippage. A backtest after costs decides, not the chart.
The Hull moving average is a moving average built from three weighted moving averages, arranged so that most of the delay of a normal average is removed. Lag is the number of bars between a turn in price and the turn in the line that follows it. A simple moving average (SMA) of 16 bars gives every bar the same weight, so it reacts slowly. An exponential moving average (EMA) weights recent bars more, so it reacts sooner. The Hull MA (often listed as the HMA indicator on charting platforms) reacts sooner still. On the same top in price, the three lines turn down in the same direction, only at different bars.
That is the claim this article tests: speed is not quality. A faster line gives you a better entry when the move continues and a worse one when it does not, and the balance between the two is what a backtest measures. Where the Hull MA sits among other tools, and which of them can be written as exact rules at all, is covered in which technical analysis tools and indicators you can actually test.
How is the Hull moving average calculated?
The Hull MA is three weighted moving averages combined in a fixed order: remove the lag first, then smooth the result. A weighted moving average (WMA) is an average in which the newest bar gets the largest weight and each older bar gets one step less, down to the oldest bar in the window. For a length n the steps are:
- Take a WMA of half the length (n/2) and a WMA of the full length (n).
- Double the half-length WMA and subtract the full-length WMA. The short average runs ahead of the long one, and the subtraction pushes the result ahead of price's average, which cancels most of the lag.
- Smooth that difference with a WMA whose length is the square root of n. The second step adds jaggedness; the short final WMA takes it back out without adding much delay.
Written as one formula:
HMA(n) = WMA( 2 × WMA(n/2) − WMA(n), √n )
Here HMA(n) is the Hull MA of length n, WMA(n/2) is the weighted average over half the bars, WMA(n) is the weighted average over all n bars, and the outer WMA(…, √n) is a weighted average of that difference over a window as long as the square root of n. Half lengths and square roots that are not whole numbers are rounded to whole bars.
The same idea of subtracting a slow average from a doubled fast one is used by the double exponential moving average, which is built from EMAs instead of WMAs and has no final smoothing step. The DEMA indicator and how it cuts EMA lag covers that construction. The Hull MA goes one step further: WMAs respond faster than EMAs of the same length, and the square-root smoothing is short, so the finished line hugs price more closely than either DEMA or EMA. Closeness to price is exactly what makes it fast in a trend and noisy in a range, as the later sections show.
How do you choose the Hull MA length?
Choose the length from the number of bars in the kind of move you want to follow, then test a band of neighbouring lengths rather than one value. A Hull MA that follows a 20-bar swing needs a length near 20; one that follows a 60-bar trend needs a length near 60. The common Hull MA settings of 9, 16, 25 and 49 are popular because their square roots are whole numbers (3, 4, 5 and 7), not because they match any market.
The same length means a very different stretch of time on different bar sizes, so a setting that someone reports for daily bars says nothing about a 5-minute chart:
| Length | Half length | Square-root length | Span on 5-minute bars | Span on daily bars |
|---|---|---|---|---|
| 9 | 4 | 3 | 45 min | about 2 weeks |
| 16 | 8 | 4 | 80 min | about 3 weeks |
| 25 | 12 | 5 | about 2 h | about 5 weeks |
| 49 | 24 | 7 | about 4 h | about 10 weeks |
A practical order of steps:
- Measure, on your own bar size, how many bars a typical move you want to catch lasts. Count ten or twenty past moves and take the middle value.
- Start with a length near that count. If the moves last about 20 bars, test the band from 14 to 28, not the single value 20.
- Read the results of the whole band together. A length that does well while its neighbours do poorly describes noise in that history; a band where neighbouring lengths behave alike describes something the market actually did. Parameter stability: plateau or lucky spike shows how to read that surface.
How do you read trend direction from the Hull MA?
The two usual signals are a turn in the slope of the line and a close crossing the line, and they behave differently: the slope turn fires earlier and more often, the cross fires later and less often. A slope turn is the bar on which the Hull MA value changes from falling to rising (or rising to falling). A price cross is the bar on which the close moves from one side of the line to the other. Because the Hull MA hugs price, the close spends most of its time near the line, and a cross can come several bars after the slope has already turned.
| Signal | Rule as written | Fires | Frequency | Typical use |
|---|---|---|---|---|
| Slope turn | HMA today > HMA yesterday, and HMA yesterday < HMA two bars ago | Early, at the first up-bar of the line | High; every wobble of the line is a signal | Trend direction, colouring the line |
| Price cross | Close today > HMA today, and close yesterday < HMA yesterday | Later, once price has pulled away from the line | Lower; small wobbles do not cross | Entry and exit trigger |
Either signal must be written as an exact rule before it can be tested, with the bar it fires on and the bar it fills on stated. Next-bar execution is the rule that a signal read at the close of one bar is filled at the open of the following bar, because the close that triggered the signal is already gone when you see it. A complete long rule reads like this:
- Compute HMA(16) on closed bars only.
- At the close of a bar, if HMA(16) is above its value one bar earlier and was below it two bars earlier, flag a long entry.
- Fill the entry at the open of the next bar.
- At the close of a later bar, if HMA(16) is below its value one bar earlier, flag the exit; fill it at the open of the next bar.
Written this way, the rule has no judgement left in it, so two people running it on the same data get the same trade list. A rule such as "enter when the Hull MA turns green" is not testable until it is turned into statements like these.
Why does the Hull MA whipsaw in sideways markets?
The construction that removes lag also lets more of the bar-to-bar noise through, so in a range the slope of the Hull MA flips back and forth while a slower line barely moves. A whipsaw is a signal that reverses soon after it fires, so the trade is closed at a small loss and often re-opened in the other direction. An SMA of 16 bars averages the noise of a flat range away; the Hull MA of 16 bars, with its effective reaction time of only a few bars, follows the small swings inside the range and turns at each one.
Hypothetical example
Suppose a 40-bar range in which the Hull MA slope flips six times and the SMA slope flips once. Suppose each false flip costs $150 of price movement plus $45 of commission and slippage, and the one true move at the end of the range gains $900 before costs for either line. The Hull MA rule ends the stretch at about 6 × (−$195) + $855 = −$315. The SMA rule ends at about −$195 + $855 = $660, even though it entered the final move later. The numbers are invented; the shape is what matters: the faster line loses the range and must win it back in the trend.
Traders who keep the Hull MA for its speed usually add a filter that stops the slope signal from firing in a range, and each filter buys fewer flips with later entries:
- A momentum filter. Take the slope turn only when the MACD line and its signal line agree on direction. Ranges give small, crossing MACD values, so many flips are skipped.
- An overbought or oversold filter. Take long slope turns only when the stochastic oscillator's %K and %D are below a chosen level, so the entry comes from a pullback rather than from the middle of a range.
- A minimum slope size. Require the Hull MA to rise by more than a set number of ticks per bar before the turn counts. Small wobbles inside a range do not reach the size; the start of a real move does.
Every filter is another parameter, so the band-of-neighbours test from the length section applies to it too: a filter threshold that works at one value only is as suspect as a length that does.
How do you backtest the Hull MA against a plain trend rule?
Run the Hull MA rule and a plain trend rule on the same market, bar size, period and costs, and judge both on average trade after costs and on how their neighbouring settings behave. A plain trend rule is any simple rule that is long while price shows an uptrend and short while it shows a downtrend, such as an SMA cross or a channel breakout. It is the yardstick: if the Hull MA rule does not beat it after costs on the same data, its speed bought nothing. Research on simple moving average rules has long made the same point. Brock, Lakonishok and LeBaron (1992) found patterns behind basic moving average rules on a long stock index history, and Park and Irwin (2007), reviewing later studies, found that results depend heavily on costs and on how many rules were tried before one was reported.
- Pick the market, the bar size and the period, and keep them fixed for both rules.
- Set commission, slippage and next-bar execution once. How to pick the cost figures is covered in trading costs in backtests.
- Write the plain trend rule as an exact entry and exit.
- Write the Hull MA rule the same way, with the same fill timing.
- Run both and read the average trade after costs and the trade count side by side. A rule with twice the trades needs twice the gross edge per trade to end in the same place.
- Rerun each with neighbouring lengths. Keep a rule only if its neighbours agree with it.
The run below shows what a plain trend rule looks like on real data when the comparison is set up this way. It tests a stand-in rule, not the Hull MA itself: an Aroon rule, which goes long when the bars since the recent high are fewer than the bars since the recent low and short in the reverse case, used as the only entry and exit with no stop, target or filter. The market is ES (E-mini S&P 500 futures), the bar size is daily, and the period runs from 2019-01-02 to 2025-06-30, long and short, one contract, with $20 commission and $25 slippage charged per trade.
Source: AlphaPrime product engine (CPU), run 2026-10-31. ES daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $25 slippage per trade.
| Number | Result |
|---|---|
| Net profit (closed trades) | $142,107.5 |
| Max drawdown | $58,717.5 |
| Trades | 34 |
| Win rate | 64.71% |
| Profit factor | 2.987 |
| Average trade | $4,179.63 |
| Time in market | 91.22% |
Read the trade count first. Thirty-four trades over six and a half years is what a slow daily trend rule produces, and it is a small sample: the average trade of $4,179.63 rests on a handful of large winners, and a different six years could rearrange them. This candidate is the one the search kept out of about a thousand it tried, chosen for its return against its drawdown. Picking the best one after the fact flatters it, because among a thousand candidates on one history some will look strong by chance alone; Bailey, Borwein, López de Prado and Zhu (2014) show how quickly that inflation grows with the number of trials. The numbers describe what this one rule did on this one stretch of past prices, not what the Aroon rule or any trend rule earns, and not what a reader should expect. In AlphaPrime (Valynox), the same $20 commission, $25 slippage and next-bar fill are applied inside every candidate's backtesting, so when you put a Hull MA rule next to this one the only thing that differs is the rule.

The time in market of 91.22% tells you something else about plain trend rules: this one was almost always in a position, long or short, so its result is largely the sum of the market's big moves over the period, minus the whipsaws between them. A Hull MA rule on the same bars would flip more often, hold less of each move's tail, and pay costs on more trades. Whether that trade-off ends ahead or behind the plain rule is the question to put to your own data.
Your next step: on the market and bar size you trade, write an SMA cross rule and a Hull MA slope rule as exact entries and exits with next-bar fills, run both over the same years with the same costs, and compare the average trade after costs and the trade count. Then rerun the Hull MA rule at every length from four below to four above your choice. If the band agrees, you have something worth a walk-forward test; if only one length works, you have found noise.
Frequently asked questions
Is the Hull MA better than the SMA?
The Hull MA reacts to a turn in price several bars sooner than an SMA of the same length, so it enters and exits trends earlier. In a sideways market it also flips direction far more often, and each flip is a trade that pays commission and slippage. Neither line is better in general; the one that ends ahead after costs on your market, bar size and period is the better one for you, and only a backtest with the same costs for both can show which that is.
What are the best Hull MA settings?
There is no single best length. Common Hull MA settings are 9, 16, 25 and 49, chosen because their square roots are whole numbers. Match the length to the number of bars in the moves you want to follow on your own bar size, then test the neighbouring lengths as a band. Keep a length only if the lengths around it behave in a similar way.
Does the Hull moving average repaint?
The Hull MA is computed from past closes, so a completed bar's value does not change later. The value on the bar that is still forming moves with every tick until that bar closes, which is true of every moving average. To avoid acting on a value that may still change, read the signal at the bar close and fill it at the open of the next bar, and set your backtest the same way.
What is the difference between the Hull MA and DEMA?
Both remove lag by doubling a faster average and subtracting a slower one. DEMA uses exponential moving averages and stops there. The Hull MA uses weighted moving averages, which react faster, and then smooths the difference with a short weighted average of square-root length. The result is a line that sits closer to price than DEMA, which makes it faster in trends and noisier in ranges.
References
- Brock, W., Lakonishok, J., & LeBaron, B. (1992). Simple Technical Trading Rules and the Stochastic Properties of Stock Returns. The Journal of Finance, 47(5), 1731–1764.
- Park, C.-H., & Irwin, S. H. (2007). What Do We Know About the Profitability of Technical Analysis? Journal of Economic Surveys, 21(4), 786–826.
- Bailey, D. H., Borwein, J., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458–471.

