Moving Averages: SMA, EMA & How to Trade Them
The most fundamental indicator in technical analysis. Here's how it actually works and how traders use it.
What Are Moving Averages?
A moving average takes the closing prices over a set number of periods, averages them, and plots the result as a line on the chart. As each new bar closes, the oldest price drops off and the newest one enters the calculation. The line "moves" forward with price, smoothing out the noise and revealing the underlying trend.
There are two types you need to know: the Simple Moving Average (SMA) and the Exponential Moving Average (EMA). Everything else (WMA, DEMA, TEMA) is a niche variation that rarely changes outcomes.
Simple Moving Average (SMA)
The SMA is exactly what it sounds like. Add up the last N closing prices, divide by N. A 50-day SMA takes the last 50 closes, sums them, and divides by 50. Every data point gets equal weight. The close from 50 days ago matters just as much as yesterday's close.
SMA = (P1 + P2 + ... + PN) / N
That equal weighting is both a strength and a weakness. Strength: the SMA is smooth and stable, filtering out short-term noise effectively. Weakness: it reacts slowly to recent price changes. A single big candle 50 days ago affects today's SMA just as much as yesterday's candle.
Exponential Moving Average (EMA)
The EMA fixes the lag problem by weighting recent prices more heavily. It uses a multiplier: 2 / (N + 1). For a 20-period EMA, that's 2 / 21 = 0.095, meaning today's price gets about 9.5% of the weight, and the rest comes from the previous EMA value.
EMA = (Close − Previous EMA) × multiplier + Previous EMA
The result: the EMA hugs price more tightly and responds faster to recent moves. When price gaps up or sells off sharply, the EMA catches up quicker than the SMA. This makes the EMA popular for shorter-term trading where speed matters.
The chart above shows AAPL with both SMA and EMA overlays. Notice how the EMA lines track price more closely, especially during sharp moves, while the SMA lines lag behind and provide a smoother perspective.
SMA vs. EMA: When to Use Each
Traders spend too much time debating SMA vs. EMA. Here's the honest answer: on daily charts, the difference rarely changes your trading decisions. A 50-day SMA and a 50-day EMA will be within a few percent of each other most of the time. The real edge comes from understanding what you're using them for.
Use SMA for long-term trend identification
The 200-day SMA is the institutional standard. Fund managers, algorithms, and financial media all reference it. When people say "the S&P is trading above its 200-day moving average," they mean the SMA. This matters because so many market participants watch it that it becomes a self-fulfilling level. Price often bounces off the 200 SMA not because of math, but because thousands of traders have orders there.
The 50-day SMA serves a similar role for intermediate trends. Together, the 50 and 200 SMAs define the "big picture" for most stocks.
Use EMA for shorter-term trading
The 20-day EMA is widely used as a dynamic support level during uptrends. Swing traders watch it closely. When a stock pulls back to the 20 EMA and bounces, it's a sign buyers are still in control. The 9-day EMA is common for aggressive short-term entries.
The EMA's faster response also makes it better for intraday trading. On a 5-minute chart, the lag of an SMA can make signals arrive too late to be useful. The EMA's weighting helps it keep up with the pace of intraday moves.
Pick a set and stick with it. The specific choice between SMA and EMA matters far less than using your moving averages consistently. Switching back and forth based on which one "would have worked better" on the last trade is curve-fitting, not trading.
On MSFT, you can see the SMA and EMA track closely during steady trends. The differences show up at inflection points: the EMA turns first, the SMA confirms later. Neither is "better." They're answering slightly different questions.
Golden Cross and Death Cross
The golden cross occurs when the 50-day moving average crosses above the 200-day moving average. The death cross is the reverse: the 50-day drops below the 200-day. Financial media treats these like prophecy. They're not.
Here's what's actually happening. The 50-day average represents roughly two months of price action. The 200-day represents roughly ten months. When the shorter average crosses above the longer one, it means recent price action has been strong enough to pull the two-month average above the ten-month average. That's a meaningful shift in momentum, but by the time it happens, the move is already well underway.
Golden and death crosses are lagging signals. They confirm a trend that already started, not predict one that's about to. By the time the 50 SMA crosses the 200 SMA, price has usually been trending for weeks or months. You're late to the party.
That said, they're useful as trend confirmation. If you're already long a stock and a golden cross forms, that's a green light to hold or add to your position. If you're watching from the sidelines and a death cross forms, it's a reason to wait before buying the dip.
Where golden and death crosses mislead: choppy, range-bound markets. When price bounces between support and resistance without trending, the 50 and 200 SMAs get close together and generate multiple fake crossovers. In 2015, SPY produced several golden and death crosses within months as it chopped sideways. Every one was a head fake. The crosses work best after extended trends when the two averages are far apart and a crossover represents a genuine shift.
See moving averages on any stock
Add SMA, EMA, and crossover alerts to your charts. Free, no limits.
Open AAPL chartMoving Average Trading Setups
Three setups that work. Each has specific entry rules, stops, and context requirements.
1. MA bounce
In an established uptrend, price pulls back to a key moving average (the 20 EMA or 50 SMA are the most watched) and bounces. The moving average acts as dynamic support because so many traders are watching the same level.
- Entry: Price touches or slightly undercuts the MA, then closes back above it on the same or next candle
- Stop: Below the moving average by a small margin (1-2 ATR or below the recent swing low)
- Confirmation: Volume picks up on the bounce candle. Weak bounces on low volume often fail
- Context: Only in trending markets. If the stock is chopping sideways, bounces off moving averages happen randomly and don't mean anything
AAPL is a textbook MA bounce stock. During its major uptrends, the 20 EMA acts as a magnet. Price pulls back, touches it, and buyers step in. The pattern works because institutional traders use these levels. When you see it work multiple times on the same stock, that's not coincidence. It's the same participants running the same playbook.
2. MA crossover entry
A shorter-period MA crossing above a longer-period MA signals upward momentum. The classic pair is the 9 EMA crossing the 21 EMA, though some traders prefer 10/20 or 8/21.
- Entry: Shorter MA crosses above longer MA. Enter on the close of the crossover candle or the next open
- Stop: Below the longer MA at the time of entry
- Exit: When the shorter MA crosses back below the longer MA, or at a predetermined target
- Warning: This generates many false signals in sideways markets. Add a trend filter: only take long crossovers when price is above the 200 SMA, short crossovers when below
The crossover isn't a standalone system. Use it as confirmation for a thesis you already have. If you see a stock breaking out of a base and the 9/21 EMA cross fires at the same time, that's two things agreeing. The crossover alone, without other context, will whipsaw you in flat markets.
3. Price-MA divergence
This is subtler but powerful. Price keeps making higher highs, but the slope of the moving average is flattening or starting to curl down. That means the average price over the last N periods isn't keeping up with the new highs. Momentum is fading even as price pushes forward.
- What to watch: The slope of the 20 or 50 period MA. Is it accelerating, flat, or decelerating?
- Signal: Price makes a new high but the MA's slope has clearly flattened compared to earlier in the trend
- Action: Tighten stops, take partial profits, or avoid adding to the position. Not necessarily a sell signal, but a caution flag
You saw this in TSLA during late 2021. Price kept grinding higher, but the 50 SMA was flattening out. The stock was running on fumes. When it finally broke, the 50 SMA was nearly horizontal, a clear sign that the average participant over the last two months wasn't making money despite the new highs.
Combining with Other Indicators
Moving averages are trend tools. They tell you direction but not timing or magnitude. Pairing them with momentum and volatility indicators fills those gaps.
MAs + RSI
The highest-probability setup: price pulls back to a key moving average and RSI hits oversold territory at the same time. Two independent signals agreeing. The MA tells you the trend is intact, RSI tells you selling pressure is exhausted. Entry on the bounce candle, stop below the MA.
The reverse works too. Price rallies into a declining 50 SMA from below while RSI pushes into overbought. That's resistance meeting exhausted buyers. High-probability short setup.
MAs + volume
A breakout above a moving average on heavy volume is far more meaningful than one on thin volume. If price reclaims the 200 SMA after trading below it for weeks, check the volume. A surge in volume on the reclaim means institutions are participating. Low volume means it's likely retail traders and the move may not hold.
MAs + MACD
MACD is itself built from moving averages (the difference between the 12 and 26 EMA), so it's naturally complementary. When MACD crosses its signal line while price is bouncing off the 50 SMA, you have a momentum shift confirmed by a trend level. That's a clean setup.
MAs + Bollinger Bands
Bollinger Bands use a moving average as their center line and add standard deviation envelopes. When price touches the lower Bollinger Band while sitting right on the 50 SMA, you're seeing a statistical extreme at a trend-significant level. These confluences don't happen often, but when they do, they tend to produce strong reactions.
Confluence is the goal. Any single indicator can fail. When two or three independent signals agree, the probability improves substantially. Moving averages define the trend; let other indicators handle timing and confirmation.
Common Mistakes
1. Too many MAs on one chart
Adding the 9, 20, 50, 100, and 200 MAs creates a rainbow of lines that paralyzes decision-making. At any given moment, price is above some MAs and below others. You end up cherry-picking whichever one confirms your bias.
Pick two or three, maximum. A common setup: 20 EMA for short-term trend, 50 SMA for intermediate, 200 SMA for long-term. That's all you need. Each one answers a different question, and there's no redundancy.
2. Using MAs in sideways markets
Moving averages are trend-following tools. In a range-bound market, they flatten out and price crosses back and forth constantly. Every cross looks like a signal. None of them follow through. This is the single most common way traders get chopped up with MAs.
Before acting on any MA signal, ask: is this stock trending? Look at the slope of the 50 and 200 SMA. If they're flat and close together, you're in a range. Put the MA playbook away and use range-trading tools (support/resistance, RSI, Bollinger Bands) instead.
3. Ignoring the timeframe
A 20 EMA on a daily chart covers roughly a month of trading. A 20 EMA on a 5-minute chart covers about 100 minutes. Same indicator, completely different meaning. Traders who backtest on daily charts then apply their settings to 15-minute charts wonder why the results don't match.
If you switch timeframes, rethink your MA periods. A 200 SMA on a daily chart (roughly one trading year) has no equivalent on a 5-minute chart unless you're plotting thousands of bars. For intraday, the VWAP (volume-weighted average price) often serves the role that the 200 SMA plays on dailies.
4. Over-optimizing period lengths
"What if I use a 47-period SMA instead of 50?" You can backtest endlessly and find that the 47 SMA produced slightly better results over the last two years. That's noise. The difference between a 47 and 50 period SMA is meaningless in real trading. The round numbers (20, 50, 100, 200) work best precisely because so many traders watch them. A perfectly optimized obscure period has no crowd behind it.
The best moving average is the one other people are watching. MAs work partly because of self-fulfilling prophecy. The 200 SMA matters because everyone knows it matters. Your custom 137 EMA doesn't have that advantage.