Moving averages: SMA vs EMA
Updated 11 October 2026
A moving average is the average of a stock's recent prices, recalculated every new candle. As each candle is added, the oldest one drops out (or fades away), so the average "moves" along the chart. It smooths out day-to-day noise and shows the general direction prices have taken.
The two types you will see most are the simple moving average (SMA) and the exponential moving average (EMA).
Simple moving average (SMA)
SMA = sum of the last N closing prices ÷ N
Every close in the window gets equal weight. When a new close arrives, the oldest one leaves.
Exponential moving average (EMA)
New EMA = previous EMA + k × (today's close − previous EMA)
where k = 2 ÷ (N + 1). For a 5-period EMA, k = 2 ÷ 6 = 1/3. For a 20-period EMA, k = 2 ÷ 21 ≈ 0.095.
The EMA gives the latest close the most weight, and older closes count for less and less. It is usually started (seeded) with the SMA of the first N closes.
Worked example: 5-day SMA vs EMA
Stock XYZ closes over seven days (made-up prices):
| Day | Close | 5-day SMA | 5-day EMA |
|---|---|---|---|
| 1 | ₹100 | – | – |
| 2 | ₹102 | – | – |
| 3 | ₹104 | – | – |
| 4 | ₹103 | – | – |
| 5 | ₹106 | ₹103.00 | ₹103.00 |
| 6 | ₹112 | ₹105.40 | ₹106.00 |
| 7 | ₹109 | ₹106.80 | ₹107.00 |
Day 5
SMA = (100 + 102 + 104 + 103 + 106) ÷ 5 = 515 ÷ 5 = ₹103. The EMA is seeded with this value, so EMA = ₹103.
Day 6
- SMA: drop ₹100, add ₹112. (102 + 104 + 103 + 106 + 112) ÷ 5 = 527 ÷ 5 = ₹105.40
- EMA: 103 + (1/3) × (112 − 103) = 103 + 3 = ₹106.00
Day 7
- SMA: drop ₹102, add ₹109. (104 + 103 + 106 + 112 + 109) ÷ 5 = 534 ÷ 5 = ₹106.80
- EMA: 106 + (1/3) × (109 − 106) = 106 + 1 = ₹107.00
The jump to ₹112 on day 6 lifted the EMA by ₹3 but the SMA by only ₹2.40. That is the key difference: the EMA reacts faster to new prices, and the SMA is steadier.
Common periods and how they are read
- 20-period: often used for short-term direction. It is also the middle line of Bollinger Bands.
- 50-period: a medium-term view.
- 200-day: a long-term view, widely followed on daily charts of stocks and indices.
Common ways people describe moving averages:
- Price above or below the average. Price above its 200-day average means it is higher than its average of the past 200 sessions. That is a description of where it has been.
- Slope. A rising average shows recent prices are higher than the ones dropping out.
- Crossovers. When a shorter average crosses a longer one, people call it a crossover; the 50/200-day version is nicknamed the "golden cross" (upward) or "death cross" (downward). These names sound dramatic but only mean one average passed another.
MACD is built directly from two EMAs, and Supertrend uses a smoothed average of range, so understanding moving averages helps with both.
SMA or EMA: which to use?
Neither is better in general. An EMA tracks price more closely, so it turns earlier but also gives more false turns in choppy markets. An SMA is smoother but slower. Picking one is a trade-off between speed and noise, not a route to better results.
Limits you should know
- They lag by design. An average of past prices always trails the current price.
- Sideways markets. Price crosses back and forth over the average, and crossovers flip often.
- Period choice is arbitrary. 20, 50 and 200 are habits, not discoveries.
- Different data, different values. Seeding, adjusted prices after splits or bonuses, and candle timing all change the numbers a little.
The risk side
Moving-average crossovers are among the most widely shared trading rules, and they do not change the base rate: SEBI's studies (SEBI study, 2023 and 2025) found about 9 in 10 individual F&O traders lost money in FY22 and FY25. Plan your exit and use a position size calculator before you trade.
Questions people ask
- What is the difference between SMA and EMA?
- An SMA gives equal weight to every close in its window. An EMA gives more weight to recent closes, so it reacts faster to new prices.
- How is the EMA multiplier calculated?
- The multiplier is 2 divided by the period plus 1. For a 20-period EMA that is 2 divided by 21, about 0.095.
- What is a golden cross?
- It is the name for a shorter moving average, usually the 50-day, crossing above a longer one, usually the 200-day. It describes past prices and does not predict a rise.
- Which moving average period is best?
- No period is best. Shorter periods follow price closely and flip often; longer ones are smoother but slower to change.