Moving Averages Explained: SMA vs EMA With a Worked Example

Learn how the simple (SMA) and exponential (EMA) moving averages are calculated, how they differ, what lag means and which mistakes beginners often make.

· 7 phút đọc

Bài viết này chỉ có bằng tiếng Anh.

A moving average smooths price data into a single line so the general direction of the market is easier to see. It is one of the most common indicators on any chart, and the two versions you meet first are the simple moving average (SMA) and the exponential moving average (EMA). This guide explains how each one is calculated, how they differ, what a moving average can and cannot tell you, and the mistakes beginners often make with them.

What is a moving average?

A moving average takes the closing prices of the last N candles, combines them into one number, and plots that number on the chart. When a new candle closes, the oldest price drops out of the window and the newest one enters, so the line "moves" along with the market. The value N is called the period. A 20-period average on a daily chart uses the last 20 daily closes, while the same setting on a 1-hour chart uses the last 20 hourly closes.

Because it blends many prices, a moving average reacts more slowly than price itself. That delay is called lag, and it is both the feature and the weakness of the tool: the line filters out small random moves, but it also confirms changes only after they have already started. A moving average describes what has happened. It does not forecast what will happen next.

How the simple moving average (SMA) works

The SMA gives every price in the window the same weight. You add up the last N closes and divide by N.

SMA = (sum of the last N closing prices) ÷ N

Here is a worked example with a 5-period SMA on a made-up EUR/USD series. The last five closes are 1.1000, 1.1020, 1.1010, 1.1040 and 1.1050.

SMA(5) = (1.1000 + 1.1020 + 1.1010 + 1.1040 + 1.1050) ÷ 5 = 5.5120 ÷ 5 = 1.1024

Now a new candle closes at 1.1070. The 1.1000 close leaves the window and the new close enters:

New SMA(5) = (1.1020 + 1.1010 + 1.1040 + 1.1050 + 1.1070) ÷ 5 = 5.5190 ÷ 5 = 1.1038

The SMA moved from 1.1024 to 1.1038. Notice that each old price carries the same influence right up until the moment it drops out, which can make the line step noticeably when a large old candle leaves the window.

How the exponential moving average (EMA) works

The EMA gives more weight to recent prices, so it reacts faster to new information. It uses a smoothing multiplier based on the period:

Multiplier = 2 ÷ (N + 1) EMA today = (Close today − EMA yesterday) × Multiplier + EMA yesterday

For a 5-period EMA the multiplier is 2 ÷ 6 = 0.3333. Charting platforms usually need a starting value, and a common method is to begin with the SMA of the first N closes, so we use 1.1024 as the previous EMA. With the new close of 1.1070:

EMA = (1.1070 − 1.1024) × 0.3333 + 1.1024 = 0.00153 + 1.1024 ≈ 1.1039

In this tiny example the EMA (1.1039) is only slightly above the SMA (1.1038), because the new close is just one move. The gap grows when prices change quickly. Technically an EMA never fully forgets old prices, since every past close keeps a small, shrinking share of the weight, but in practice the recent candles dominate. Exact values can differ a little between platforms because of how they seed the first EMA value.

SMA vs EMA: the main differences

FeatureSMAEMA
WeightingEqual for all N pricesHigher for recent prices
Speed of reactionSlowerFaster
SmoothnessSmoother, fewer wigglesFollows price more closely
Typical weaknessMore lagMore false turns in noisy markets

Neither is "better". A faster line reacts sooner but is fooled more often by short-lived moves, while a slower line is steadier but later. The period matters as much as the type: a 10-period EMA and a 200-period SMA behave very differently simply because of the length of the window. Many educational sources describe short periods (such as 9 or 20) as capturing short-term movement and long periods (such as 50 or 200) as describing the broader trend, but these are conventions, not rules of nature.

How traders commonly read moving averages

Moving averages are usually used as context tools rather than as stand-alone triggers. Some of the most common ways they are described:

  1. Direction. A line that slopes upward with price mostly above it describes an uptrend over that window. A downward slope with price mostly below it describes a downtrend. A flat line that price keeps crossing suggests a sideways market.
  2. Dynamic support and resistance. Price sometimes reacts near a widely watched average such as the 50 or 200. This overlaps with the idea in support and resistance for beginners, though a reaction is never guaranteed.
  3. Crossovers. When a faster average crosses a slower one, some people interpret it as a change in momentum. Crossovers appear after the move has begun and produce many false signals when the market moves sideways.
  4. Distance from price. When price is far from its average, some traders describe the market as stretched, but price can stay stretched for a long time.

It also helps to read the average together with the candles themselves. The article on how to read a candlestick shows what each bar records, which gives the moving average more meaning.

Common mistakes with moving averages

How to practise safely

A sensible way to learn is to add one SMA and one EMA of the same period to a chart, compare how they behave in trending and sideways stretches, and record what you see. Writing observations in a trading journal turns vague impressions into notes you can review later. Test ideas on a demo account first, and remember that results from a demo or from past data do not guarantee anything about live trading.

Summary

A moving average smooths past closing prices into one line. The SMA weights every price equally and the EMA weights recent prices more, using the multiplier 2 ÷ (N + 1). The EMA reacts faster, the SMA is steadier, and both lag because they are built from history. They help describe trend direction and context, but they are not forecasts and they cannot remove risk. This article is for education only and is not trading advice.

Câu hỏi thường gặp

What is the difference between SMA and EMA?

The SMA gives equal weight to every price in its window, while the EMA gives more weight to recent prices. As a result the EMA reacts faster and the SMA is smoother.

How is an exponential moving average calculated?

It uses a multiplier of 2 ÷ (N + 1): EMA today = (close today − EMA yesterday) × multiplier + EMA yesterday. The first value is often seeded with a simple average, so platforms can differ slightly.

Which moving average period is best?

There is no single best period. Shorter periods follow price closely but give more false turns, longer ones are steadier but later, and a setting that fit past data well may not fit future data.

Can a moving average predict the market?

No. It is calculated from past closing prices, so it describes what has already happened and lags behind price. It gives context about direction, not a forecast.

Chỉ nhằm mục đích giáo dục. Không phải lời khuyên tài chính. Giao dịch có rủi ro thua lỗ cao. Miễn trừ trách nhiệm

Video liên quan

Bài viết khác

Xem tất cả