Moving Averages
Simple Moving Average (SMA), Exponential Moving Average (EMA), golden/death crosses, and practical crossover trading systems.
What Is a Moving Average?
A moving average (MA) is a smoothed line plotted on a price chart that averages closing prices over a fixed number of periods. If you choose a 20-day moving average, each point on the line represents the average closing price of the last 20 trading sessions.
Why smooth the data? Because raw price action is noisy. On any given day, RELIANCE might close up Rs.15 due to a single block deal, only to drop Rs.20 the next day on broader market weakness. These daily fluctuations make it hard to see the underlying trend. A moving average strips away that noise and reveals whether the stock is genuinely trending up, down, or sideways.
- Trend identification: When price is above the MA, the trend is broadly bullish. When below, bearish.
- Dynamic support/resistance: MAs often act as levels where price bounces during trending markets.
- Signal generation: MA crossovers can trigger buy and sell signals.
Simple Moving Average (SMA)
The SMA is the most straightforward type. It takes the last N closing prices, adds them up, and divides by N. Every data point in the window carries equal weight.
Let us calculate the 5-day SMA for RELIANCE using five consecutive closing prices. This is exactly the arithmetic you would do on a calculator.
| Day | Close (Rs.) | Calculation | 5-Day SMA (Rs.) |
|---|---|---|---|
| Mon | 2,410 | — | — |
| Tue | 2,435 | — | — |
| Wed | 2,422 | — | — |
| Thu | 2,448 | — | — |
| Fri | 2,460 | (2410 + 2435 + 2422 + 2448 + 2460) / 5 | 2,435 |
| Next Mon | 2,475 | (2435 + 2422 + 2448 + 2460 + 2475) / 5 | 2,448 |
Notice how the SMA window "moves" forward each day — the oldest price drops off and the newest price is added. This is why it is called a moving average.
Common SMA periods used by Indian swing traders:
| Period | Use Case | Typical User |
|---|---|---|
| 20-day SMA | Short-term trend — captures the last month of trading | Active swing traders |
| 50-day SMA | Medium-term trend — roughly one quarter of trading days | Swing traders, positional traders |
| 200-day SMA | Long-term trend — the institutional benchmark | Investors, fund managers |
Exponential Moving Average (EMA)
The EMA solves a key limitation of the SMA: in the SMA, the closing price from 20 days ago carries the same weight as yesterday's close. For active traders, recent prices matter more. The EMA addresses this by applying a multiplier that gives progressively more weight to the most recent data points.
For a 20-day EMA, the multiplier is 2 / (20 + 1) = 0.0952. This means the latest closing price contributes roughly 9.5% to the new EMA value, while the previous EMA (which already contains weighted history) contributes the remaining 90.5%. The result is a line that hugs price more tightly and reacts to changes faster than the SMA.
| Feature | SMA | EMA |
|---|---|---|
| Weighting | All prices weighted equally | Recent prices weighted more heavily |
| Responsiveness | Slower to react to new data | Faster to react to sudden moves |
| Smoothness | Smoother, fewer false signals | More reactive, occasionally whipsaw-prone |
| Best for | Long-term trend analysis (50, 200) | Short-term swing trading (9, 13, 21) |
When should you use which? If you are analysing the long-term trend of HDFCBANK over several months, the 200-day SMA gives a clean, stable reference line. But if you are looking for a short-term swing entry on BAJFINANCE, the 21-day EMA will react faster to the recent price surge and give you a more relevant dynamic support level.
Practical Application
The simplest and most reliable way to use a moving average is as a trend filter and dynamic support/resistance. The rules are straightforward:
- Price above MA = Bullish. The stock is in an uptrend. Look for buying opportunities on dips toward the MA.
- Price below MA = Bearish. The stock is in a downtrend. Avoid fresh longs and consider shorting rallies toward the MA.
- Price oscillating around MA = Sideways. The stock lacks a clear trend. MA-based strategies will produce whipsaws here — wait for a decisive break.
Real Example: INFY and the 50-Day EMA
During a sustained rally in INFY, the stock stayed above its 50-day EMA for over three months. Each time it pulled back to the EMA line — around Rs.1,520, then Rs.1,560, then Rs.1,590 as the EMA rose — buyers stepped in and pushed it higher. The 50-day EMA acted as a moving floor beneath the stock.
A disciplined swing trader would have used each dip to the 50-day EMA as a buying opportunity, placing a stoploss just below the EMA level. If the close ever broke below the 50-day EMA on above-average volume, that would be the signal to exit the position and reassess.
| Pullback | EMA Level (Rs.) | Bounce Low (Rs.) | Outcome |
|---|---|---|---|
| 1st dip | 1,518 | 1,522 | Bounced to Rs.1,580 within 5 sessions |
| 2nd dip | 1,558 | 1,555 | Bounced to Rs.1,610 within 4 sessions |
| 3rd dip | 1,592 | 1,588 | Bounced to Rs.1,650 within 6 sessions |
| Breakdown | 1,620 | 1,595 | Closed below EMA on high volume — exit signal |
Moving Average Crossover System
A crossover occurs when two moving averages of different periods cross each other. This generates clear, mechanical signals that remove subjectivity from your trading decisions.
Golden Cross (Bullish)
The shorter-period MA crosses above the longer-period MA. This signals that recent price momentum has turned positive and a new uptrend may be developing. The most widely tracked crossover is the 50-day MA crossing above the 200-day MA.
Death Cross (Bearish)
The shorter-period MA crosses below the longer-period MA. This signals that recent momentum has turned negative and a downtrend may be starting. Institutional traders often reduce exposure when the 50-day drops below the 200-day.
Real Example: HDFCBANK Golden Cross
In early 2023, HDFCBANK had spent several months in a sideways-to-down drift after the merger announcement uncertainty. The 50-day EMA was running well below the 200-day EMA. As the stock stabilised and started recovering, the 50-day EMA gradually climbed and eventually crossed above the 200-day EMA near the Rs.1,620 level. Traders who entered on this golden cross with a stoploss below Rs.1,560 captured a move toward Rs.1,750 over the following weeks.
| Signal | What Happens | Action | Reliability |
|---|---|---|---|
| Golden Cross | Short MA crosses above long MA | Buy / go long | High in trending markets; weak in sideways ranges |
| Death Cross | Short MA crosses below long MA | Sell / exit longs | High in trending markets; weak in sideways ranges |
| Price above both MAs | Strong uptrend confirmed | Hold longs, trail stoploss using shorter MA | Very reliable — trend is intact |
| Price below both MAs | Strong downtrend confirmed | Stay out or hold short positions | Very reliable — trend is intact |
| Price between the two MAs | Trend is transitioning or weak | Wait for clarity before entering | Low — signals are unreliable in this zone |
- A moving average smooths price data over N periods and reveals the underlying trend direction.
- SMA treats all prices equally and is best for long-term analysis. EMA weighs recent prices more and reacts faster to changes.
- Price above the MA is bullish; price below is bearish. The MA itself acts as dynamic support or resistance.
- Common periods: 20-day for short-term, 50-day for medium-term, 200-day for the long-term institutional benchmark.
- Golden Cross (short MA above long MA) is a buy signal. Death Cross (short MA below long MA) is a sell signal.
- Crossovers lag — they confirm trends rather than predict them. Avoid using them in sideways markets where they produce whipsaws.
This content is for educational purposes only. swingcapital is not a SEBI-registered advisor. Consult a qualified financial advisor before making investment decisions.