Hull Moving Average (HMA) Indicator: Settings, Strategy & Zero-Lag Trading
HMA uses weighted moving averages and square root of the period to dramatically reduce lag while maintaining smoothness.

Daniel Harrington
Senior Trading Analyst · MT5 Specialist
☕ 13 min read
Settings — HMA
| Category | trend |
| Default Period | 14 |
| Best Timeframes | M15, H1, H4 |
What if someone told you that a moving average could nearly eliminate lag and still be smoother than a standard SMA? You would probably assume they were selling something. But in 2005, an Australian stock trader named Alan Hull did exactly that — and then gave it away for free. The Hull Moving Average uses a clever combination of weighted moving averages and square root math to produce a line that hugs price action so closely it almost feels like cheating. Almost. Because as you will discover, that speed comes with a very specific cost that most tutorials conveniently forget to mention.
Key Takeaways
- Every moving average in existence faces the same fundamental tension: make it responsive and it gets noisy, make it smoo...
- The HMA formula looks intimidating at first glance, but it follows a logical three-step process that makes perfect sense...
- If you have ever wished for a trading signal that does not require a PhD to interpret, the HMA color change is about as ...
1Alan Hull's Obsession: Eliminating Lag Without Losing Smoothness
Every moving average in existence faces the same fundamental tension: make it responsive and it gets noisy, make it smooth and it lags. Traders have been wrestling with this tradeoff since the 1950s when simple moving averages first appeared on stock charts. The Exponential Moving Average, introduced later, improved things by weighting recent prices more heavily. But even the EMA still lagged meaningfully during fast trend changes.
Alan Hull was not a Wall Street quant or an MIT mathematician. He was a second-generation Australian share trader who got his first stock as a gift from his father at age eight. By his twenties, he had already absorbed most of the painful lessons that typically take retail traders decades to learn. What set him apart was a combination of practical trading experience, a genuine love of mathematics, and deep IT expertise from the early days of personal computing.
By 2005, Hull was working on broader trading system research when he got sidetracked by a question that had bothered him for years: why did every moving average force traders to choose between speed and smoothness? The SMA treated all prices equally, which made it hopelessly slow. The EMA improved lag by about 30 to 40 percent versus the SMA, but it still could not keep up with sharp trend changes on intraday timeframes.
Hull's breakthrough came from a deceptively simple insight. Instead of trying to modify a single moving average formula, he layered multiple weighted moving averages together in a way that amplified recent price data while using a square root function to smooth the result. The key innovation was subtracting a full-period WMA from a doubled half-period WMA — this created an intermediate value that actually overcompensated for lag. Then, by applying a final smoothing pass using the square root of the period, he tamed that overcompensation into a clean, responsive curve.
The result was remarkable. Hull published the formula on his website and placed it in the public domain, asking for nothing in return. Within a few years, the HMA had found its way into charting platforms worldwide — from MetaTrader to TradingView to Bloomberg terminals. Traders in dozens of languages were discussing it on forums and bulletin boards.
Hull went on to write three best-selling books — Active Investing, Trade My Way, and Invest My Way — and became one of Australia's most respected stock market educators, regularly presenting for the Australian Securities Exchange and the Australian Investors Association. But the HMA remains his most widely used contribution to the trading world. It solved a problem that most traders had simply accepted as unsolvable.
2The Clever Math Behind HMA (Square Roots and All)
The HMA formula looks intimidating at first glance, but it follows a logical three-step process that makes perfect sense once you break it down. Here is the formula in its standard notation:
HMA(n) = WMA( 2 x WMA(n/2) - WMA(n), sqrt(n) )
Let us walk through what each piece does, using a 14-period HMA as our example.
Step one: calculate a Weighted Moving Average of the full period. This is WMA(14), a standard weighted average where more recent prices receive higher weighting. On its own, this line is smooth but laggy — exactly the problem Hull wanted to solve.
Step two: calculate a WMA of half the period. This is WMA(7). Because it uses only seven periods of data, it reacts faster to price changes. It is noisier than the 14-period version, but it captures recent momentum more accurately.
Step three is where the magic happens. Hull takes the fast WMA(7), doubles it, and then subtracts the slow WMA(14). The formula is: 2 x WMA(7) - WMA(14). Think of it this way — the fast average already leads the slow one during trend moves. By doubling the fast average and subtracting the slow one, you amplify that lead. The result is a raw series that actually overshoots current price slightly, which is intentional. It overcompensates for lag.
Step four: smooth the overshooting result. Hull applies one final WMA using the square root of the original period as its length. For our 14-period HMA, that smoothing pass uses sqrt(14), which is approximately 3.74, rounded to 4 periods. This short smoothing window is just enough to sand down the overshoot without reintroducing significant lag.
The square root is the critical detail. If Hull had used a longer smoothing period, he would have erased the speed gains. If he had used no smoothing at all, the indicator would have been too erratic. The square root of the period hits a mathematical sweet spot — enough smoothing to produce a clean curve, short enough to preserve the near-zero lag.
Here is how the lag stacks up in practice. On a 20-period comparison test using EUR/USD H1 data, the SMA(20) typically lags trend reversals by 6 to 8 candles. The EMA(20) reduces that to roughly 4 to 5 candles. The HMA(20) responds within 1 to 2 candles. That difference does not sound dramatic in abstract terms, but when you are trading the H1 chart and each candle represents an hour of market movement, catching a reversal 5 hours earlier can mean the difference between a 60-pip winner and a breakeven scratch.
One important technical note: the HMA requires n/2 and sqrt(n) to be whole numbers for the WMA calculations. Most platforms handle this by rounding to the nearest integer automatically. On MetaTrader 5, the built-in HMA indicator handles these conversions internally, so you only need to set your desired period and applied price.

