Moving averages — the complete guide (SMA, EMA, WMA, HMA)

Risk warning · YMYL This article is for educational purposes only and is not investment advice. Trading on the Forex market involves a high risk of capital loss — ESMA reports 74–89% of retail accounts lose money.

When I opened my first EUR/USD chart in MetaTrader back in 2007, the instructions from a friend on the bank desk were short and unsentimental: "Drop on a single moving average — 200, simple, daily — and never trade against it." I stuck to that one rule for nine months before I realised that behind that single line sits an entire family of tools — simple, exponential, weighted and Hull — each with a different temperament and a different job. This guide walks through the four moving-average families with their formulas, and then shows how to combine them into a trading system that does not blow up at the first sideways stretch.

Why a moving average makes sense in the first place

A raw price chart carries two kinds of information simultaneously: the dominant direction — the trend — and the day-to-day noise of price oscillating up and down because of small orders, position trims and microstructural jerks. The human eye reacts to that noise more strongly than to the trend, because the last few candles jump straight at you while the overall direction only becomes visible after scrolling back several weeks. A moving average solves that problem mechanically — it averages the last N closes and draws the result as a single line that smooths the noise and exposes the trend by construction.

The first advantage is psychological: inside an uptrend the moving-average line works as an emotional brake, because every pullback toward the average becomes a visual cue that price is returning to equilibrium rather than reversing. The second is practical: the average gives a concrete level around which most institutional algorithms place orders, so the area around the line becomes a magnet for support and resistance flow. The third is mathematical: comparing two averages of different lengths produces a synthetic momentum indicator (MACD is literally the difference between two EMAs), and comparing price to an average yields the directional filter used in virtually every trend-following strategy.

The EMA reacts faster because recent candles weigh more

The simple moving average, abbreviated SMA, is calculated the same way an elementary-school average is calculated: sum the last N closes and divide by N. For a period of twenty every candle contributes exactly five percent to the result — the one printed a minute ago and the one printed nineteen days ago count identically. The SMA only moves when a new candle pushes the oldest one out of the calculation window, so its reaction is slow and even.

The exponential moving average, the EMA, rests on a different philosophy: recent data matters more than old data. The formula is recursive — today's EMA equals today's close multiplied by a smoothing factor plus yesterday's EMA multiplied by one minus that same factor. The smoothing factor is two divided by the period plus one. For an EMA20 this works out to roughly 0.0952, meaning today's close contributes just under 9.5 percent, yesterday's 8.6 percent, the close from ten days ago 3.2 percent, and the one from twenty days ago a mere 0.9 percent. The weights decay exponentially and never formally reach zero.

SMA20 and EMA20 reacting to a fresh 60-pip price jump
Latest candleEUR/USD closes 60 pips above the average of the previous nineteen
SMA20 reactionthe line rises by 60 / 20 = 3 pips
EMA20 reactionthe line rises by 60 × 0.0952 ≈ 5.7 pips
Time to catch up to priceSMA20: 15–20 candles, EMA20: 5–10 candles
TakeawayAn EMA reacts to every new candle nearly twice as strongly as an SMA of the same length

The consequence is unambiguous: the EMA always signals a directional change earlier than the SMA of the same length. The price of that speed, however, is real and measured in false signals — the EMA generates roughly thirty to fifty percent more false crossovers with price than the SMA. That is why experienced traders use the EMA only in combination with a trend filter — a longer average, price action, or a structural level.

The WMA — linear weights, halfway between simple and exponential

The weighted moving average, the WMA, is the least famous of the three classical families, even though it is mathematically the easiest to grasp. For a period of twenty, the newest candle gets weight 20, the next one 19, the next 18, and so on linearly down to the oldest, which gets weight 1. The weights sum to 210 (that is twenty times twenty-one divided by two), so the weighted sum of closes is divided by 210 to produce the WMA value for that candle.

The WMA's character is "in between" — it reacts faster than the SMA but slower than the EMA, and the decay of weights for older candles is gentler than in the exponential version, where the first three or four candles dominate the result. In practice the WMA shows up mostly as a building block inside other constructions — the Hull Moving Average itself uses three WMAs of different lengths to deliver its profile, and the Ehlers ITrend indicator relies on linear weighting. As a stand-alone average the WMA has a small group of supporters in prop trading — mostly traders who find the EMA too nervous and the SMA too sluggish.

