EMA vs SMA: how the two moving averages are calculated

By: WEEX
|
0

A simple moving average (SMA) is the average of the last N prices, with every price counted equally. An exponential moving average (EMA) is also an average of recent prices, but it gives more weight to the most recent ones.

Here's what a moving average does, how the SMA and the EMA are calculated, a side-by-side example, and what the differences mean in practice. This is an educational explanation, not a trading guide, and it doesn't say which average is better.

What a moving average does

A moving average smooths a price series by replacing each price with an average of recent prices. It shows direction more clearly than raw prices, and because it is built from past prices, it always lags. 

A period is one candle of the chart's timeframe, so a 20-period average on a 1-hour chart covers 20 hours.

How the SMA is calculated

The SMA is the sum of the last N closing prices divided by N, so each price has a weight of 1/N. In a 20-period SMA, each close counts for 5%. 

When a new price arrives, the oldest one drops out of the calculation completely.

How the EMA is calculated

StockCharts' ChartSchool gives the standard method. First compute a multiplier, 2 ÷ (N + 1). Then update the average with each new close:

  • Multiplier = 2 ÷ (N + 1)
  • EMA = (close − previous EMA) × multiplier + previous EMA

The first EMA value needs a starting point, and ChartSchool uses the SMA for it. For a 10-period EMA, the multiplier is about 0.18, so the latest price carries about 18% of the weight, and for a 20-period EMA it is about 0.095, or 9.5%. Older prices fade out gradually, but they never leave the calculation completely.

A side-by-side example

Take five closes of 10, then a close of 16, then five more closes of 10, and use a 5-period SMA and EMA. The multiplier is 2 ÷ 6, or about 0.33. When the 16 arrives, the SMA moves to 11.2 and the EMA to 12.0, so the EMA reacts more.

Over the next four closes the SMA stays at 11.2, because the 16 is still inside its five-price window. On the fifth it drops back to 10 in a single step. The EMA instead fades gradually: 12.0, 11.3, 10.9, 10.6, 10.4, and 10.3. The SMA has a sharp step when a large price leaves the window, and the EMA has a long tail of older data.

What the differences mean

According to ChartSchool, the EMA reduces lag by applying more weight to recent prices, so it reacts faster to changes. The price of that is being more sensitive to short-term swings. The SMA is smoother and slower. Neither removes lag, because both are built from the past.

A 20-period SMA and a 20-period EMA don't smooth by the same amount, so comparing lines of the same length isn't comparing like with like. EMA values can also differ between platforms, because they depend on how the calculation is started and how much history it uses. Other indicators use these averages as building blocks: MACD is built from EMAs, and traditional Bollinger Bands use an SMA. Research on technical indicators, including Park and Irwin's review, finds the evidence mixed.

WEEX Reminder: compare moving averages with the same settings

WEEX reminds users that a moving average only describes past prices, and that the same length doesn't mean the same smoothing. Before comparing two lines, check the type of average, the period, the timeframe, and which price the chart uses. Nothing here is financial advice.

Conclusion

An SMA counts each of the last N prices equally and drops the oldest completely, while an EMA weights recent prices more heavily using a multiplier of 2 ÷ (N + 1) and lets older prices fade. The EMA reacts faster and is more sensitive, the SMA is smoother and slower, and both lag. Neither predicts price, and which one suits a purpose depends on what is being measured.

FAQ

1. What is the difference between EMA and SMA?
An SMA gives every price in the window equal weight. An EMA gives more weight to recent prices, so it reacts faster to changes.

2. How is an EMA calculated?
EMA = (close − previous EMA) × multiplier + previous EMA, where the multiplier is 2 ÷ (N + 1). The first value is usually started from an SMA.

3. Which is better, EMA or SMA?
Neither is established as better. The EMA reacts faster and is more sensitive to short-term swings, and the SMA is smoother and slower. This article doesn't recommend either.

4. Why does an EMA react faster than an SMA?
Because it puts more weight on the latest price: 2 ÷ (N + 1) of the weight, compared with 1 ÷ N for the SMA. At 20 periods that is about 9.5% against 5%.

5. Why do EMA values differ between platforms?
Platforms can start the calculation differently, use different amounts of history, apply different price inputs, or round differently, so the same EMA setting may give slightly different values.

Related articles
Share
copy

Gainers

iconiconiconiconiconiconiconiconicon
Customer Support:@weikecs
Business Cooperation:@weikecs
Quant Trading & MM:bd@weex.com
VIP Program:support@weex.com