Simple Moving Average (SMA): Definition and Calculation
The simple moving average, or SMA, is the most basic trend indicator there is, and one of the most useful. It takes the average closing price over a set number of periods and plots it as a smooth line on the chart. That line filters out day-to-day noise so you can see which way price is really heading.
This guide covers how the SMA is calculated, what it looks like on a chart, how traders use it, and where it falls short. For a comparison with its faster cousin, see SMA vs EMA.
What a simple moving average is
A moving average is an average that updates as new data comes in. Each day, the newest price is added and the oldest one is dropped, so the average moves along with the chart.
The word simple means every price in the window counts equally. In a 10-day SMA, the close from ten days ago has exactly the same weight as today's close. That is the key difference from an exponential moving average, which gives more weight to recent prices.
How to calculate an SMA
SMA = (sum of the last N closing prices) / N
Worked example: a 5-day SMA
A stock closes at these prices over seven days:
| Day | Close | 5-day SMA |
|---|---|---|
| 1 | $50 | — |
| 2 | $52 | — |
| 3 | $51 | — |
| 4 | $53 | — |
| 5 | $54 | $52.00 |
| 6 | $56 | $53.20 |
| 7 | $49 | $52.60 |
- Day 5: (50 + 52 + 51 + 53 + 54) / 5 = 260 / 5 = $52.00
- Day 6: drop the $50, add $56. (52 + 51 + 53 + 54 + 56) / 5 = 266 / 5 = $53.20
- Day 7: drop the $52, add $49. (51 + 53 + 54 + 56 + 49) / 5 = 263 / 5 = $52.60
A few things to notice:
- The SMA needs N days of data before it can start. That is why a 200-day SMA does not exist for a stock that listed three months ago.
- On Day 7, price fell sharply to $49, but the SMA only dipped to $52.60. Smoothing absorbs single-day shocks.
- The SMA is now above price. In chart terms, price has dropped below its moving average.
The drop-off effect
An SMA changes based on two things: the price being added and the price being dropped. On Day 7, the SMA fell partly because of the new $49 close, but it would have fallen less if the price dropping off had been higher.
This means an SMA can move simply because an unusual day from N periods ago is leaving the window. A big spike 20 days ago will jolt a 20-day SMA when it drops out, even if nothing is happening today. This quirk is one reason some traders prefer EMAs.
Common SMA periods
| Period | Roughly covers | Typical use |
|---|---|---|
| 10-day | Two weeks | Very short-term swings |
| 20-day | One month | Short-term trend, the middle of Bollinger Bands |
| 50-day | One quarter | Intermediate trend |
| 100-day | About five months | Intermediate to long-term trend |
| 200-day | About one trading year | Long-term trend |
Longer periods are smoother and slower. Shorter periods are quicker and noisier. The 50-day moving average and the 200-day moving average are the most widely watched by far, which gives them a self-reinforcing quality: many traders react near them because many traders are watching them.
How to read an SMA on a chart
Direction of the line. A rising SMA means the average price is climbing, which is the simplest definition of an uptrend. A falling SMA is a downtrend. A flat SMA suggests a range.
Price above or below. When price is above a rising SMA, the trend is up and buyers are in control. When price is below a falling SMA, sellers are in control.
Distance from the line. When price stretches far above its SMA, the move may be overextended and prone to a pullback. When it hugs the line, the trend is calm.
Slope steepness. A steep slope signals a strong trend. A slope that flattens out after a long run can be an early sign the trend is tiring.
How traders use SMAs
As a trend filter. A common rule is to only consider long trades when price is above the 200-day SMA. This one rule keeps many traders out of the worst downtrends.
As dynamic support and resistance. In healthy uptrends, pullbacks often stall near the 20-day or 50-day SMA. Unlike a horizontal support level, this level moves with price.
Crossovers. When a shorter SMA crosses a longer one, it signals a change in trend. The most famous is the 50-day crossing above the 200-day, known as the golden cross.
Common mistakes
Treating the SMA as an exact line. Price often slices through a moving average by a little before bouncing. Think of it as a zone, not a precise level.
Using SMAs in sideways markets. When price chops sideways, it crosses its SMA again and again. Each cross looks like a signal, but most go nowhere.
Mixing up periods and timeframes. A 50-period SMA on a weekly chart covers about a year, not 50 days. Always check which chart you are on.
Using too many lines. Stacking eight SMAs on a chart creates confusion, not clarity. Two or three well-chosen periods are usually enough.
Limitations
The biggest limitation of any SMA is lag. Because it averages past prices, it always trails the current price. A 200-day SMA might not turn down until a stock has already fallen 15% or more. The longer the period, the greater the lag.
SMAs also give equal weight to old and new data, which some traders consider a flaw: why should a price from 199 days ago matter as much as yesterday's? And they ignore volume and intraday highs and lows.
How Stupid Simple Trader uses SMAs
Stupid Simple Trader's signal leans heavily on simple moving averages. Price above the 200-day SMA adds 2 points (below subtracts 2), price above the 50-day SMA adds 1.5 (below subtracts 1.5), and the golden or death cross between the 50-day and 200-day adds or subtracts another 1.5. Together, these SMA components make up most of the possible score, because the long-term trend is the most important context for any signal.
Try it
Open a ticker page such as SPY to see where price sits relative to its 50-day and 200-day SMAs right now, or check the golden cross stocks screen for names where the 50-day is above the 200-day.