Skip to main content

Moving Averages

Simple Moving Average (SMA), Exponential Moving Average (EMA), golden/death crosses, and practical crossover trading systems.

01

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.
Note
Moving averages are lagging indicators by nature. They are built from past prices, so they always respond to a trend after it has already begun. This is not a weakness — it is their purpose. They confirm trends rather than predict them.
02

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.

SMA = (Sum of last N closing prices) / N

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.

DayClose (Rs.)Calculation5-Day SMA (Rs.)
Mon2,410
Tue2,435
Wed2,422
Thu2,448
Fri2,460(2410 + 2435 + 2422 + 2448 + 2460) / 52,435
Next Mon2,475(2435 + 2422 + 2448 + 2460 + 2475) / 52,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:

PeriodUse CaseTypical User
20-day SMAShort-term trend — captures the last month of tradingActive swing traders
50-day SMAMedium-term trend — roughly one quarter of trading daysSwing traders, positional traders
200-day SMALong-term trend — the institutional benchmarkInvestors, fund managers
Tip
The 200-day SMA is watched by every institutional trader on Dalal Street. When NIFTY 50 trades above its 200-day SMA, the broad market is considered bullish. When it drops below, institutional desks start turning cautious. Always be aware of where the index sits relative to this line.
03

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.

Multiplier = 2 / (N + 1)
EMA = (Close - Previous EMA) x Multiplier + Previous EMA

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.

FeatureSMAEMA
WeightingAll prices weighted equallyRecent prices weighted more heavily
ResponsivenessSlower to react to new dataFaster to react to sudden moves
SmoothnessSmoother, fewer false signalsMore reactive, occasionally whipsaw-prone
Best forLong-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.

Note
You do not need to calculate EMAs manually — every charting platform does it automatically. What matters is understanding the behaviour: the EMA turns faster at trend changes, which is an advantage for swing traders who need timely signals.
04

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.

PullbackEMA Level (Rs.)Bounce Low (Rs.)Outcome
1st dip1,5181,522Bounced to Rs.1,580 within 5 sessions
2nd dip1,5581,555Bounced to Rs.1,610 within 4 sessions
3rd dip1,5921,588Bounced to Rs.1,650 within 6 sessions
Breakdown1,6201,595Closed below EMA on high volume — exit signal
Tip
When a stock in a strong uptrend dips to its 50-day EMA, check the volume on the bounce day. If volume picks up as price recovers from the EMA, the dip-buy setup is higher quality. Low-volume bounces are weaker and may fail on the next test.
05

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.

SignalWhat HappensActionReliability
Golden CrossShort MA crosses above long MABuy / go longHigh in trending markets; weak in sideways ranges
Death CrossShort MA crosses below long MASell / exit longsHigh in trending markets; weak in sideways ranges
Price above both MAsStrong uptrend confirmedHold longs, trail stoploss using shorter MAVery reliable — trend is intact
Price below both MAsStrong downtrend confirmedStay out or hold short positionsVery reliable — trend is intact
Price between the two MAsTrend is transitioning or weakWait for clarity before enteringLow — signals are unreliable in this zone
Caution
Crossovers are lagging signals by definition. By the time the 50-day crosses the 200-day, a significant portion of the move has already happened. You will never catch the exact bottom with a crossover signal. The trade-off is reliability — when a golden cross forms in a genuinely trending market, the follow-through is substantial. Do not use crossovers in sideways, range-bound markets; they will generate repeated false signals and whipsaw your capital.
Key Takeaways
  • 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.
Disclaimer

This content is for educational purposes only. swingcapital is not a SEBI-registered advisor. Consult a qualified financial advisor before making investment decisions.