TradingMarble
Indicators

Moving averages explained: SMA vs EMA, crossovers and the 20/50/200

10 min read

What is a moving average?

A moving average is the average closing price of the last N candles, recalculated on every new candle so the line "moves" with the chart. It smooths out the noise of individual candles and shows the direction and speed of the trend in a single line.

On a 5-minute NIFTY chart, a 20-period moving average is the average close of the last 20 five-minute candles, roughly the last 100 minutes of trading. On a daily chart, the same 20-period average covers about one trading month.

Moving averages are the oldest and most widely used trend tool. Because so many traders watch the same few lengths, price often reacts around them simply because orders cluster there.

SMA(N) = (C₁ + C₂ + … + CN) / N
k = 2 / (N + 1)
EMA today = k × close + (1 − k) × EMA yesterday

SMA vs EMA: the two main types

Simple moving average (SMA)

The SMA adds the last N closes and divides by N. Every candle in the window has equal weight. When a big candle leaves the window N candles later, the SMA can jump even if nothing happened today, which is called the drop-off effect.

Exponential moving average (EMA)

The EMA gives more weight to recent closes. The smoothing factor k = 2 / (N + 1), so a 20 EMA uses k ≈ 0.095: each new candle moves the line about 9.5% of the way toward the latest close. Older candles never fully leave; their influence just decays.

Which one turns faster?

For the same length, the EMA reacts faster and the SMA is smoother. That is the whole SMA vs EMA trade-off: speed against stability. Intraday traders usually prefer EMAs because sessions are short; positional traders often use SMAs on daily charts, especially the 50 and 200 SMA.

SMAEMA
WeightingEqualRecent candles weigh more
Reaction speedSlowerFaster
False crossovers in rangesFewerMore
Typical useDaily trend, 50/200Intraday, 9/20/21

