Moving Averages (SMA & EMA)
For educational purposes only. Not financial advice. Higher returns come with higher risk. Never risk more than you can afford to lose.
For educational purposes only. Not financial advice. Higher returns come with higher risk. Never risk more than you can afford to lose.
Moving averages are the foundation of technical analysis. They smooth out price data by creating a constantly updated average price over a specific number of periods, filtering out the noise of random short-term fluctuations to reveal the underlying trend. Nearly every trading system uses some form of moving average, whether as a standalone indicator or as a building block inside more complex tools like MACD or Bollinger Bands.
There are two primary types. The Simple Moving Average (SMA) calculates the arithmetic mean of prices over N periods, giving equal weight to every data point in the window. The Exponential Moving Average (EMA) applies a multiplier that gives more weight to the most recent prices, making it more responsive to new information. Choosing between them depends on whether you value smoothness (SMA) or responsiveness (EMA).
The SMA is calculated by summing the closing prices over N periods and dividing by N. For example, a 20-period SMA on a daily chart adds up the last 20 closing prices and divides by 20. Each new day, the oldest price drops off and the newest is added, causing the average to shift gradually. This simplicity makes the SMA easy to understand and widely trusted for identifying support and resistance levels.
The EMA uses a smoothing factor of 2 / (N + 1) applied to the difference between the current price and the previous EMA value. A 20-period EMA uses a multiplier of approximately 0.095, meaning roughly 9.5% weight goes to the latest price. This compounding effect ensures the EMA reacts faster to sudden price changes while still providing a smoothed view of the trend. The EMA never fully drops old data points but their influence decays exponentially over time.
Other variants exist as well. The Weighted Moving Average (WMA) assigns linearly increasing weights to each period. The Hull Moving Average (HMA) uses a combination of WMAs to reduce lag while maintaining smoothness. The Volume Weighted Moving Average (VWMA) incorporates volume into the weighting. However, the SMA and EMA remain the most widely used and are sufficient for the vast majority of trading applications.
The most basic reading is directional. When a moving average slopes upward, the trend is bullish. When it slopes downward, the trend is bearish. A flat moving average indicates consolidation or indecision. The steepness of the slope can indicate the strength of the trend: a sharply rising 50 EMA suggests strong bullish momentum, while a gently rising one indicates a more measured advance.
Price position relative to the moving average is equally important. When price trades above a key moving average, bulls are in control. When it trades below, bears dominate. Many institutional algorithms use the 200-day SMA as a line in the sand: portfolios may increase equity exposure when the index is above this level and reduce it when below. This creates a self-fulfilling dynamic around major moving averages.
The spacing between multiple moving averages reveals trend health. In a healthy uptrend, the short-term MA sits above the medium-term, which sits above the long-term, and all are fanning apart. When they begin converging or tangling, the trend is losing momentum. When they invert (long-term above short-term), the trend has likely reversed.
The crossover is the most well-known moving average signal. A bullish crossover occurs when a shorter-period MA crosses above a longer-period MA, suggesting upward momentum is building. A bearish crossover is the opposite. The most famous crossovers have their own names: the Golden Cross (50-day SMA crossing above the 200-day SMA) and the Death Cross (50-day crossing below the 200-day). While these are lagging signals by nature, they carry significant weight because of how many market participants watch them.
Moving average bounces provide lower-risk entries in trending markets. During an uptrend, price frequently pulls back to key moving averages before resuming higher. The 20 EMA serves as dynamic support in strong trends, the 50 EMA in moderate trends, and the 200 SMA in long-term trends. Traders look for price to touch or slightly undercut the MA and then produce a bullish reversal candle with increasing volume as confirmation of the bounce.
The ribbon strategy uses multiple moving averages (for example, 10, 20, 30, 40, and 50 EMAs) plotted simultaneously. When all ribbons are aligned and expanding, the trend is strong. When they compress or twist, a trend change is likely. This gives a visual representation of momentum that is easy to read at a glance. Some traders use exponential ribbons with periods like 8, 13, 21, 34, and 55 based on Fibonacci numbers.
While moving averages themselves do not produce traditional divergence signals like oscillators do, the relationship between price and a moving average can reveal hidden information. If price makes a new high but the distance between price and the 50 EMA is shrinking compared to the previous high, momentum is fading despite new highs. This is a form of implicit divergence that often precedes pullbacks or reversals.
Another form of divergence occurs between different moving averages. If the 20 EMA is rising but the 50 EMA is flattening, the short-term momentum is not being confirmed by intermediate-term momentum. This kind of disagreement between timeframes frequently leads to failed breakouts or whipsaw action and is a warning sign for trend followers.
Moving averages pair exceptionally well with volume indicators. A price bounce off the 50 EMA accompanied by a surge in OBV (On-Balance Volume) is far more reliable than a bounce on declining volume. Adding RSI as a momentum filter helps avoid taking MA bounce trades when the market is already overbought. For example, only take long entries on a 20 EMA bounce when RSI is between 40 and 60, indicating the pullback has room to run.
Bollinger Bands use a moving average as their centerline, so combining MAs with Bollinger Bands is natural. The middle Bollinger Band is typically a 20 SMA, while traders might use the 50 EMA for trend direction. When the 50 EMA is rising and price bounces off the lower Bollinger Band near the 50 EMA level, this confluence creates a high-probability entry. MACD, being derived from moving averages itself, can confirm crossover signals: a golden cross paired with a bullish MACD crossover carries more weight than either signal alone.
Consider SPY in a confirmed uptrend with the 20 EMA above the 50 EMA, both sloping upward. After a three-day pullback, price reaches the 20 EMA near $540 and forms a bullish engulfing candle on above-average volume. RSI reads 48, confirming the pullback has relieved overbought conditions. A trader enters long at $541, sets a stop loss at $535 (just below the 50 EMA), and targets $555 where previous resistance sits.
The trade risks $6 per share to make $14, a reward-to-risk ratio of 2.3:1. Over the next five sessions, price bounces off the 20 EMA and rallies to $558. The trader trails the stop using the 20 EMA as a dynamic level, locking in profits as the trend continues. This type of moving average bounce trade is one of the most reliable setups in trending markets.
In a different scenario, a Death Cross forms on the daily chart as the 50-day SMA crosses below the 200-day SMA. A swing trader who uses this as a regime filter switches from buying dips to selling rallies or simply moves to cash. While the Death Cross itself is not a precise timing tool, it redefines the context in which other signals are interpreted.
The biggest mistake is using moving averages in choppy, range-bound markets. When price oscillates around a flat MA, crossover signals fire constantly, each one resulting in a small loss as price reverses shortly after. This whipsaw effect can slowly drain an account. The solution is to pair moving average systems with a trend-strength filter like ADX. Only trade MA signals when ADX confirms a trend is present (above 25).
Another common error is over-optimizing the period. Traders backtest dozens of MA lengths to find the one that performed best historically, then discover it fails going forward. Standard periods (20, 50, 100, 200) work well precisely because so many traders watch them, creating self-fulfilling prophecy effects. Sticking with widely followed periods tends to outperform exotic custom settings in live trading.
For day trading, the 9 EMA and 21 EMA on 5-minute or 15-minute charts are popular for identifying short-term momentum. The VWAP often serves as an anchor alongside these. For swing trading, the 20 EMA (roughly one month of trading days) and 50 EMA (one quarter) on the daily chart are the workhorses. For position trading and investing, the 100 SMA and 200 SMA on the daily or weekly chart define the major trend.
The choice between SMA and EMA depends on your style. Scalpers and day traders generally prefer EMAs for their faster reaction time. Swing traders may use a mix: an EMA for entries (faster signal) and an SMA for stop placement (more stable level). Position traders and investors typically prefer SMAs because the slower response filters out more noise and reduces unnecessary trades.
Moving averages are inherently lagging indicators. They are calculated from past prices and will always confirm a trend after it has already begun. This lag means they cannot predict reversals in advance and will always give back some profits at trend ends. The longer the period, the greater the lag. A 200-day SMA might not signal a bear market until the index has already fallen 10-15% from its peak.
Moving averages also struggle during sideways markets, gap events, and flash crashes. A sudden gap through a key MA level can trigger stops and signals simultaneously, creating chaotic price action around these levels. In highly volatile environments, even the most reliable MA bounce setups can fail as price slices through support levels without pausing. Traders should always use stops and position sizing to account for these failure scenarios.