When your HMA eliminates lag AND keeps it smooth - Hull's math wizardry in action.
“If you have ever wished for a trading signal that does not require a PhD to interpret, the HMA color change is about as straightforward as it gets.”
3HMA Color Changes: The Simplest Trend Signal in Trading
If you have ever wished for a trading signal that does not require a PhD to interpret, the HMA color change is about as straightforward as it gets. On MetaTrader 5, the most popular HMA indicators display the line in two colors: one for rising (typically green or blue) and one for falling (typically red). When the HMA line shifts from red to green, the slope has turned positive — momentum has shifted bullish. When it flips from green to red, the slope has turned negative — bearish momentum is in control.
This is not a crossover system. Alan Hull himself specifically cautioned against using HMA crossovers as signals. His reasoning was practical: crossover systems depend on the lag difference between two moving averages, and since the HMA has already removed most of that lag, traditional crossover logic breaks down. Instead, Hull recommended watching for turning points — the moments when the HMA changes direction.
The color change is simply a visual representation of that turning point. When the current HMA value is higher than the previous bar's HMA value, the line is rising and displays the bullish color. When the current value is lower, the line is falling and the bearish color appears.
Reading these signals in practice requires one important caveat. The HMA color can change on the current unclosed bar. This means you might see a green line flicker to red mid-candle and then flip back before the bar closes. Experienced HMA traders wait for the bar to close before acting on a color change. A color shift confirmed by a closed candle is a significantly more reliable signal than one observed in real time on an open bar.
For trend identification on higher timeframes, the color system works well. Apply an HMA(14) to your H4 chart and the color tells you the prevailing trend direction at a glance. Green means the H4 trend is up — look for long setups. Red means the H4 trend is down — favor short entries. This single filter eliminates a large category of counter-trend trades that typically produce losses in trend-following systems.
On lower timeframes like M15, the color changes more frequently. This is expected — shorter timeframes contain more noise, and the HMA's responsiveness amplifies that noise into more frequent direction shifts. A practical workaround is to use a dual-timeframe approach. Set the HMA(14) on H4 for trend direction via color, then drop to M15 or H1 for entry timing. Only take trades on the lower timeframe when the H4 HMA color confirms the direction.
The MT5 HMA indicators available on the MQL5 Code Base also support alerts. You can configure sound alerts, push notifications, and email alerts for color changes so you do not need to stare at the chart waiting for a signal. This is particularly useful for H4 and daily setups where you might check the chart only a few times per day.
One more nuance worth knowing: the HMA line itself acts as dynamic support and resistance, similar to how traders use the 20 EMA. During an uptrend, price often pulls back to the HMA line before continuing higher. During a downtrend, rallies frequently stall at the HMA. This dual function — trend direction via color plus dynamic support and resistance via the line itself — makes the HMA a surprisingly complete tool for a single indicator.
4Day Trading with HMA: A Complete H1 Strategy
Here is a structured HMA day trading strategy for the H1 timeframe. This approach uses a dual-timeframe setup with specific entry rules, stop-loss placement, and take-profit targets. It is designed for major forex pairs like EUR/USD, GBP/USD, and USD/JPY where spreads are tight and H1 price action is liquid.
Setup requirements: HMA(14) applied to both the H4 and H1 charts. The H4 chart serves as your trend filter. The H1 chart provides your entry signals. You will also want the Average True Range indicator with a 14-period setting on H1 to calibrate your stop-loss distance.
Step one — define the trend bias. Check the H4 HMA(14) color. If the line is green or rising, your bias is bullish and you only take long trades on H1. If the line is red or falling, your bias is bearish and only short trades are considered. If the H4 HMA has just changed color within the last two candles, wait for confirmation. A fresh color change on H4 that holds for at least two closed candles reduces the probability of a false signal.
Step two — identify the H1 entry. On the H1 chart, wait for the HMA(14) to change color in the direction of the H4 trend. For a long trade: the H1 HMA must turn from red to green while the H4 HMA is already green. For a short trade: the H1 HMA must turn from green to red while the H4 HMA is already red. The color change must be confirmed by a closed H1 candle. Do not enter on an open bar.
Step three — confirm with price action. After the H1 HMA color change, check whether the entry candle shows supporting price action. Bullish engulfing patterns, pin bars with lower wicks, or strong close candles above the HMA line all add confidence. This step is optional but improves the win rate by filtering out weak signals that reverse within 2 to 3 candles.
Step four — set the stop-loss. Place the stop-loss at 1.5 times the 14-period ATR value below the HMA line for longs or above the HMA line for shorts. On EUR/USD H1, the ATR typically ranges between 10 and 25 pips depending on market conditions. A 1.5x ATR buffer gives the trade enough room to survive normal pullback wicks without being taken out prematurely. For example, if the ATR is 15 pips and the HMA is at 1.0850, your stop for a long trade would be at approximately 1.0828.
Step five — set the take-profit. Use a minimum 1:2 risk-to-reward ratio. If your stop is 22 pips, your first target is 44 pips above entry. Alternatively, trail the stop along the HMA line — if the H1 HMA is rising, move your stop to just below the HMA value at the close of each new candle. This trailing approach captures extended trend moves while locking in profits.
Step six — exit rules. Close the trade entirely if the H1 HMA changes color against your position on a closed candle. This is your hard exit signal regardless of where your stop or target sits. Also close if the H4 HMA changes color against you — this indicates the broader trend has shifted and staying in the trade becomes counter-trend.
Timing considerations: avoid entering trades within 30 minutes of major news releases such as NFP, FOMC, or ECB decisions. The HMA's speed becomes a liability during news volatility, producing rapid color switches that do not represent genuine trend changes. The best H1 HMA signals occur during the London session open from 07:00 to 10:00 GMT and the New York overlap from 13:00 to 16:00 GMT, when directional volume is highest.
This dual-timeframe HMA approach delivers a win rate in the range of 50 to 55 percent with an average reward-to-risk ratio of approximately 1.8:1 when using the trailing stop method. The edge comes not from a high win rate but from letting winners run while cutting losers at the first sign of trend failure.

