Reading the data · · 6 min read
Moving averages explained: how MA and EMA work
A moving average is the average closing price of the last set number of candles, recalculated with every new candle. Its purpose is to smooth out price noise and make the direction easier to see; a simple moving average (MA or SMA) gives every price equal weight, while an exponential moving average (EMA) gives more weight to recent prices.
Moving averages are among the oldest and most widely used tools in technical analysis, and many other indicators are built on top of them. Because they are calculated from past prices, however, they always trail behind. This article covers how both types are calculated, the cost of lag and how to read them on a chart.
How a simple moving average (SMA) is calculated
A simple moving average is the sum of the last N closes divided by N. It is called "moving" because with each new candle the oldest price drops out of the window and the newest one enters.
A hypothetical example: an asset's last five daily closes are 100, 102, 101, 105 and 107. The total is 515, so the five-day SMA is 515 / 5 = 103. If the next day closes at 110, the 100 leaves the window and 110 enters. The new total is 525 and the new SMA is 105.
One property of the SMA is easy to miss: the average is affected not only by the new price but also by the old price leaving the window. An unusually high or low day at the start of the window can move the average noticeably on the day it drops out, even if the price itself did not change that day.
The exponential moving average (EMA)
The EMA blends each new close with the previous EMA value. The calculation works like this:
- Weighting factor: k = 2 / (N + 1). For a five-period EMA, k = 1/3; for a 20-period EMA it is about 0.095.
- New EMA = previous EMA + k × (new close − previous EMA).
- For the very first value, the SMA of the same period is usually used as the starting point.
Let's continue the example and assume that on day seven the price drops sharply and closes at 95:
| Day | Close | 5-day SMA | 5-day EMA |
|---|---|---|---|
| 5 | 107 | 103.00 | 103.00 (start) |
| 6 | 110 | 105.00 | 105.33 |
| 7 | 95 | 103.60 | 101.89 |
On day six the EMA becomes 103 + (110 − 103) / 3 = 105.33. On day seven it falls to 105.33 + (95 − 105.33) / 3 = 101.89. The EMA clearly reacts more strongly to the sudden drop. That is because the newest price carries a fixed and relatively large weight in the EMA, while the influence of older prices fades gradually instead of disappearing all at once.
Lag: the price of averaging
Every moving average relies on the past and trails the price. In a steady trend, a simple average represents the price roughly (N − 1) / 2 candles ago; a 20-period SMA lags by about 9.5 candles. The EMA reacts faster to sudden changes, but it cannot escape lag either.
Choosing a period is a trade-off between speed and stability:
| Period (daily chart) | Common use | Character |
|---|---|---|
| 20 | Short-term direction | Reacts quickly, produces frequent false signals |
| 50 | Medium-term direction | Balance between speed and stability |
| 200 | Long-term direction | Slow and steady, shows turns late |
There is a detail in crypto that often goes unnoticed. In stock markets, a 200-day average covers about 200 trading days, which is roughly nine to ten calendar months. Because crypto trades 24/7, a 200-day average on a crypto chart covers 200 calendar days, or about six and a half months. Two averages with the same name measure different spans of time. Likewise, the closing time of the daily candle can differ between data sources, which can shift the average slightly.
How to read them on a chart
Moving averages are usually read in four ways:
- Slope: whether the average points up, down or sideways summarizes the general direction on the chosen time frame. Flat, tangled averages suggest there is no clear direction.
- Price position: whether the price sits above or below the average shows whether the recent period has been strong or weak relative to that average.
- Distance: when the price moves unusually far from the average, the move is accelerating. That alone is not enough to expect a reversal; in strong trends the price can stay far away for a long time.
- Crossovers: a shorter average crossing above a longer one is read as a delayed confirmation that direction has turned up. The 50-day crossing above the 200-day is called a golden cross, and crossing below it a death cross.
Because many people watch the same averages, the price can sometimes be seen reacting around them. This is not a law of nature but a shared reference point for the crowd, and these levels are broken often.
Common mistakes
- Trusting crossovers in a sideways market: when the price swings within a range, averages cross back and forth and each crossover cancels the previous one. This is known as whipsaw.
- Hunting for the period that fit the past best: it is easy to find the period that produced the best results on historical data; there is no proof it will work in the future. This is called overfitting.
- Mixing up time frames: a 200-period average on a four-hour chart and a 200-period average on a daily chart do not measure the same thing.
- Leaning on a single indicator: averages summarize direction, but they say nothing about volume, volatility or the news flow.
The honest way to see whether a crossover rule works is to record outcomes in advance and compare them with random choices. Sezga's forecast ledger shows this approach with its built-in strategies and compares them with control groups; for a crossover rule, you keep the record yourself. The paper trading account lets you test the rule without real money.
Key takeaways
- A moving average is the average of the last N closes, updated with every new candle; its job is to smooth noise and show direction.
- The SMA weights all prices equally; the EMA uses the factor k = 2 / (N + 1) to weight recent prices more and reacts faster to sudden changes.
- Every average lags; short periods are quick but often wrong, long periods are stable but show turns late.
- Because crypto trades 24/7, a 200-day average covers a shorter calendar span than it does in stock markets.
- Crossovers often mislead in sideways markets; the value of a rule becomes clear only by keeping records and comparing with random choices.