On this page
Moving Average: SMA, EMA, and WMA Compared
A moving average smooths a price series into a single line that updates each bar. It is the most basic tool in technical analysis and the building block for dozens of other indicators, from MACD to Bollinger Bands.
Key Takeaways
- SMA, EMA, and WMA all smooth price, but EMA and WMA react faster to recent data by weighting newer bars more heavily.
- A 10-period EMA applies roughly 18 percent weight to the most recent price versus a 20-period EMA's 9.5 percent.
- Using a fast moving average in a sideways market produces frequent whipsaws that look profitable in hindsight but costly in live trading.
- Moving averages are trend filters and support/resistance guides, not standalone buy or sell signals.
Key Takeaways
- SMA, EMA, and WMA all smooth price, but EMA and WMA react faster to recent data by weighting newer bars more heavily.
- A 10-period EMA applies roughly 18 percent weight to the most recent price versus a 20-period EMA's 9.5 percent.
- Using a fast moving average in a sideways market produces frequent whipsaws that look profitable in hindsight but costly in live trading.
- Moving averages are trend filters and support/resistance guides, not standalone buy or sell signals.
What It Is
A moving average is the average price of a security calculated over a rolling window of the most recent N periods. As each new bar closes, the window slides forward by one, dropping the oldest observation and adding the newest. The result is a line that follows price at a lag.
The three common types differ only in how they weight the observations inside the window. The simple moving average (SMA) treats every period the same. The weighted moving average (WMA) gives linearly increasing weight to more recent periods. The exponential moving average (EMA) gives exponentially decaying weight to older periods and never completely drops them.
The Intuition
Raw price bars are noisy. On any given day a stock might gap up on a rumor, drift sideways, then close lower on a late-day news item. None of that tells you much about the underlying trend. Averaging the last 20 or 50 closes washes out the jitter and leaves a cleaner picture of direction.
The tradeoff is lag. A longer window gives you a smoother line but it reacts slowly when the trend actually changes. A shorter window turns faster but lets more noise through. Choosing the type and length of a moving average is really a choice about how much lag you are willing to accept to get less noise.
How It Works
The simple moving average is the straight arithmetic mean of the last N closes:
SMA = (P1 + P2 + ... + PN) / N
Every price gets the same weight, 1/N. That makes it easy to compute and easy to reason about, but it also means a single stale observation five weeks ago has as much pull on today's SMA as yesterday's close.
The weighted moving average addresses that by assigning each period a weight that scales with its recency. A standard linear WMA uses weights 1, 2, 3, up to N, summed and then divided by the total:
WMA = (P1*1 + P2*2 + ... + PN*N) / (1 + 2 + ... + N)
The most recent price gets the largest weight, yesterday's gets one less, and the oldest price in the window gets the smallest. The weights form a straight line.
The exponential moving average is smoother than WMA. It uses a recursive formula with a smoothing multiplier:
EMA_today = (Price_today * k) + (EMA_yesterday * (1 - k))
where k = 2 / (N + 1)
For a 10-period EMA, k is about 0.1818, so today's price gets roughly 18 percent weight and the previous EMA gets the rest. StockCharts notes that a 10-period EMA applies an 18.18 percent weighting to the most recent price, while a 20-period EMA applies only 9.52 percent. Older observations are never fully discarded, but their influence decays quickly.
Worked Example
Take five daily closes: 100, 102, 104, 103, 110. Compute each average with N = 5.
SMA: (100 + 102 + 104 + 103 + 110) / 5 = 519 / 5 = 103.8
WMA: weights are 1, 2, 3, 4, 5, summing to 15. (1001 + 1022 + 1043 + 1034 + 110*5) / 15 = (100 + 204 + 312 + 412 + 550) / 15 = 1578 / 15 = 105.2
EMA: seed with the SMA of 103.8, then apply k = 2 / (5 + 1) = 0.333. If we imagine today's close of 110 as the newest bar and 103.8 as the prior EMA: (110 * 0.333) + (103.8 * 0.667) = 36.63 + 69.23 = 105.9
All three are valid averages of the same data. The SMA sits at 103.8, pulled down by the older prints. The WMA and EMA both sit near 105 to 106 because they lean on the most recent 110 close. That gap is exactly the responsiveness difference traders care about. When the trend turns, the EMA and WMA cross price sooner than the SMA.
Common Mistakes
-
Using the wrong type for your horizon. Short-horizon traders often default to SMAs because they are familiar, then complain that entries feel late. If you trade in days, not months, an EMA or WMA is usually a better fit. The reverse is also true: long-term investors using a fast 9-period EMA will get chopped around by noise their strategy was never meant to react to.
-
Confusing trend lag with trend noise. A moving average always lags price. That is not a flaw, it is the entire point. If your average is crossing up and down every few bars, the window is probably too short, not broken.
-
Overfitting the length to past data. If you search through every period from 5 to 200 looking for the length with the best historical returns, you are curve-fitting. The backtest will look great and live performance will look nothing like it. Pick a length tied to the timeframe you actually trade, or validate on out-of-sample data.
-
Treating a cross of price and moving average as a guaranteed signal. Price pokes above and below a moving average constantly in sideways markets, producing whipsaws. Most practitioners combine moving averages with a volatility filter or a second confirming signal before acting.
-
Mixing price types without noticing. SMAs and EMAs can be built on closes, highs, lows, medians, or typical prices. Changing the input silently between strategies produces results that are not comparable.
Frequently Asked Questions
Q: What is a moving average in simple terms? A moving average is the average closing price of a stock over the last N periods, recalculated each bar by dropping the oldest value and adding the newest. It produces a smooth line that follows price at a lag.
Q: How does a moving average affect investment decisions? It quickly shows whether a stock is in an uptrend (price above a rising average), downtrend (price below a falling average), or sideways market (flat average). Many investors use the 200-day moving average as the line between long-term bullish and bearish positioning.
Q: What is a real-world example of moving average analysis? During the S&P 500's 2020–2022 rally, the index held above its rising 50-day SMA through every pullback. Each dip to the 50-day attracted buyers who used it as a trend confirmation signal, reinforcing the level's usefulness as dynamic support.
Q: How can investors use moving averages practically? Choose the window length based on your holding period: short-term traders use 9 or 20 periods, swing traders 50 periods, and long-term investors 200 periods. A simple rule: combine at least two moving averages of different lengths so you see both the near-term and longer-term trend at once.
Q: How is an EMA different from a simple moving average? An SMA weights every period equally, so a price from 50 days ago pulls the average as much as yesterday's close. An EMA gives exponentially more weight to recent prices, making it faster to react when price changes direction, but also noisier in sideways markets.
Sources
- StockCharts ChartSchool. "Moving Averages - Simple and Exponential." https://chartschool.stockcharts.com/table-of-contents/technical-indicators-and-overlays/technical-overlays/moving-averages-simple-and-exponential
- Corporate Finance Institute. "Simple Moving Average (SMA)." https://corporatefinanceinstitute.com/resources/career-map/sell-side/capital-markets/simple-moving-average-sma/
- Corporate Finance Institute. "Weighted Moving Average (WMA)." https://corporatefinanceinstitute.com/resources/career-map/sell-side/capital-markets/weighted-moving-average-wma/
- Charles Schwab. "A Moving Average: Simple vs. Exponential." https://www.schwab.com/learn/story/simple-vs-exponential-moving-averages
- Fidelity Learning Center. "Exponential Moving Average (EMA)." https://www.fidelity.com/learning-center/trading-investing/technical-analysis/technical-indicator-guide/ema
Disclaimer
This article is educational content only and is not financial advice. Nothing here is a recommendation to buy, sell, or hold any security. Consult a licensed advisor before making investment decisions.
Back to your knowledge path