What Is a Moving Average?
A moving average is the average closing price over the last set number of bars, recalculated on every new bar. It smooths price into a single line. The slope of that line describes the trend, and because it moves with price it also acts as a level that shifts over time.
Covered on this page: TradingView.
A moving average is the average closing price over the last set number of bars, such as 20, 50 or 200 days, recalculated as each new bar closes. It smooths price into one line whose slope shows the trend, and because it is built from past closes it always trails price.
It is one of the most used indicators there is, and one whose actual behavior is often misdescribed. The calculation takes one sentence; the three things worth knowing about it take this page.
How it works
A moving average is the average of the last N closing prices, recalculated on every bar.
On a ten-period average, each point on the line is the mean of the ten closes up to that bar. Next bar, the oldest close drops out and the newest one enters. That is the whole mechanism — no prediction, no model, an arithmetic mean on a rolling window.
Which means it can only ever describe what has already happened.
How to calculate one, with real closes
Simple: add the closes and divide by how many there are. The S&P 500 closed at 7,764.70, 7,764.64, 7,706.03, 7,704.13 and 7,743.41 on the five trading days from 21 to 25 September 2026. Those add to 38,682.91, and 38,682.91 ÷ 5 gives a five-day simple moving average of 7,736.58.
The next bar swaps one close for another. The five closes up to 24 September began with 7,650.50 on 18 September and averaged 7,718.00. On 25 September that old close left the window and 7,743.41 entered, so the average rose by (7,743.41 − 7,650.50) ÷ 5 = 18.58 points. The change in a simple average is always the new close minus the one that dropped out, divided by the length.
Exponential: weight the newest close and carry the rest. The weight is 2 ÷ (N + 1), which is a third for five days. Seeded with the 7,718.00 simple average on 24 September, the usual way to start one, the exponential moving average for 25 September is 7,743.41 × 1/3 + 7,718.00 × 2/3 = 7,726.47.
So the two versions moved differently on the same day. The simple average rose 18.58 points, largely because a weak close fell out of its window. The exponential rose 8.47, because it never drops a close outright; old ones only fade. That difference is the whole of the EMA against SMA question.
It is always behind
The lag is not a flaw to be tuned out — it is what smoothing is. An average of the last ten closes contains nine closes that are not the current one, so it must trail. Any setting that removes the lag also removes the smoothing, and then you are just looking at price again.
The useful consequence: the average tells you where price has been centered, which is a genuinely different question from where it is now.
Length changes what it ignores
A short average tracks price closely and reacts to everything, including noise. A long one is smoother and slower.
Neither is more accurate. They answer different questions: the short one asks what has happened lately, the long one asks what has been true for a while. Choosing a length is choosing which moves you want to be invisible.
Simple against exponential
A simple moving average weights every close in the window equally. An exponential one weights recent closes more heavily, so it turns sooner.
That is the entire difference, and it is a trade rather than an upgrade: turning sooner means turning sooner on moves that do not continue, too.
What to actually read off it
The slope
A rising line means recent closes are higher than older ones. A flat line means they are not, whatever the price is doing at this second. The slope is the single most useful reading on the indicator and it needs no settings at all.
Its position, as a level
Because so many people watch the same lengths, price often stalls at them — the same crowding mechanism behind support and resistance, except this level moves.
The crossover, honestly
When a fast average crosses above a slow one, the recent average has moved above the longer-run one. It is a statement about two averages, not about the market. The general version has its own page on the moving average crossover, and the famous 50/200 pair has two named ones, the golden cross and the death cross.
Worth knowing where this leads: subtract one of these averages from the other and plot the result, and you have moving average convergence divergence (MACD). It is not a separate idea, it is this one drawn a different way.
Put numbers on a hypothetical trend. Say a move begins at 98.74 and runs to 101.64, a range of 2.90, and the cross fires at 99.55.
So the signal missed 0.81, about 28% of the move, and was still in for the remaining 72%.
That is more favorable than the usual “crossovers are always too late” line, and it is worth stating plainly rather than pretending otherwise. The problem with crossovers is not the trending case. It is the ranging one.
A worked example
Picture a typical trend in four stretches, read left to right, using the slope and the level rather than the cross.
The falling stretch. Price is below the thirty-period average and that average is pointing down. Both readings agree, and the useful conclusion is a negative one: this is not a place to be looking for longs. Most of what an average does for you is rule things out.
The flat stretch. Price crosses back and forth through the line and the line goes sideways. A flat average is a real reading, not a missing one — it says there is no trend to be in. Crossovers here are the ones that whipsaw: the two averages can cross many times with no trend behind any of them.
The turn. The average starts to rise and price holds above it. Now the two readings agree again, in the other direction.
The pullback. Price comes back and stalls near the line. This is the moment the average is actually useful — not because it predicted anything, but because it gave a moving level to watch, and price arrived at it while the slope was still up.
What it never gave you was a stop. The line moves every bar, so “below the average” is a different price tomorrow. The invalidation has to come from a fixed level — a swing low from market structure, or a level you already drew.
The original data
How often price crosses each length. The test uses daily closes of the S&P 500 index, price only, from Yahoo Finance, over the same span for every length: 19 October 1950, the first day a crossing of a 200-day average can be counted, to 25 September 2026, 75.9 years. A crossing is a close on the other side of the average from the previous close. The full table is in the crossings by length file.
| Simple average | Crossings | Per year | Next crossing within 5 trading days | Days closed above it |
|---|---|---|---|---|
| 10-day | 2,974 | 39.2 | 57.2% | 58.7% |
| 20-day | 2,018 | 26.6 | 53.4% | 61.1% |
| 50-day | 1,188 | 15.6 | 52.4% | 64.5% |
| 100-day | 794 | 10.5 | 52.4% | 67.9% |
| 200-day | 448 | 5.9 | 53.1% | 71.6% |
Length cut the number of crossings, not the share that failed fast. Going from a 10-day to a 200-day average took crossings from 39.2 a year to 5.9. Yet at every length, 52% to 57% of crossings were followed by another crossing of the same line within five trading days. A long average hands you far fewer false alarms in total, but a single crossing of it is not much more likely to stick.
The exponential version crossed more, as its weighting implies. Over the same span price crossed a 50-day exponential average 1,356 times, 17.9 a year, against 1,188 for the 50-day simple one, and a 200-day exponential 530 times, 7.0 a year, against 448.
The long average is a slow event even in a busy year. The index crossed its 200-day simple average four times in 2025, on 10 March, 24 March, 26 March and 12 May, and twice so far in 2026, on 19 March and 8 April.
Being above the 200-day was the ordinary state. The index closed above it on 71.6% of days in the span, so “price is above the 200-day” describes most of history rather than a rare condition.
The video record points the other way from the reader’s need. Across our study of 24,971 trading videos, 496 have moving average in the title. The median one gets 4,917 views, 76% never pass 50,000, and the median length is 9.6 minutes. The corpus carries description text for 162 of those 496, and across those 162, 8 mention invalidation, failure, or what a bad read looks like.
How this connects
The most common indicator there is, and the component inside many others. MACD, Bollinger bands, Keltner channels and most ribbons are built from one or more of them.
It is a summary of bars that have already printed, so lag is structural rather than a tuning problem.
The period is a preference. The common values are conventions, and the ones that look best on a historical chart are the ones that suited that chart.
Support and resistance is where it becomes self-fulfilling. Widely watched averages like the 50 and 200 attract orders because they are widely watched. The slower one has its own page on the 200-day moving average.
And candlesticks are the input - change the timeframe and the same average describes something entirely different.
When it fails
The market is not trending
This is the actual problem with crossovers. In a range the two averages sit on top of each other and cross constantly, and none of those crosses starts a trend; the data section above shows how many crossings of a single line are undone within days.
A moving average is a trend-following tool. It has nothing to say about a market that is not trending, and it will keep producing signals anyway.
You are using it as a prediction
The line is an average of the past. It has no forward-looking component of any kind, so a crossover is a report that something already happened. It is a description, and reading it as a forecast is the commonest mistake on the indicator.
You found the settings afterwards
Any pair of lengths can be tuned until it caught the moves on a chart you have already seen. The honest test is whether the same pair works on a chart you have not, which is the whole problem of overfitting.
Related
Market structure is the natural pair — the average tells you a trend exists, and structure tells you the price at which it stops existing.
Support and resistance is where the “moving level” idea comes from, and the fixed version is easier to trust because it does not shift under you.
And risk management is what turns a crossover into something you can act on, because on its own it does not tell you where to be wrong.
For the practical side, how to use moving averages sets out the reading step by step.
I treat the faster average as a moving support level and the slower one as my bail-out line. If price breaks below both, I’m out of the trade. One average on its own isn’t a strategy, it’s just a line. What I read is how two or three of them sit relative to each other, and I backtest the combination on the asset I’m actually trading before I trust it.
— Michael Whitman, from this video
This page is educational, not financial advice. Test every idea on your own charts before risking money. Some links on this page earn a commission if you buy through them. It costs you nothing and it does not decide what appears here or in what order — how these pages are made is set out in our methodology.