Moving averages help readers summarize a changing series of market prices. A simple moving average, or SMA, gives equal weight to the observations in a defined window. An exponential moving average, or EMA, gives greater weight to more recent observations through a recursive calculation. Both can be useful for describing trend direction, but both depend on historical information. Neither provides certainty about future prices. Comparing the two requires understanding their formulas, initialization, sensitivity and the conditions under which a smoothed chart can be misleading.
What a simple moving average calculates
For a window containing N observations, the simple moving average is the sum of those observations divided by N. A five-day SMA based on closing prices therefore requires five daily closes. When a new close becomes available, the oldest price is removed and the new price enters the calculation. Each included observation contributes one fifth of the result. A longer window generally smooths more short-term variation than a shorter window, but can react more slowly to abrupt changes. An average calculated from hourly closes should not be confused with an average calculated from daily closes, even if both use the same number of periods.
How the exponential moving average works
The common EMA smoothing factor is alpha = 2 divided by (N + 1). The next EMA equals alpha multiplied by the new observation plus (1 minus alpha) multiplied by the previous EMA. For a five-period EMA, alpha is one third. This means the latest close receives approximately 33.33 percent of the immediate calculation, with the previous EMA providing the remaining weight. Earlier prices remain indirectly represented, with their influence declining over time. The first EMA value must be initialized. One platform may use a simple average as its starting value, while another begins from the first available observation. Differences usually diminish as more data becomes available.
Worked comparison using the same prices
Assume the first five closing prices are 20, 21, 23, 22 and 24. Their sum is 110, and the five-period SMA is 22. For this illustration, initialize the EMA at 22 after those five observations. Suppose the sixth close is 28 and the seventh close is 25. The following calculations use the same interval and rounding convention.
| Observation | Close | Five-period SMA | Five-period EMA |
|---|---|---|---|
| 5 | 24 | 22.00 | 22.00 |
| 6 | 28 | 23.60 | 24.00 |
| 7 | 25 | 24.40 | 24.33 |
At observation six, the SMA removes the price of 20 and adds 28. Its value increases by 1.60. The EMA moves to one third of 28 plus two thirds of 22, or 24. At observation seven, the SMA removes 21 and adds 25. The EMA moves only one third of the way from 24 to 25. The example shows that the EMA is more responsive to the initial jump, but it is not necessarily always above the SMA during an advance. The historical sequence and the prices leaving the SMA window influence their relationship.
Why both averages are lagging measurements
Moving averages summarize observed prices. A sharp change must first occur before it can affect the result. A stock that gaps from 80 to 60 may still have a long-period average near 80, depending on prior observations. The resulting distance between price and average is not evidence that the price must return to its previous level. Likewise, a slowly rising average can remain positive in slope after the latest price has begun declining. A reader can describe these relationships as differences between current and recent historical values, rather than treating them as proof of an upcoming reversal.
Interpreting moving average crossovers
Chart analysts sometimes compare two averages with different window lengths. The shorter average tends to respond sooner to recent price changes. When it crosses above or below the longer average, the relationship between recent prices and a broader history has changed. A crossover can be an observable condition in a research model, but it is not by itself a demonstrated profitable signal. In a sideways market, averages can cross repeatedly as prices oscillate. In a fast-moving market, a crossover can appear after much of the price movement has already occurred. Repeated trades based on such signals may create substantial execution costs.
Choosing a period and data series
Window lengths are commonly expressed as a number of chart observations. A twenty-period average on a daily chart represents twenty trading sessions, not necessarily twenty calendar days. Analysts should distinguish average calculations on regular trading hours from those using extended-hours data. Adjusted closes may be appropriate for some long historical comparisons, while an unadjusted chart reflects historical quoted prices more directly. Mixing adjusted and raw prices without understanding the data source can introduce artificial jumps. The correct period is not universal: a shorter average emphasizes recent change, whereas a longer average summarizes a broader historical interval.
How to compare the two averages in a spreadsheet
- Enter a chronologically ordered series of closing prices and check for missing observations.
- Choose a window length and calculate the first complete SMA using the mean of those closes.
- For subsequent rows, move the SMA window forward by one observation.
- Initialize the EMA using an explicit convention and compute the smoothing factor.
- Apply the recursive formula to each later price, retaining full precision until display.
- Compare the results with the chart platform using identical settings and data.
Do not calculate the first average from fewer prices unless the method explicitly defines how partial windows should be handled. When differences appear between the spreadsheet and platform, inspect rounding, adjustment settings and the amount of earlier data used to initialize the EMA.
Advantages, limitations and testing
The SMA is straightforward to reproduce and its finite window is easy to explain. Its drawback is that dropping an unusual old price can create a visible change even when the latest price barely moves. The EMA avoids a hard cutoff and tends to react sooner, but its values depend on the initialization and smoothing convention. Neither is inherently superior. Evaluating a proposed rule requires predefined parameters, independent data, realistic trade timing and expenses. Fidelity's simple and exponential moving average explanations offer reference definitions. A moving average is a descriptive mathematical tool, not a substitute for evaluating financial risks or a company's underlying business.
Further reading
- Fidelity Simple Moving Average
- Fidelity Exponential Moving Average
Frequently asked questions
Why can two chart platforms display different EMA values?
Different data histories, initialization conventions, price adjustments, session definitions or rounding can produce differences even when the period count is identical.
What does a simple moving average calculate?
For a window containing N observations, the simple moving average is the sum of those observations divided by N. A five-day SMA based on closing prices therefore requires five daily closes.
How does the exponential moving average work?
The common EMA smoothing factor is alpha = 2 divided by (N + 1). The next EMA equals alpha multiplied by the new observation plus (1 minus alpha) multiplied by the previous EMA.
Why are both averages lagging measurements?
Moving averages summarize observed prices. A sharp change must first occur before it can affect the result. A stock that gaps from 80 to 60 may still have a long-period average near 80, depending on prior observations.
How should you interpret moving average crossovers?
Chart analysts sometimes compare two averages with different window lengths. The shorter average tends to respond sooner to recent price changes. When it crosses above or below the longer average, the relationship between recent prices and a broader history has changed.
How do you compare the two averages in a spreadsheet?
Do not calculate the first average from fewer prices unless the method explicitly defines how partial windows should be handled. When differences appear between the spreadsheet and platform, inspect rounding, adjustment settings and the amount of earlier data used to initialize the EMA.