Indicators · Trend and moving averages
Simple moving average (SMA): formula, crossovers and limits
How the simple moving average is calculated, how traders read the 50-day and 200-day lines and their crossovers, and why every SMA signal arrives late.
On this page
A simple moving average (SMA) is the plain arithmetic mean of the last n prices, recalculated every bar. It is the oldest and most widely watched trend tool in technical analysis. When a news anchor says a stock "broke its 200-day," they mean the 200-day simple moving average of its closing price. When a fund manager talks about the market being "above trend," they usually mean the same line on the S&P 500.
The SMA does one job: it removes day-to-day noise so the underlying direction is easier to see. It pays for that clarity with lag. This guide covers the formula and a worked example on real S&P 500 ETF prices, how the popular periods are used, what golden and death crosses really tell you, and how Finabase draws, scans and scores the SMA.
What the SMA measures
Prices move for many reasons that have nothing to do with trend: a large order, a headline, an index rebalance, a quiet holiday session. An average over several days cancels much of that noise because random up and down moves offset each other. What is left is the drift: the direction in which the bulk of the closes have been moving.
The SMA does this with no weighting at all. A 20-day SMA gives yesterday's close and the close four weeks ago exactly the same say, 5% each. That equal treatment is both its virtue and its flaw. It is easy to understand and to reproduce, so every platform shows the same number. But a big move that happened 19 days ago counts as much as one that happened yesterday, and on day 21 it drops out of the window entirely, which can make the line jump for a reason that is weeks old.
The formula
The rolling form shows exactly what moves the line each day: the new close coming in and the old close going out. If today's close is higher than the one dropping out, the SMA rises, whatever happened in between.
A worked example on SPY
To keep the arithmetic short, here is a 5-day SMA of the SPDR S&P 500 ETF (SPY) for the week that ended on March 19, 2026, using Finabase's daily closes.
| Date | Close |
|---|---|
| Mar 13, 2026 | $662.29 |
| Mar 16, 2026 | $669.03 |
| Mar 17, 2026 | $670.79 |
| Mar 18, 2026 | $661.43 |
| Mar 19, 2026 | $659.80 |
The five closes add up to $3,323.34, so the 5-day SMA on March 19 was $3,323.34 ÷ 5 = $664.67.
On March 20 SPY closed at $648.57. The close leaving the window is March 13's $662.29. Using the rolling form:
| Step | Calculation | Result |
|---|---|---|
| Change in the sum | 648.57 − 662.29 | −13.72 |
| Change in the SMA | −13.72 ÷ 5 | −2.744 |
| New 5-day SMA | 664.668 − 2.744 | $661.92 |
The SMA fell $2.74 on a day when price fell $11.23. That damping is the point of the indicator. A 50-day SMA would have moved even less: the same $13.72 swing divided by 50 is only 27 cents.
The lag, made concrete
On a series that rises in a straight line, an n-period SMA trails the latest price by (n − 1) ÷ 2 periods. A 10-day SMA describes the market as it was about four and a half sessions ago; a 200-day SMA, about 100 sessions or nearly five months ago. Any signal based on the line, whether price crossing it or two SMAs crossing each other, inherits that delay.
There is no free fix. A shorter window reacts sooner and whipsaws more. A longer window is steadier and later. Weighted, exponential and adaptive averages move the trade-off around (see Exponential moving average (EMA): formula and how to use it and Weighted moving average (WMA): linear weights, worked example) but none of them removes it, because nothing can know today whether today's move is the start of a trend or noise.
How traders use the SMA
1. As a trend filter
The simplest use is also the most durable: is price above or below a long average, and is that average rising or falling? Price above a rising 200-day SMA is the conventional definition of a long-term uptrend; price below a falling one, a downtrend. Many investors use it not to time entries but to decide which kind of trade to look for, for example buying pullbacks only in stocks above their 200-day.
In the chart above, SPY's 50-day SMA stayed above its 200-day SMA for all 302 sessions in which both lines exist, from August 2025 to the end of October 2026. Over that stretch SPY's close rose from the mid-$630s to $769.36.
2. Price crossing the line
A close above or below the SMA is the most common trigger. The 50-day did useful work in early 2025. SPY closed below it on February 24, 2025 at $597.21. Six weeks later, on April 8, the ETF closed at $496.48, about 17% lower. It recrossed the 50-day on May 1 at $558.47. A trader who exited and re-entered on those two crossings sidestepped most of the decline and bought back about 6.5% below the exit.
The same rule also produced 33 crossings of the 50-day in two years, most of them small round trips that cost a little each time. That is the normal pattern: a handful of big wins paying for many small losses.
The 200-day shows the failure case clearly. SPY closed below its 200-day SMA on March 19, 2026 at $659.80, with the line at $660.10. It kept falling to a close of $631.97 on March 30, then turned and closed back above the line on April 8 at $676.01. Anyone who sold on the break and bought on the recross paid about 2.5% more to get back in, 13 sessions later, with nothing gained.
3. Two-SMA crossovers: golden and death crosses
A golden cross is a shorter SMA (traditionally the 50-day) crossing above a longer one (the 200-day). A death cross is the reverse. Financial media treat both as events. In practice they are slow, smoothed confirmations of a trend change that price itself made weeks earlier, because both lines already lag.
The names make the signals sound more decisive than they are. In a V-shaped recovery the death cross often arrives near the bottom, and the golden cross after much of the rebound. They are most useful as a regime label for long-horizon investors, not as trade triggers.
4. As dynamic support and resistance
Because so many market participants watch the same few lines, pullbacks often pause near the 20-, 50- or 200-day SMA. This is partly self-fulfilling: orders cluster there. It is a tendency, not a rule. A line that held five times can fail on the sixth, and it often fails on a gap that skips straight through it.
Choosing the period
| Period | Typical use | Roughly describes |
|---|---|---|
| 10 | Short-term swing trading; Finabase's custom default | Two weeks |
| 20 | The middle band of Bollinger Bands; a month's trend | One month |
| 50 | The intermediate trend most traders watch | One quarter |
| 100 | A slower intermediate line | Five months |
| 200 | The long-term trend and the classic regime filter | Ten months |
On weekly charts a 40-week SMA is close to the 200-day, and a 10-month SMA on monthly data is the basis of Mebane Faber's well-known 2007 asset-allocation study, which held an asset only while it closed a month above its 10-month average. His published tests showed lower drawdowns than buy-and-hold over the sample, with returns that depended heavily on the period studied, which is a fair summary of what moving-average timing usually delivers.
Pitfalls and limitations
Sideways markets. Any crossover rule loses in a range, buying near the top and selling near the bottom of every swing. A rising or falling slope filter helps; so does requiring a close a set percentage beyond the line.
Gaps. The SMA updates once per bar. An overnight gap can move price far through the line before any signal is possible.
Old data dropping out. The "drop-off" effect means a big move from n days ago can make the SMA turn even when today's price is quiet. If an SMA bends unexpectedly, look at what left the window.
Not adjusted for volatility. A 2% move through the 50-day means something different in a utility stock and in a biotech. Pair the line with a volatility measure such as the Average True Range when you set stops or thresholds.
The SMA compared with other moving averages
| Average | Weighting | Lag on a steady trend | Notes |
|---|---|---|---|
| SMA | Equal over n bars, then zero | (n − 1) ÷ 2 | The universal reference line |
| WMA | Linear, newest heaviest | (n − 1) ÷ 3 | Faster, still a fixed window |
| EMA | Exponential, never fully drops old data | (n − 1) ÷ 2 | Turns faster after a shock |
| DEMA | EMA with its own lag subtracted | About zero | Overshoots on reversals |
| TEMA | Three EMA layers combined | About zero | Fastest, noisiest of the family |
How Finabase calculates and scores the SMA
Finabase computes the SMA with TA-Lib's SMA function on closing prices. When you add a
SMA study yourself the default period is 10, and you can set any period. The
default chart layout already carries two SMAs whose periods depend on the range you are
viewing: 50 and 200 on one-year, two-year and year-to-date charts, 50 and 100 on six
months, 30 and 50 on three months, and shorter pairs for intraday and multi-year views.
For the technical gauge on a symbol page, Finabase checks the close against SMAs of 13 periods (5, 10, 20, 21, 25, 30, 50, 63, 75, 100, 125, 150 and 200). For each one, a close at or above the line counts as Bullish and a close below it as Bearish; there is no neutral reading for a moving average. The Scanner uses the same sweep and lists the stocks whose close has crossed one of those SMAs, up or down, with the date each signal fired.
Read those flags as a description of where price sits, not as advice. A stock just above its 10-day and well below its 200-day carries both a bullish and a bearish SMA reading, which is an accurate picture of a short-term bounce inside a longer downtrend.
Frequently asked questions
What is the 200-day moving average?
It is the average closing price of the last 200 trading sessions, about ten months. It is the most widely cited long-term trend line. Price above a rising 200-day SMA is the conventional definition of a long-term uptrend.
Is a golden cross a buy signal?
Not by itself. It confirms that the 50-day average has overtaken the 200-day, which usually happens well after the low. It has a better record as a description of a long-term regime than as a timing tool, and it fails in choppy markets.
Should I use an SMA or an EMA?
Use the SMA when you want the line everyone else is watching, such as the 50- and 200-day, or a steady, easily reproduced baseline. Use an EMA when a faster response to recent prices matters more than matching the consensus line.
Why is my SMA different from another site's?
Different data, usually: some sites average adjusted closes that include dividends, some include pre-market or after-hours trades, and intraday charts may average a bar that is still forming. The formula itself has no variants.
Summary
The simple moving average is the market's common reference line: an equal-weighted mean of the last n closes that trades responsiveness for clarity. Its signals are late by about half its window, so it shines in long trends and bleeds in ranges. Use it to describe the trend and the regime, look at the slope as well as the crossings, and test any crossover rule across many symbols before trusting it.
Sources and further reading
- Robert W. Colby, The Encyclopedia of Technical Market Indicators, 2nd ed. (McGraw-Hill, 2003) — moving-average definitions and crossover tests
- John J. Murphy, Technical Analysis of the Financial Markets (New York Institute of Finance, 1999), ch. 9 — moving averages
- Mebane T. Faber, “A Quantitative Approach to Tactical Asset Allocation,” Journal of Wealth Management (2007) — the 10-month moving-average timing rule
- TA-Lib — SMA function reference
- Finabase chart data — SPY daily bars, 2024-10-30 to 2026-10-29, SMA computed by Finabase