The short answer
The Hull Moving Average (HMA) is a moving average that turns faster than normal averages but stays smooth. Gold traders often use HMA 9 for fast charts, HMA 21 as a middle setting and HMA 55 for swing trading. The simplest way to use it: favour buys while the HMA slopes up, sells while it slopes down, and filter with a bigger trend.
On 4-hour COMEX gold futures (June 2024 to November 2026), an HMA slope rule turned sooner than the same rule on an EMA. That helped in choppy, two-way periods and hurt in smooth trends, where HMA flipped too often. It is one in-sample run without swaps or slippage, so treat it as an idea to test on your own data, not proof.
What HMA does, in plain words
Every moving average lags: it averages old prices, so it turns after price has turned. A longer average is smoother but later. A shorter one is quicker but jumpier.
Alan Hull designed the HMA in 2005 to get both. The recipe:
- Take a fast weighted average (half the period).
- Take a slow weighted average (the full period).
- Calculate 2 × fast − slow. This “pushes” the line ahead to cancel lag.
- Smooth that result with a short weighted average (the square root of the period).
The formula: HMA(n) = WMA(2 × WMA(n/2) − WMA(n), √n).
You do not need to calculate it yourself. MT5 does not include HMA by default, but free versions are available in the MetaTrader Market and code base, and TradingView has it built in as “Hull Moving Average”. For how to install custom indicators safely, see installing indicators and templates in MT5.
Common HMA settings for gold
| Setting | Typical chart | Behaviour |
|---|---|---|
| HMA 9 | M5 to M15 | Very fast; many turns; noisy |
| HMA 16 to 21 | M15 to H4 | Middle ground; common default |
| HMA 55 | H4 to D1 | Slower; fewer, bigger swings |
As with any indicator, the period matters less than how you use it and which timeframe you trade. Our indicator settings hub compares other indicators tested on gold.
Three ways traders use HMA
1. Slope (direction filter)
- HMA rising: look only for buys.
- HMA falling: look only for sells.
- Act on closed candles only.
This is the rule we ran below.
2. Two HMAs crossing
A fast HMA (for example 9) crossing a slow HMA (for example 21 or 55). It gives fewer signals than a slope flip but still more than EMA crossovers.
3. HMA as a trailing guide
In a trend, some traders keep a trade while candles close on the right side of the HMA and exit on the first close beyond it. It reacts faster than an EMA trail, so it gives back less profit, but it also exits earlier on normal pullbacks. See trailing stops on gold.
How HMA behaved next to the EMA on 4-hour gold
Setup:
- Data: COMEX gold futures (GC=F) 1-hour bars, grouped into 4-hour bars in UTC, 11 June 2024 to 11 November 2026.
- Rule: always in the market. When the line’s slope turns up at a closed bar, go long; when it turns down, go short.
- Cost: $0.30 per ounce for each trade.
- Not included: swap (overnight fees), slippage, spread widening.
- Same rule for EMA of the same length, to compare.
| Average | Direction changes (about 29 months) | Share of flips that caught a follow-through move |
|---|---|---|
| HMA 9 | 734 | about 41% |
| EMA 9 | 681 | about 29% |
| HMA 21 | 385 | about 41% |
| EMA 21 | 443 | about 26% |
| HMA 55 | 170 | about 39% |
| EMA 55 | 263 | about 22% |
XAUUSD Global run on COMEX gold futures 4-hour bars. In-sample; no swaps or slippage. Not a recommendation and not a profit claim.
We are not printing dollar results here. An always-in rule with no stop is not a trading plan, and a single in-sample table is too easy to over-trust. The behaviour is the useful part.
How did it behave in different periods?
We looked at HMA 21 and EMA 21 in four parts: June to December 2024, the year 2025, January to June 2026 and July to 11 November 2026.
- In the smooth, strong 2025 uptrend, HMA 21 turned too often. Each small dip flipped its slope, so it kept stepping out of a trend that a slower EMA simply rode.
- In the choppy, two-way 2026 market, HMA’s faster turns were an advantage. It got out of falling moves sooner and turned back sooner, while the EMA was still pointing the old way.
What the run tells you, honestly
- HMA turns sooner, so it suits swinging markets more than smooth trends. That is the trade you make for less lag.
- Most flips do not lead to a big move (fewer than half for every line). The useful flips were the few that caught a long trend, so long losing runs are part of this kind of rule.
- This is one market, one period, chosen settings, and no swaps. An always-in rule holds a position every night, so real swap costs and slippage on news would change the picture.
- Results depend on settings, timeframe and costs, and they can change in a different market regime. Test it on your own data before risking money.
To learn how to run a fair test yourself, read how to backtest a gold strategy and is my trading strategy really working?.
Lag vs noise: the trade-off on gold
| EMA | HMA | |
|---|---|---|
| Turns after a top or bottom | Later | Sooner |
| False turns in a range | Fewer | More |
| Gives back profit at the end of a trend | More | Less |
| Best when | Long, smooth trends | Swings and frequent reversals |
Gold in 2026 swung hard: the daily ATR 14 on our futures data went from $237 in February to $75 in late October. A faster line suits a market like that, but in a quiet, sideways week the HMA will flip back and forth.
A simple HMA plan to test
This is a starting point to test on demo, not a trading system to use with real money:
- Chart: 4-hour XAUUSD.
- Trend filter: only buys when price is above the 200-period EMA on H4; only sells below it.
- Trigger: HMA 21 slope turns in the trend direction on a closed candle.
- Stop: beyond the last swing low (for buys), at least 1.5 × the H4 ATR away. See ATR settings for gold.
- Exit: close on the first H4 candle that closes on the wrong side of the HMA, or at the next major level.
- Size: 1% risk or less, using the position size calculator.
- Test at least 50 trades on demo, with swaps included, before any real money.
Common HMA mistakes
- Using HMA alone on a 1-minute chart. It flips constantly; costs pile up.
- Acting on the forming candle. The slope can change before the close.
- Expecting it to predict. HMA is still built from past prices. It is faster, not psychic.
- Ignoring news. One release can move gold more than a whole day’s HMA swing.
Key takeaways
- HMA reduces lag by combining fast and slow weighted averages and smoothing the result.
- Common gold settings: 9 (fast), 21 (middle), 55 (swing).
- Use the slope as a direction filter, with a bigger trend filter and real stops.
- In our in-sample 4-hour run, HMA turned sooner than matching EMAs; swaps and slippage were not included, so test it yourself before trusting it.
- HMA flipped too often in the smooth 2025 trend and turned usefully in choppy 2026: it suits swinging markets more than smooth ones.
To see how other moving averages behave on gold, read our moving averages guide and best EMA for XAUUSD.
Sources
- Alan Hull, the Hull Moving Average (2005), as published on the author’s website.
- Test data: XAUUSD Global dataset, COMEX gold futures (GC=F) 1-hour bars via Yahoo Finance, 11 June 2024 to 11 November 2026, grouped into 4-hour bars in UTC. Calculations by XAUUSD Global.
Educational content only, not financial advice. Trading gold with leverage carries a high risk of loss.
Frequently asked questions
What is the Hull Moving Average?
It is a moving average created by Alan Hull that reduces lag. It combines a fast and a slow weighted moving average and then smooths the result over a short period, so it turns quickly when price turns but stays fairly smooth.
What is the best HMA setting for gold?
There is no single best one. HMA 9 suits fast intraday charts, HMA 21 is a common middle setting, and HMA 55 suits swing traders who want fewer signals. In our 4-hour test, HMA 21 gave 385 direction changes in about two and a half years, against 734 for HMA 9 and 170 for HMA 55.
Is HMA better than EMA for gold?
In our in-sample test on 4-hour COMEX gold futures from June 2024 to November 2026, simple HMA slope-flip rules did better than the same rules on EMAs of the same length for periods 9 and 21, and slightly worse for 55. That is one test on one market, without swap or slippage, so treat it as a reason to test further, not as proof.
How do you trade the Hull Moving Average?
The simplest rule uses its slope: favour buys while the HMA rises and sells while it falls. Many traders add a filter, such as a 200-period moving average or the daily trend, and only take HMA turns in that direction. Stops still go beyond a real level, and size comes from the stop.
Does the Hull Moving Average repaint?
No, the standard HMA uses only closed prices, so a value on a closed candle does not change. The value on the candle still forming changes until it closes, like any moving average. Act only on closed candles.
How is HMA calculated?
HMA(n) = WMA of (2 × WMA(n/2) − WMA(n)) over the square root of n periods, where WMA is a weighted moving average. For HMA 16, that is a 4-period WMA of (2 × WMA 8 − WMA 16).
Comments
No comments yet.
More in Strategies & technical analysis
- SMC vs ICT: What Is the Difference, and Which Should Gold Traders Learn First?
- How to Backtest a Gold Trading Strategy in Excel: Formulas, Columns and a Worked Example
- The ICT Mentorship Model on Gold: Sweep, Displacement and Fair Value Gap Entry, Step by Step
- Best MACD Settings for Gold (XAUUSD): 12/26/9 vs Faster and Slower, by Timeframe
- Gold Scalping Mistakes: Why Scalping XAUUSD Fails for Most Traders and How to Fix It
Latest on the blog
- The Philly Fed Survey for Gold Traders: Diffusion Index, Prices Paid and the Thursday Reaction
- NR7 Breakout on Gold: How the Narrowest Day of the Last Seven Behaves
- What Is the Fed Beige Book? A Gold Trader's Guide to District Reports, Price Clues and Market Reaction
- Trading Psychology Quotes That Actually Help: 12 Lines From Famous Traders and What They Mean for Gold