What is a moving average?
A moving average (MA) is the average closing price of a stock over a fixed number of recent periods, recalculated as each new period closes. Because old prices drop out as new ones arrive, the line moves along with the price and smooths out day to day noise.
On a daily chart, a 50 day MA averages the last 50 closes. A rising line suggests the average price is climbing. A falling line suggests the opposite. The idea is covered in standard references such as John Murphy's Technical Analysis of the Financial Markets (1999).
How do you calculate an SMA?
An SMA adds up the closing prices over the period and divides by the number of periods. Every day counts equally.
Worked example with five closes: $100, $102, $101, $103, $104.
SMA(5) = (100 + 102 + 101 + 103 + 104) ÷ 5 = 510 ÷ 5 = $102.
Next day the close is $106. The $100 drops out and the new window is 102, 101, 103, 104, 106. SMA(5) = 516 ÷ 5 = $103.20.
How do you calculate an EMA?
An EMA gives more weight to recent prices, so it reacts faster than an SMA of the same length. The formula is: EMA today = (close today × multiplier) + (EMA yesterday × (1 minus multiplier)), where multiplier = 2 ÷ (periods + 1).
For a 5 period EMA the multiplier is 2 ÷ 6 = 0.3333. Suppose yesterday's EMA was $102 and today's close is $106.
EMA = (106 × 0.3333) + (102 × 0.6667) = 35.33 + 68.00 = $103.33.
The SMA in the same case was $103.20, so the EMA moved slightly more toward the new price. Most charting tools start the EMA with an SMA, so small differences between platforms are normal.
SMA or EMA: which should you use?
Neither is better in general. An EMA reacts sooner but gives more false alarms. An SMA is smoother and slower.
| Feature | SMA | EMA |
|---|---|---|
| Weighting | Equal | Recent prices count more |
| Speed | Slower | Faster |
| Noise | Fewer false turns | More false turns |
| Common use | Long term lines such as the 200 day | Shorter lines such as the 12 or 20 day |
What matters more than the type is using the same settings consistently and understanding what the line can and cannot tell you.
What do the 20, 50 and 200 day averages mean?
The number is simply how many periods are averaged, so a bigger number means a smoother, slower line. On daily charts, 20 days is roughly one trading month, 50 days is roughly two and a half months, and 200 days is roughly ten months.
Price above a rising 200 day line is often used as a quick description of a long term uptrend. Price below a falling one describes a downtrend. These are labels for what has happened, not promises about what comes next. The settings are conventions, not laws of nature.
What are a golden cross and a death cross?
A golden cross is when the 50 day average moves above the 200 day average. A death cross is when the 50 day moves below the 200 day. Both are named chart events that mark a shift in the recent trend relative to the long trend.
Because both lines are built from past prices, the cross always arrives after the move that caused it. For a deeper look, see Golden Cross vs Death Cross.
Why do moving averages lag?
Moving averages lag because every point is built from past prices. A 200 day average includes prices from almost ten months ago, so it turns slowly after a trend changes.
Worked example: a stock trades at $100 for 200 days, then jumps to $120 and stays there. After 10 days at $120, the SMA(200) is (190 × 100 + 10 × 120) ÷ 200 = 20,200 ÷ 200 = $101. Price has risen 20%, but the average has moved only 1%. A shorter average catches up faster, but also gets fooled more often.
How do moving averages act as support and resistance?
Many traders watch round settings like the 50 and 200 day lines, so price sometimes pauses near them. This is a tendency, not a rule, and it is partly self-fulfilling because many people look at the same lines.
Treat a moving average as a rough zone, not an exact price. Price often slices through it, and a bounce on one occasion does not mean it will bounce the next. For related ideas, see Support and Resistance Levels.
Where do moving averages fail?
Moving averages fail most often in sideways markets, where price crosses the line again and again. Each cross looks like a signal, but the trend never develops, a pattern traders call a whipsaw.
Other limits to keep in mind:
- Lag. A crossover often arrives after much of the move is over.
- Setting choice. Change 50 to 40 and the crossover dates change. With enough settings to try, some always look good in hindsight.
- Thin stocks. Low volume stocks produce jumpy averages.
- No view of value. An average of past prices says nothing about what a business is worth or what its earnings will be.
- Past results. Any rule that looked good on old charts has not been shown to work going forward. Be cautious about claims of high accuracy for a simple crossover.
Cluenex tested chart patterns for its own research and found no reliable directional edge in them, which is why it treats them as context rather than as buy or sell signals. Test any rule on data it was not built on before trusting it. See Backtesting a Seasonal Trade for why popular setups often fade.
What this means for you
If you have a regular job and a brokerage account, use moving averages as a quick description of trend, not as an alarm to trade on.
- Look at a daily chart with the 50 and 200 day lines to see whether a stock has been trending up, down or nowhere.
- Check what the business is doing (earnings, debt, competition) before letting a chart line influence a decision.
- Do not trade every crossover. Frequent trading adds costs and taxes, and many crossovers reverse.
- If you test a rule, write it down in advance, include trading costs, and compare it with simply holding.
- Pair a trend line with a risk plan, such as a maximum amount you are willing to lose on one position.
Cluenex shows common technical indicators, including moving averages, on its charts. It treats them as context beside a stock's business quality and fair value, which you can see on any public stock page at cluenex.com/stocks/.