The rule of thumb is straightforward: if you are using an EMA and seeing too many false signals, switching to a WMA of the same length will lightly smooth the line without giving up all the responsiveness. If you are using an SMA and feeling chronically late by a few candles, the WMA will deliver a faster reaction without radically changing the personality of the line.

The HMA — Hull solved the lag problem with mathematics

The Hull Moving Average, the HMA, is the youngest of the four families — designed in 2005 by Australian trader Alan Hull and published on his website at alanhull.com. The construction looks surprisingly simple at first glance, yet it effectively eliminates the lag typical of the SMA and the EMA without dramatically increasing noise.

Hull's formula has three steps. First compute a WMA over the period N divided by two — for an HMA16 that is a WMA8. Multiply it by two, which mathematically amplifies the response to recent candles. Subtract a WMA over the full period — in our example a WMA16. You now have a line that reacts almost instantly, but is very jagged. The third step is the smoothing: take a WMA of the resulting line with a length equal to the square root of N — for the HMA16 that is a WMA4 (the square root of 16 is 4). The output is smooth, fast and remarkably tight to price inside a trend.

Practical use of the HMA: the most common periods are HMA20 or HMA21 on the H1, H4 and D1 timeframes, used as a direction signal for swing trading. Many day traders use the HMA as a visual confirmation of the intraday trend — when the HMA line "changes colour" (most platforms render it green during an up move and red during a down move), the colour change itself functions as an entry signal in the direction of the new move. The trap is real, however: on timeframes below H1 the HMA reacts to every micro-piece of noise, so it produces false reversals with the same frequency that session noise itself appears.

Standard periods — 20, 50 and 200 carry specific meaning

The numbers 20, 50 and 200 show up in nearly every technical-analysis textbook, even though there is no mathematical magic in them. They were chosen historically for a prosaic reason: on the daily chart twenty candles equal roughly one working month, fifty equal one trading quarter, and two hundred approximate one trading year (252 sessions in the US, minus holidays and weekends). Each of those horizons matches a different group of market participants — the short-term speculator, the medium-term swing trader and the long-term investor.

Standard moving-average periods and their natural use cases
SMA200 on D1Long-term trend filter — watched by every type of market participant
SMA100 on D1Medium-term trend, roughly one trading quarter
EMA50 on D1 or H4Dynamic support and resistance inside a swing trend
EMA21 on H4Shorter swing — the "21 EMA strategy" popularised on educational channels
EMA20 on H1Day trading, trend filter within a single session
HMA20 on H4Fast directional signal for swing trading, less lag than the EMA

The rule of thumb is unambiguous: the shorter the period and the shorter the timeframe, the more the EMA or HMA make sense. The longer the period and the higher the timeframe, the better the SMA performs. Combining the approaches — SMA200 for the macro picture and EMA20 for the entry decision — produces a system that is internally consistent and complete. Over time the repeated use of the 200 period has turned it into an anchor the market actually reacts to. Around the SMA200 on the daily EUR/USD chart, large clusters of orders accumulate, and price genuinely bounces off the line more often than chance would predict.

Golden cross and death cross — regime signals, not entries

The most quoted signal built on moving averages is the golden cross — the upward crossover of a fifty-period moving average (usually an EMA50 or an SMA50) through the SMA200. Its mirror image, the death cross, is the downward crossover of the same shorter average through the SMA200. The first heralds a long-term uptrend, the second a bear market. The headline is straightforward, but the interpretation calls for nuance and discipline.

Anatomy of a classical golden cross on EUR/USD
Starting pointPrice has been trading below the SMA200 in a downtrend for several months
The real changePrice breaks the last lower high and starts trading above the SMA200
Technical signalA few weeks later, the EMA50 finally crosses above the SMA200
Macro implicationA long-term regime change — the bull market is confirmed
Practical actionHunt for long entries on pullbacks to the EMA50, not on the cross itself
The trapThe signal is late — by the time it prints, price has already moved 50–100 pips

The key to understanding these signals is to accept their lag. They are not entry points for a day trader — they are confirmations of a regime change, used by hedge funds and institutional allocators to decide on quarterly, not hourly, positioning. Backtests on the S&P 500 since the 1970s show the golden cross delivering an average annual return of roughly eight to ten percent — comparable to buy-and-hold, but with materially smaller maximum drawdown. The death cross statistically precedes a fifteen to twenty-five percent decline in the asset over the following twelve months.

