Technical Analysis

Moving Averages Explained: SMA, EMA, Crossovers and the 200-Day

A moving average is a mean you recompute daily. The formula also tells you when the line moves for reasons that have nothing to do with today's price.

AI-assisted, reviewed and edited by Ryza Glorioso. How we use AI

6 min read

A moving average is the mean of the last N closing prices. Recalculate it when a new close arrives. That is the whole definition. The lag, the smoothness and the supposed support all fall out of it.

The simple moving average, in full

Day Close Window sum 5-day SMA
1 48.20
2 49.10
3 48.60
4 50.40
5 51.20 48.20 + 49.10 + 48.60 + 50.40 + 51.20 = 247.50 247.50 / 5 = 49.50
6 52.00 247.50 - 48.20 + 52.00 = 251.30 251.30 / 5 = 50.26
7 51.40 251.30 - 49.10 + 51.40 = 253.60 253.60 / 5 = 50.72

A 200-day average is this sum with 200 terms in it. One close is one two-hundredth of the total, which is why a single session barely moves the line and why people describe it as stable when what they mean is that it is heavily diluted.

The construction fixes the lag. An SMA sits roughly (N - 1) / 2 bars behind price. About 24 bars for the 50-day, about 100 for the 200-day. You are reading where price has been, and the delay is an amount you can calculate.

Now the property almost nobody mentions. It comes straight out of the arithmetic. The daily change in an SMA is (new close - dropped close) / N. Today’s price is only half of it. Say a close of 54.00 leaves a five-day window while today’s close is 52.00. The average falls by (52.00 - 54.00) / 5 = 0.40 even though price rose today. The line went down because of something that happened five days ago. On a 200-day average this produces long stretches where the slope is being set by data from ten months back, which is worth knowing before you describe the slope as the trend.

The exponential moving average, in full

An EMA weights the newest close more heavily. The smoothing factor is k = 2 / (N + 1), and EMA today = (close today x k) + (EMA yesterday x (1 - k)).

For a 10-day EMA, k = 2 / 11 = 0.1818. With yesterday’s EMA at 49.00 and today’s close at 52.00:

EMA = (52.00 x 0.1818) + (49.00 x 0.8182) = 9.455 + 40.091 = 49.55

Today’s close carries 18.2% of the weight. In a 10-day SMA it would carry exactly 10%. That difference is the entire distinction between the two lines. It explains the faster turns and the extra false ones.

The EMA also never forgets. Each prior close survives inside the previous EMA with a weight that shrinks by a factor of 0.8182 per day, so a violent session from six months ago is still in the number, contributing something close to nothing. An SMA drops it completely on day N plus one. Neither behaviour is better. They fail differently, and knowing which failure you are holding is the point.

Feature SMA EMA
Weighting Every close in the window equally Geometric decay set by k
Old data Leaves the window abruptly Fades without ever leaving
Reaction to a sharp move Slower, set by the window length Faster, set by k
False turns in choppy markets Fewer More
Where you meet it 50-day and 200-day trend markers Shorter-term work, and inside MACD

The EMA is the version embedded in MACD. The momentum indicators guide takes that apart.

The standard periods are conventions

Nothing in the market makes 50 days special. A 45-day or 55-day average would describe the same trend almost identically, and the reason to use the standard numbers is that other participants are watching them, so the orders that create a reaction are placed at those values. Choose an unusual period and you give up that crowding. What you get back is a line that fits your historical sample slightly better.

Three readings come off any period. Position tells you which side of the recent mean price is on. Slope tells you whether that mean is rising or falling. Slope carries more information than the crossing does. Distance measures extension: a stock at 58.00 with a 50-day average at 50.00 is (58 - 50) / 50 = 16% above its own ten-week mean, which is a poor place to start a position regardless of what the trend is doing.

Crossovers, and the gap between the name and the performance

The golden cross is the 50-day crossing above the 200-day. The death cross is the reverse. Both are named considerably better than they perform, and the arithmetic says why: the 200-day lags by around 100 bars and the 50-day by around 24, so a cross between them reports a change that began months earlier. As a label for which regime has been in force, that is adequate. As a moment to act, it is late by construction. The move it confirms is often well advanced.

That failure is predictable from the formula, which means it is also avoidable. Count how often price has crossed the average over the past few months. Do that before you treat a crossing as information. More than three or four times and the tool is in the wrong market.

Dynamic support, sizing, and the conditions attached

In a sustained trend, price pulls back to the 20-day or 50-day repeatedly. Buyers keep appearing. Part of that is the average tracking a trend that was continuing anyway, and part is genuinely self-fulfilling, because enough traders place orders around a watched line that the orders themselves produce the reaction. I cannot separate those two effects. I have not seen a convincing attempt to.

What the idea gives you is a reference price. Take a stock at 61.40 pulling back to a rising 50-day average at 60.10. Enter at 60.60 with invalidation at 58.80, so risk per share is 60.60 - 58.80 = 1.80. On a $40,000 account risking 1%, 400 / 1.80 = 222 shares. Treat the average as a zone. Put the invalidation past its far edge, the same way the support and resistance guide handles horizontal zones.

The conditions are strict. The method applies when the average is sloping in the direction of the trade, and it stops applying the moment price is crossing back and forth. It also assumes a stop distance appropriate to the stock: a 50-day average on a name that moves 1% a day and one on a name that moves 6% a day look identical and need completely different room, which is the missing dimension that average true range supplies in the volatility indicators guide.

Gaps ignore all of it. A stock that opens 15% lower on earnings crossed its 50-day average overnight. It did so at a price that never traded.

One chart cannot tell you how much of the market is doing this. When an index is above its 200-day average while only a minority of its members are, the average is describing a narrow advance, and the market breadth tool measures that directly. The stock screener filters on price relative to the 50-day and 200-day together with RSI and relative volume, which builds the list before you open a chart.

Read the technical analysis pillar for how trend, levels and momentum fit together, the chart patterns guide for the structures that form around these lines, and try the technical analysis basics quiz.

Frequently asked questions

What is a moving average in stock trading?

It is the average closing price over a set number of recent periods, recalculated each time a new close arrives. A 50-day simple moving average is the mean of the last 50 daily closes. As the newest close enters the window the oldest one leaves it, so the line tracks price while smoothing out the day to day movement.

What is the difference between SMA and EMA?

A simple moving average weights every close in its window equally. An exponential moving average applies a smoothing factor of 2 divided by the period plus one, so recent closes count for more and older ones fade without ever fully leaving. The EMA turns sooner after a change in direction, which also means it turns on moves that do not last.

What does the 200-day moving average mean?

It is roughly the average closing price over the last ten months of trading and the most widely watched long-term marker in US equities. Price above a rising 200-day is the conventional description of an uptrend. Most of its usefulness comes from how many participants watch it, which makes it a price people act around.

What is a golden cross and does it work?

A golden cross is the 50-day average crossing above the 200-day, and the death cross is the reverse. Both are slow by construction, since a 200-day average sits around 100 bars behind price, so the cross confirms a change that started months earlier. They describe a regime reasonably well and time entries badly.

Which moving average periods should I use?

The 20-day, 50-day and 200-day cover short, intermediate and long-term trend, and they are the ones other participants are watching. Optimising the period on past data until the equity curve looks attractive is curve fitting, and the tuned number rarely survives on data the test has not seen.

Do moving averages act as support?

Sometimes, for a partly circular reason. Enough traders place orders around the 50-day and 200-day that price often reacts there, which reinforces the belief and the behaviour. In a sustained trend those reactions are frequent. In a sideways market price crosses the average constantly and the idea of support stops meaning anything.