Other variants exist (WMA, Hull, SMMA used in Wilder's tools), but SMA and EMA cover almost everything a beginner needs.

The 20, 50 and 200 moving averages

These three lengths matter mostly because everyone uses them. They act as common reference points for the short, medium and long trend.

  • 20 (or 21) EMA: the short-term trend. In a clean trend, pullbacks often pause near it. Price repeatedly closing on the wrong side of it is an early sign the move is tiring.
  • 50 MA: the medium trend. On daily charts, institutions and funds watch the 50 DMA for NIFTY and large stocks.
  • 200 MA: the long-term trend line. Price above a rising 200 DMA is broadly considered a bull phase; below a falling one, a bear phase. The 200 EMA on a 5-minute chart is also popular intraday as a "bigger picture" filter.

Stacking

When the 20 is above the 50 and the 50 is above the 200, with all three rising, the averages are "stacked" bullishly. The mirror order shows a strong downtrend. When the three are tangled and flat, the market is usually ranging and moving-average tools work poorly.

Moving average crossover: how it works

A moving average crossover happens when a faster average crosses a slower one. It shows that recent prices have moved above (or below) the older average, meaning momentum has shifted.

50 MA (slow)20 MA (fast)20 crosses above 50momentum has turned upIllustration
Watch the faster 20 MA (saffron) cross above the slower 50 MA (blue) once the fall turns into a rise.

Common pairs

  • 9 / 21 EMA: a popular intraday pair on 3-minute to 15-minute charts.
  • 20 / 50: swing trading on hourly and daily charts.
  • 50 / 200: the golden cross (50 crosses above 200) and death cross (50 crosses below 200) on the daily chart.

The honest catch: lag

A crossover is built from two averages of past prices, so it always arrives after the move has started. In a strong trend that is fine, as the trend carries on. In a sideways market, the two lines weave around each other and produce one false crossover after another. Most of the losses from a 9 21 EMA strategy come from range days, not from trend days.

Filtering crossovers

  • Take crossovers only in the direction of a higher-timeframe average (for example, only bullish crosses while price is above the 200 EMA). See multi-timeframe analysis.
  • Ignore crossovers when both averages are flat.
  • Check trend strength with ADX: crossovers tend to work better when ADX is rising above about 20 to 25.
  • Prefer crossovers that happen near a meaningful level, not in the middle of nowhere.

Moving averages as dynamic support and resistance

In a trending market, price often pulls back to a rising average, pauses, and continues. Traders call this dynamic support. In a downtrend, a falling average often caps rallies as dynamic resistance.

How to read a pullback to the average

  1. Confirm the trend: the average is sloping clearly, and price has stayed mostly on one side of it.
  2. Watch the first touch after a strong move. First and second pullbacks tend to hold more often than the fifth.
  3. Look at the candle and the order flow at the touch. A rejection wick with sellers absorbed is more meaningful than price simply drifting through. See candlestick patterns and footprint order flow.
  4. If price closes decisively through the average and the average flattens, the pullback has become something more.
An average is a zone, not an exact price. On NIFTY, a pullback that holds 5 to 10 points beyond the 20 EMA is still a hold.

Best moving average for intraday trading

There is no single best moving average for intraday; the right one depends on how fast you trade and which timeframe you read. A practical starting set for NIFTY and BANKNIFTY:

  • Scalping on 1 to 3 minute charts: 9 and 21 EMA for short-term momentum.
  • Intraday on 5 to 15 minute charts: 20 EMA as the trend guide, 50 EMA for structure.
  • Session context: VWAP, which resets every morning and is weighted by volume.

The overnight gap problem

A 20 EMA on a 5-minute chart at 9:20 IST is still made almost entirely of yesterday's candles. After a 150-point gap, the average sits far from price and says little about today. This is why many intraday traders lean on VWAP early in the session and let the EMAs catch up after the first hour.

Keep it simple

Two averages are usually enough. Five averages on one chart rarely add information; they just give you more lines to argue with.

Combining moving averages with other tools

  • With structure: an average that lines up with a break of structure retest or an order block is a stronger area than either alone.
  • With momentum: RSI holding above 40 to 50 on pullbacks to a rising average supports the trend reading. MACD is itself built from EMAs (12 and 26), so it adds less than you think.
  • With volatility: the middle line of Bollinger Bands is a 20 SMA, and Keltner channels are built around an EMA.
  • With order flow: a touch of the 20 EMA where the footprint shows buyers absorbing selling tells you who is defending the line.

Worked example: NIFTY 20 EMA pullback (illustration)

The numbers below are an illustration, not a record of a real session.

NIFTY futures open at 24,180 and trend up through the morning. By 11:00 IST price is at 24,320, the 20 EMA on the 5-minute chart is rising at 24,285 and the 50 EMA is at 24,240. The averages are stacked bullishly.

Around 11:30, price pulls back to 24,290. The candle at the average has a long lower wick, closing at 24,302. RSI on the same chart dips to 46 and turns up. The footprint at the lows shows selling being absorbed rather than accelerating.

A trader studying this might treat 24,270 (below the wick and the average) as the line where the trend reading fails. If price later closes below the 50 EMA at 24,240 and the 20 EMA turns flat, the reading has changed and the trader steps aside. The averages did not predict anything; they gave a framework for where the trend is and where it is wrong.

Common moving average mistakes

  • Using crossovers in ranges: flat averages produce whipsaws. Check the slope first.
  • Optimising the length: changing from 20 to 17 because it "fit better" last month is curve-fitting. Standard lengths work because others use them.
  • Treating the line as exact: averages are zones.
  • Ignoring the gap: intraday averages mix two sessions after a gap.
  • Stacking indicators that say the same thing: EMA, MACD and a crossover are all one input.
  • No risk plan: an average tells you trend, not position size. Read risk management and position sizing. Trading F&O carries a high risk of loss.

Seeing it on the TradingMarble chart

The TradingMarble chart lets you add SMA and EMA lines of any length to NIFTY, BANKNIFTY and F&O charts alongside VWAP and the footprint. You can watch how price and order flow behave at each touch of the average and compare timeframes side by side. The list of tools is on the features page.

Moving average checklist

  1. Is the average sloping, or flat?
  2. Which side of the 200 (or higher-timeframe average) is price on?
  3. Is this the first or second pullback, or the fifth?
  4. Does the touch line up with a level or structure?
  5. What does the candle and the footprint show at the touch?
  6. Where is the trend reading wrong, and how much is at risk there?

Used this way, the moving average becomes a clear map of trend rather than a source of signals, which is where it is most useful.

Frequently asked questions

What is a moving average in trading?

A moving average is the average closing price of the last N candles, recalculated each candle so it forms a line on the chart. It smooths short-term noise and shows trend direction. The simple moving average weights all candles equally; the exponential moving average weights recent candles more, so it reacts faster.

Which is better, SMA or EMA?

Neither is better in every case. The EMA turns faster, which suits intraday trading on NIFTY and BANKNIFTY, but it also gives more false crossovers in ranges. The SMA is smoother and is the standard for long daily averages like the 50 and 200 DMA. Many traders use EMAs intraday and SMAs on daily charts.

What is the best moving average for intraday?

Common choices are the 9 and 21 EMA on 1 to 5 minute charts and the 20 EMA on 5 to 15 minute charts, with VWAP for session context. No length is best in every market. Pick one or two standard lengths, use them consistently, and judge them by whether the market is trending or ranging.

What is a golden cross and death cross?

A golden cross is when the 50-day moving average crosses above the 200-day moving average; a death cross is when it crosses below. They mark a shift in the longer-term trend. Because both averages are slow, the cross usually appears well after the turn, so traders treat it as confirmation rather than an early warning.

Why do moving average crossovers fail?

Crossovers fail mostly in sideways markets, where flat averages weave around each other and cross repeatedly without any trend following. They also lag because they are built from past prices. Filtering crossovers by the slope of the averages, a higher-timeframe trend and trend strength (such as ADX) reduces whipsaws.

How is the EMA calculated?

First compute k = 2 / (N + 1). Then EMA today = k × today's close + (1 − k) × yesterday's EMA. The first EMA value is usually seeded with an SMA of the first N closes. For a 20 EMA, k is about 0.095, so each new close moves the line roughly 9.5% of the way toward price.