Simple moving average (SMA): how to calculate it and how to read it
The simple moving average on a real stock
In amber the 50-day SMA, in blue the 200-day SMA. The 50-day crossed below the 200-day on (death cross) and back above it on (golden cross).
InteractiveRead a session. Click a day on the chart above: I tell you the close, the averages on that day and how far the price is from them.
What the simple moving average is
Fig. 1 · Anatomy
- The black line is the price: one close per session.
- The amber line is the average of the last n closes: the band shows which ones go into the sum.
- Every session the new close comes in and the oldest drops out: that is why it is moving.
- Every close carries the same weight: that is why it is simple.
next session: new sum = old sum − close dropped + close added
The calculation, step by step
Microsoft, 5-day SMA, last closes of 2025| Session | Close | Sum of the last 5 | 5-day SMA |
|---|---|---|---|
| 484.92 | — | — | |
| 486.85 | — | — | |
| 488.02 | — | — | |
| 487.71 | — | — | |
| 487.10 | 2,434.60 | 486.920 | |
| 487.48 | 2,437.16 | 487.432 |
| Step | Calculation | Result |
|---|---|---|
| Add the 5 closes up to | 484.92 + 486.85 + 488.02 + 487.71 + 487.10 | 2,434.60 |
| Divide by 5: that is the 5-day SMA for that day | 2,434.60 / 5 | $486.920 |
| Next session, : drop the oldest close, add the new one | 2,434.60 − 484.92 + 487.48 | 2,437.16 |
| Divide by 5 again | 2,437.16 / 5 | $487.432 |
| 50-day SMA: the same sum over 50 closes | 24,836.35 / 50 | $496.727 |
| 200-day SMA: the same sum over 200 closes | 95,156.98 / 200 | $475.785 |
From to the 5-day SMA rose: the close that came in ($487.48) is higher than the one that dropped out ($484.92). That is all there is to the slope of a moving average.
20, 50 and 200 days: which period
Fig. 2 · Short, medium, long
- The 20-day SMA, one month of trading, follows the price closely.
- The 50-day SMA, just under a quarter, is smoother.
- The 200-day SMA, about ten months of trading, moves slowly and turns last.
- A long average starts late: it needs 200 sessions before its first value.
| Sessions | Trading weeks | Months, approx. | Weight of each close |
|---|---|---|---|
| 10 | 2 | 0.5 | 10% |
| 20 | 4 | 1.0 | 5% |
| 50 | 10 | 2.4 | 2% |
| 100 | 20 | 4.8 | 1% |
| 200 | 40 | 9.5 | 0.5% |
The longer the period, the less each close weighs: the average gets smoother and slower. The 20, 50 and 200-day periods are conventions: they are the ones seen most often on daily charts, not numbers with special properties.
How to read it: price, slope, crossover, lag
Fig. 3 · Above or below, and the slope
- Price above the SMA: recent closes are higher than their average.
- Price below the SMA: they are lower.
- The SMA rises when the close coming in is higher than the one dropping out.
Fig. 4 · The crossover of two averages
- Two SMAs go on the same chart: a fast one and a slow one.
- Death cross: the 50-day SMA crosses below the 200-day.
- Golden cross: the 50-day SMA crosses above the 200-day.
- They are names for an event on the chart, not a forecast: they tell what the price has already done.
Fig. 5 · The lag
- The price makes its high and turns: the SMA keeps rising for a while.
- The SMA turns only when the closes coming in are lower than the ones dropping out.
- The longer the average, the longer the lag: that is its limit.
Fig. 6 · The sideways market
- With no trend the price swings up and down around the SMA.
- It crosses it again and again, and each crossing is short-lived.
- A moving average describes a trend: where there is no trend, it says little.
The chart at the top lets you measure the lag: the 2025 low of Microsoft came on , at $352.67. The golden cross arrived on , 42 sessions later, with the close at $471.09. The average arrives after the price because it is made of past closes.
The reading rules
six things to look at, one at a time1The slope is the trend
- rising SMA: the new closes are higher than those of n sessions ago
- flat SMA: no trend to describe
2The price above or below
- above the SMA: the price is higher than its recent average
- moving from one side to the other is a crossing
3The distance from the average
- it is measured as a percentage of the SMA
- when the price runs the distance grows: the SMA follows it with a lag
4The crossover of two averages
- fast above slow: the short period is higher than the long one
- with 50 and 200 days: golden cross upward, death cross downward
5The period changes everything
- short: it reacts sooner and gets crossed more often
- long: smoother, slower, fewer crossings
6In a sideways market it says little
- with no trend the price keeps crossing the SMA
- crossovers multiply and do not last
The simple average gives the same weight to every close in the window. The other averages in the family change the weights to reduce the lag: the exponential moving average (EMA) and the weighted moving average (WMA) give more weight to recent closes. The 20-day simple average is also the centre line of Bollinger Bands.
InteractiveTry the periods
one or two averages: the chart below changes with youThe counts cover the 2025 sessions of Microsoft. A crossing is a close that moves from above the first SMA to below it, or the other way round.
In amber the 50-day SMA, in blue the 200-day. The circles mark the crossovers: green upward, red downward.
Interactive exerciseFind the death cross and the golden cross
Microsoft, 2025: two clicks on the chart, the judge tells you whether they are right and why- Click where the 50-day SMA (amber) crosses below the 200-day (blue): that is the death cross.
- Click where the 50-day crosses back above the 200-day: that is the golden cross.
- Read the verdict. Tolerance: 10 sessions before or after the crossover, two trading weeks.
Two lines: amber the 50-day SMA, blue the 200-day. Find the two points where they cross.
Where to go from here
The indicators · Moving averagesThe other lessons in the guide
What is technical analysis
- the study of price and volume to recognise the trend and the levels
- three premises: price discounts everything, trends, history repeats
- exercise: uptrend, downtrend or sideways on three real charts
Candlestick chart
- the four prices of a session: body and shadows
- green and red, long and short bodies, long shadows, the doji
- find the candle on a real chart: the judge says yes or no with the numbers
Uptrend: higher highs and higher lows
- higher highs and higher lows: how to recognize an uptrend
- swing points, and the two signals that end a trend
- mark the higher lows yourself on a real chart
Support and resistance
- the level where the decline stopped, and the one where the rise stopped
- touches, time and volume: how much a level counts; once broken, it switches roles
- find the level yourself on a real chart: the judge counts the touches
Frequently asked questions
What is a simple moving average (SMA)?
It is the arithmetic mean of the last n closing prices of a stock, recalculated every session: the new close comes in, the oldest drops out. Every close carries the same weight. On the chart it is a line that follows the price with a lag and shows its trend without the noise of single days.
How do you calculate a simple moving average?
Add the last n closes and divide by n. A real example: the five closes of Microsoft up to add up to $2,434.60; divided by 5 that is $486.920. The next session you drop the oldest close, add the new one and divide by 5 again.
Which periods are most used for a moving average?
On daily charts 20, 50 and 200 days: about a month, just under a quarter and about ten months of trading. The short average follows the price closely and gets crossed often; the long average is smoother and turns later. They are widespread conventions, not numbers with special properties.
What are the golden cross and the death cross?
They are the two crossovers of the 50-day and the 200-day SMA. Golden cross: the 50-day crosses above the 200-day. Death cross: it crosses below. On Microsoft in 2025 the death cross came on and the golden cross on . They describe what the price has already done: they arrive late, like every moving average.
Method and sources
| Source |
|---|
| John J. Murphy, Technical Analysis of the Financial Markets: chapter 9, moving averages. |
| Charles D. Kirkpatrick and Julie R. Dahlquist, Technical Analysis (CMT curriculum): moving averages. |
The chart uses the Microsoft sessions from to in our archive, adjusted for dividends and corporate actions and rounded to the cent: 2025 is shown, the 2024 sessions are needed to calculate the 200-day SMA. The numbered figures are diagrams drawn to explain, not prices. This guide explains how the tools work: it does not contain investment recommendations and promises no returns. Our method · licence · report an error.
DOMINA’s stock pages, indices and commodities are rebuilt every night. Leave your email: we write to you when the picture changes.
No third-party advertising. Unsubscribe with one click. Go to the platform →