"Moving averages are the most popular and versatile of all the indicators used by technical analysts. But they should be viewed as a trend-following device, not a trend-forecasting one." — John J. Murphy, Technical Analysis of the Financial Markets, New York Institute of Finance, 1999.

The multi-MA system — three averages, three roles

The most durable setup I have seen across two decades of working with both retail and institutional traders rests on three moving averages at once, each on a different horizon. The philosophy is simple: let the longest average decide whether we trade at all, the medium one identify the zone of interest, and the shortest deliver the actual entry signal. Each average has one and only one role — which eliminates the contradictory signals that appear when traders stack three indicators of the same type.

  1. SMA200 on the daily — the mandatory trend filter. If price is above the line, we only consider longs. If price is below it, we only consider shorts. Trading against this rule is the fastest way to bleed capital on a retail account, regardless of how good the other signals look.
  2. EMA50 on the daily — the zone of interest. Pullbacks toward the EMA50 in an uptrend are where we wait for a buy signal. In a downtrend the same EMA50 acts as dynamic resistance where we wait for a sell signal.
  3. EMA20 or HMA20 on the four-hour — entry precision. The actual trigger to open a position is a candlestick reaction off the short average inside the EMA50 zone on the daily — a hammer, a pin bar or a bullish engulfing pattern in an uptrend, the mirror images in a downtrend.

The stop loss goes below the most recent local low (for a long) or above the local high (for a short). The first take profit lands at the previous swing high or low, the second at the next significant structural level. A reward-to-risk ratio of 1:2 is realistic, 1:3 is achievable with disciplined setup selection. This system has survived the last two decades, is used by hedge funds and investment banks alike, and the fact that it is not novel is its greatest virtue — it consists of lines that everyone watches, lines around which the market actually reacts.

Five mistakes that quietly drain beginner accounts

Moving averages are so simple to apply that they invite misuse. The five most common mistakes consistently erode the accounts of new traders — and what makes them harder to avoid is that each one is repeated by popular educational material on YouTube and Twitter, so they look like good practice rather than bad habit.

  • Trading every crossover. The "buy when price crosses above the EMA50, sell when it crosses below" strategy without a trend filter delivers a win rate of around forty percent — and bleeds money during every long-running consolidation. The crossover signal has to be filtered by a longer average and confirmed by price action.
  • An SMA200 on the five-minute chart. Two hundred candles on the M5 cover slightly more than sixteen hours of trading — a single day minus weekends. A line with that horizon defines no meaningful trend; at best it represents the average price of the latest session, which makes it a mathematically broken choice for a long-term filter.
  • Treating the EMA20 as a trend filter. The EMA20 is a short-term indicator describing the state of the last few weeks, not the market regime. Confusing the two leads traders to open longs in a long-term bear market simply because price has crossed the short average — and that ends in a loss at the first strong continuation of the downtrend.
  • Optimising periods through backtesting. Trying to find the "perfect" pair of moving averages by testing every combination between 5 and 100 almost always produces overfitting — the result looks brilliant on historical data and falls apart in live markets. The standard 20, 50 and 200 periods are standard for a reason.
  • Trading far from the average. The pullback to the average is a fundamental ingredient of every setup. Opening a position when price is two hundred pips away from the EMA50 means jumping into the middle of the impulse, exactly where the statistical chance of continuation without a correction is lowest, and the next move will most likely be a rest back toward the line.

So what should you actually do after reading this guide? Open the chart of any major currency pair on the daily timeframe, drop on three lines — SMA200, EMA50 and EMA20 — and scroll back two years. Mark every moment in which all three averages stacked in the same order (price above EMA20, EMA20 above EMA50, EMA50 above SMA200 for an uptrend) and check what the market delivered in the following weeks. That exercise takes an hour, and teaches more than ten hours of watching YouTube videos.

Related reading: EMA vs SMA — which one to use breaks down the practical differences between the two most popular families; MACD — how to read the momentum indicator is built directly on the difference between two exponential averages; multi-timeframe analysis shows how to combine averages from different timeframes into a single coherent trading system.

Jarosław Wasiński
About the author

Jarosław Wasiński

Editor-in-chief at MyBank.pl · Financial and market analyst

Independent analyst and practitioner with 20+ years in finance. Founder and editor-in-chief of MyBank.pl, running since 2004. Fundamental analysis of FX and macro markets since 2007.

