SMA vs EMA: How Moving Averages Differ
A simple moving average (SMA) assigns equal weight to a chosen number of observations, while an exponential moving average (EMA) places more weight on recent prices. Both smooth historical price data; neither forecasts future prices by itself. A faster-reacting EMA can change direction sooner than an SMA but may also generate more noisy signals.
How a simple moving average works
An N-period SMA is the sum of the latest N values divided by N. For five closing prices of 100, 102, 101, 103 and 104, the five-period SMA is (100+102+101+103+104)/5=102. A new SMA replaces the oldest value with the newest. It can be calculated using closing prices, midpoints or another consistent series, so two charts using different input prices may display different values.
The EMA recursion
A common N-period EMA uses the smoothing coefficient alpha = 2/(N+1). The new EMA equals alpha × new price + (1−alpha) × prior EMA. For N=5, alpha is 1/3. If the prior EMA is 101 and the next closing price is 104, the new EMA is (1/3)×104+(2/3)×101=102. EMA initialisation varies among platforms, so early historical values can differ slightly.
Responsiveness versus noise
Because recent prices receive greater weight, the EMA generally reacts faster to a new trend direction. An SMA may smooth a short-lived price jump more heavily over the same displayed period. Faster response is not necessarily better: more crossovers can occur when markets oscillate without direction, and the cost of acting on false signals can outweigh any timing benefit. The appropriate smoothing interval depends on the asset and research question.
What a moving-average crossover describes
A crossover is a moment when one average moves above or below another, such as a short-period mean crossing a longer-period mean. It can be consistent with a change in past price momentum. It cannot establish that the next period will continue in that direction. A crossover strategy must be tested using completed bars and executable prices rather than assuming an ideal transaction at the historical indicator value.
Lag is inevitable for backward-looking indicators
Any moving average calculated from past prices reacts after some movement has already occurred. Long windows smooth more history but usually increase lag. The lag is not a software defect; it is the result of averaging. A moving average can be useful as a reference for trend context and still be inappropriate as a precise turning-point detector.
Period labels and timeframes
A 20-period EMA on a daily chart aggregates different information from a 20-period EMA on a five-minute chart. Markets with weekend gaps and different session calendars can show distinct indicator paths. Even the same nominal timeframe can vary if a data provider’s trading day ends at a different time. Define the input data, timeframe and treatment of missing observations in research.
A fair comparison example
Suppose a hypothetical market changes abruptly from a flat 100 price to a sustained 110 price. A five-period SMA will include the older 100 readings until they roll out of the window. A five-period EMA gives more weight to each newly observed 110 but still retains a diminishing contribution from earlier prices. Which series crosses a threshold first depends on initial values and threshold; neither approach removes execution costs.
Testing and chart interpretation
Set window lengths before testing, use completed observations and compare performance after spreads, commissions and slippage. Avoid optimising periods repeatedly on one dataset until an impressive backtest emerges. Examine performance in trending and range-bound conditions, and document what different averages actually add beyond simpler price-return measures.
For further learning on this method and its limitations, see trend following and moving-average context.
Simple versus exponential moving average: worked inputs
A simple moving average gives its included observations equal weight. An exponential moving average applies a recursive formula that responds more strongly to recent prices.
| Price series calculation | Assumed value | Result |
|---|---|---|
| Three most recent closes | 100, 102, 104 | Three observations |
| Three-period SMA | (100 + 102 + 104) ÷ 3 | 102.00 |
| EMA smoothing factor α | 2 ÷ (3 + 1) | 0.50 |
| Prior EMA carried from earlier history | 101.00 | Initialisation assumption |
| Updated EMA | 101 + 0.50 × (104 − 101) | 102.50 |
The EMA calculation cannot be reconstructed from only the three closing prices without knowing the earlier starting value or warm-up convention. That is why indicator readings can differ between platforms when their data histories differ. A faster response to new price information is not proof of superior forecasting; a more reactive average may also generate more false crossovers in range-bound conditions. Compare the same price basis, session and timeframe when testing SMA versus EMA signals.
Frequently asked questions
Which is better, SMA or EMA?
Neither is universally better; responsiveness, noise and purpose differ.
Does an EMA predict future prices?
No. It weights historical observations.
Why do charts show slightly different EMA values?
Initialisation, price inputs and session data can vary.