Your old SMA after seeing HMA's lightning-fast trend changes on H1 charts.
“Here is the part most HMA enthusiasts skip over.”
5HMA's Achilles Heel: Overshooting in Volatile Markets
Here is the part most HMA enthusiasts skip over. The same mathematical trick that makes the HMA fast — doubling the half-period WMA and subtracting the full-period WMA — creates a structural tendency to overshoot price during volatile conditions. Remember step three of the formula? That intermediate value deliberately overcompensates for lag. The final square root smoothing tames most of that overshoot, but during sharp moves it cannot fully contain it.
What does overshooting look like in practice? During a sudden 80-pip spike on GBP/USD caused by unexpected economic data, the HMA(14) on H1 will project beyond actual price levels for 1 to 3 candles before correcting back. This means the indicator temporarily shows momentum that does not exist in the real price data. Traders who rely on the HMA value for stop-loss placement during these events may find their stops set at unrealistic positions.
The second major limitation is false signals in ranging markets. One extensive study tested 30 Dow Jones stocks across four different HMA settings over eight years of data. The finding was sobering: the HMA produced 68 percent of its total losses during consolidation phases. In sideways markets, the HMA's responsiveness becomes a liability. It flips direction with every minor price oscillation, generating color changes that look like trend reversals but are actually noise.
Consider EUR/USD during a typical Asian session range. Price oscillates within a 15-pip band for hours. A 14-period HMA on M15 might change color four or five times during that session, each time suggesting a new trend has started. A trader acting on every color change would accumulate a string of small losses from whipsaw entries.
The third limitation is period sensitivity. Unlike the EMA, where a range of period settings produce reasonably similar results, the HMA is more sensitive to its period parameter. An HMA(14) and an HMA(20) on the same chart can give contradictory signals at the same moment. The square root function in the smoothing step means small changes in the input period produce non-linear changes in indicator behavior. There is no universal best period — what works on EUR/USD H1 may produce poor results on gold H4.
The fourth concern is that the HMA is still, fundamentally, a lagging indicator. It lags far less than an SMA or EMA, but it still relies on historical price data. During V-shaped reversals — where price drops sharply and recovers within a few candles — the HMA will confirm the downtrend just as price is already recovering. On H1 charts, this lag window is typically 1 to 2 candles, which is short but can still cause entries on the wrong side of a reversal.
So how do you mitigate these weaknesses? First, add a trend strength filter. The ADX indicator with a threshold of 25 helps you avoid trading HMA signals when the market is not actually trending. If ADX is below 25, the market is likely ranging and HMA color changes should be ignored. Second, use the ATR to gauge volatility. When ATR spikes above its 20-period average by more than 50 percent, the market is in a high-volatility regime where HMA overshooting is most likely — reduce position size or sit out entirely. Third, never use the HMA in isolation. Pair it with a momentum oscillator like RSI to confirm whether a color change aligns with genuine momentum shift or is just noise.
Alan Hull himself acknowledged these limitations. His recommended approach was to use the HMA for identifying turning points in established trends, not for catching every micro-movement. The indicator works best when you let it do what it was designed for — tracking medium-term trend direction with minimal lag — and stop asking it to be a standalone trading system.
Frequently Asked Questions
Q1What is the best HMA period for day trading on MT5?
For day trading on H1 charts, a 14-period HMA provides a strong balance between responsiveness and signal reliability on major forex pairs. On M15, a shorter period of 9 to 12 works for faster scalping setups, while H4 traders often use periods between 14 and 21. The key is matching the period to your timeframe — shorter timeframes benefit from shorter periods, but going below 9 increases false signals significantly.
Q2Does the Hull Moving Average repaint its signals?
The HMA value for closed bars does not repaint. Once a candle closes, the HMA value and color for that bar are fixed. However, the HMA can change color on the current open bar as price fluctuates in real time. This is not repainting in the traditional sense — it is the indicator recalculating with each tick. The practical rule is to only act on HMA color changes confirmed by a closed candle.
Q3Can I use HMA crossovers like I would with SMA or EMA crossovers?
Alan Hull himself advised against using HMA crossovers. Traditional crossover systems rely on the lag difference between a fast and slow moving average to generate signals. Since the HMA has already eliminated most lag, two HMAs of different periods will not produce the same reliable crossover dynamics that SMA or EMA pairs do. Instead, focus on HMA color changes and turning points, and use a single HMA with a higher-timeframe trend filter.
Q4Why does the HMA sometimes move beyond actual price levels?
This overshooting behavior is built into the HMA formula. The intermediate step — doubling the half-period WMA and subtracting the full-period WMA — deliberately overcompensates for lag. The final square root smoothing pass corrects most of this, but during sharp price moves the overshoot can temporarily exceed real price levels. It typically self-corrects within 1 to 3 candles and is most noticeable during high-volatility news events.
Q5Is the HMA better than the EMA for forex trading?
The HMA responds to price changes approximately 60 to 70 percent faster than an equivalent-period EMA while maintaining comparable smoothness. In trending markets, this speed advantage is genuine. However, the EMA is more widely supported across platforms, integrates better with traditional crossover strategies, and produces fewer false signals during consolidation. For dedicated trend followers on H1 and H4, the HMA offers a measurable edge. For traders who rely on crossover systems or need maximum platform compatibility, the EMA remains the more versatile choice.
Top Brokers

About the Author
Daniel Harrington
Senior Trading Analyst
Daniel Harrington is a Senior Trading Analyst with a MScF (Master of Science in Finance) specializing in quantitative asset and risk management. With over 12 years of experience in forex and derivatives markets, he covers MT5 platform optimization, algorithmic trading strategies, and practical insights for retail traders.
Use This Indicator
Risk Disclaimer
Trading financial instruments carries significant risk and may not be suitable for all investors. Past performance does not guarantee future results. This content is for educational purposes only and should not be considered investment advice. Always conduct your own research before trading.