What Are Moving Averages?
Moving averages smooth out price data to reveal underlying trends by calculating the average price over a specific number of periods. They're the most widely used technical indicators and form the basis of many algorithmic trading strategies.
Types of Moving Averages
Simple Moving Average (SMA)
The arithmetic mean of prices over a period. Each price point has equal weight.
SMA = (P1 + P2 + P3 + ... + Pn) / n
Example: 10-day SMA
Sum of last 10 closing prices / 10Exponential Moving Average (EMA)
Gives more weight to recent prices, making it more responsive to new information. Widely used in indicators like MACD.
EMA = (Price × k) + (Previous EMA × (1 - k))
Where k = 2 / (n + 1)
For 10-period EMA: k = 2 / 11 = 0.1818Common Moving Average Strategies
Golden Cross / Death Cross
Perhaps the most famous moving average strategy:
Golden Cross / Death Cross Rules
- Golden Cross (Buy): 50-day MA crosses above 200-day MA
- Death Cross (Sell): 50-day MA crosses below 200-day MA
- Timeframe: Daily charts for swing/position trading
- Note: These are lagging signals—by the time they trigger, significant price movement has already occurred
Moving Average Envelope
Bands placed a fixed percentage above and below a moving average to identify overbought and oversold conditions.
Choosing the Right Period
| Period | Responsiveness | Best For |
|---|---|---|
| 5-10 | Very fast | Short-term/day trading |
| 20-50 | Medium | Swing trading |
| 100-200 | Slow | Long-term trends, support/resistance |
Limitations
- Lagging indicator: Moving averages follow price—they don't predict it
- Whipsaws: In choppy markets, frequent false signals occur
- No magic number: The "best" period varies by market and timeframe