Sources & bibliography

  1. John J. Murphy / Penguin Random House Technical Analysis of the Financial Markets (1999), rozdział o średnich kroczących · New York Institute of Finance, 1999 — rozdział o średnich kroczących i ich rodzinach www.penguinrandomhouse.com ↗
  2. Alan Hull How to Reduce Lag in a Moving Average · oryginalny opis Hull Moving Average z 2005 roku alanhull.com ↗
  3. StockCharts ChartSchool Moving Averages — Simple and Exponential · wzory matematyczne, parametry i porównania graficzne chartschool.stockcharts.com ↗
  4. Investopedia Moving Average (MA) · definicje rodzin średnich, golden cross i death cross www.investopedia.com ↗

Frequently asked

How does the WMA differ from the EMA — both put more weight on recent candles, after all?

The difference lies in how the weights decay. The WMA uses linear weights: for a period of twenty, the newest candle gets weight 20, the next one 19, then 18, all the way down to the oldest, which gets weight 1. The weights sum to 210, so the weighted sum of closes is divided by 210. The candle from twenty days ago still nudges the result, even if by a little. The EMA, by contrast, decays weights exponentially. For an EMA20 today's close carries about 9.5 percent influence, yesterday's 8.6 percent, the close from ten days ago 3.2 percent, and the one from twenty days ago just 0.9 percent — and the weights never formally reach zero. In practice the WMA sits between the SMA and the EMA: faster than the simple version, smoother than the exponential one. A small camp of traders prefers the WMA precisely for that middle-of-the-road profile, but the SMA and EMA dominate because they have more documentation, more backtests and the classical literature setups are built on them.

Does the Hull Moving Average (HMA) actually eliminate lag?

It does cut lag substantially, but not to zero — no moving average can do that, because a moving average by definition looks backwards. Alan Hull designed his formula in 2005 in a particularly elegant way: he takes a WMA over the period N divided by two, multiplies it by two, subtracts a WMA over the full period N, and then smooths the result with a WMA of length equal to the square root of N. For an HMA16 that means twice the WMA8 minus the WMA16, the whole thing smoothed by a WMA4. The line ends up hugging price during a trend, and reaction lag drops by roughly fifty percent compared to an EMA of the same length. The price of that speed is genuine, however: the HMA reacts more sharply to single noisy candles, so on low timeframes (M5, M15) it produces plenty of false reversals. Practical use: an HMA20 or HMA21 on H4 as a direction signal for swing trading, paired with a longer SMA as a trend filter. The HMA alone, without a filter, is a fast track to a wiped account.

Why are the 20, 50 and 200 periods the standard — is there something magical about those numbers?

There is no mathematical magic in those numbers — they were chosen historically for a prosaic reason. On the daily chart, twenty candles equal roughly one working month, fifty equal one quarter, and two hundred approximate the length of a trading year (252 sessions in the US, minus holidays and weekends). Those cycles match the natural decision horizons of market participants: the short-term speculator thinks in months, the medium-term swing trader in quarters, the long-term investor in years. Over time the repeated use of those numbers turned them into anchors the market actually reacts to — the self-fulfilling prophecy effect. Around the SMA200 on the daily EUR/USD chart, large clusters of orders accumulate, and price genuinely bounces off the line more often than chance would predict. For the same reason, attempts to optimise the periods — hunting for a "better" 47 or 213 instead of 50 and 200 — usually produce overfitting on historical data and outright failure in live markets. The standard is the standard not because it is mathematically optimal, but because everyone watches it.

What are the real statistical win rates for moving-average crossover signals (golden cross, death cross)?

The classical golden cross — an EMA50 crossing above the SMA200 on the daily — appears roughly once or twice a year on major pairs such as EUR/USD or GBP/USD, and historically precedes a multi-year uptrend in about sixty percent of cases. It is no sure thing, and buying exactly on the signal is profitable on a net basis only after sitting through the first pullback, which almost always follows. Backtests on the S&P 500 since the 1970s show the golden cross delivering an average annual return of roughly eight to ten percent — comparable to buy-and-hold but with materially smaller maximum drawdown. The death cross statistically precedes a fifteen to twenty-five percent decline in the asset over the following twelve months, with a hit rate close to fifty-five percent. The practical takeaway for a retail trader: these are not entry points but confirmations of a long-term regime. After a golden cross, hunt for long positions only on pullbacks to the EMA50; after a death cross, hunt for shorts on bounces. A trade taken on the crossover itself, with no risk management and no higher-timeframe filter, performs barely better than a coin flip.

Go deeper · the complete guide