Simple moving average vs exponential: compare the weights
For complete, equally spaced closing-price data, SMA is the sum of the latest N closes divided by N. EMA updates as alpha × current close + (1 − alpha) × previous EMA, with alpha = 2 / (N + 1). The EMA needs an initial value, so record the seed and warm-up history when reproducing numbers. These formulas describe the calculations, not a forecast.
| Same length: 5 bars | SMA | EMA |
|---|---|---|
| Newest close | 20% weight | 33.333% weight |
| Previous close | 20% weight | 22.222% weight |
| Two bars ago | 20% weight | 14.815% weight |
| Older observations | 20% each for three and four bars ago; zero outside the five-bar window. | Weights continue to decay. The previous EMA carries the remaining history and seed contribution. |
| What moves the line | The difference between the new price entering and the old price leaving the window. | The difference between the new price and the previous EMA. |