Moving Averages Explained: SMA vs EMA and Crossovers

A moving average smooths out the noise so you can see the trend. Here is how SMA and EMA differ, which lengths people use and why, and what crossovers can and cannot tell you.

By StockYatra Team
StockYatra cover reading SMA vs EMA and Crossovers, with two smooth lines crossing over candles

Prices zigzag. A moving average smooths those zigzags into one line, so you can see which way the market is leaning without staring at every candle. It is the most common line on any chart and the building block of other indicators like MACD. This guide explains the two main types, simple and exponential, how to choose a length, and what "crossovers" really tell you.

In short

  • A moving average is the average closing price over the last N candles, recalculated with each new candle.
  • SMA weights every candle equally; EMA gives more weight to recent candles, so it reacts faster.
  • Short averages (around 9 to 20) follow price closely; long ones (50, 100, 200) show the bigger trend.
  • A crossover is when a short average crosses a long one. It confirms a change late, and fails often in sideways markets.
  • Use the slope of the average and where price sits relative to it, not just crossovers.

What a moving average is

Take the closing prices of the last 20 daily candles, add them up and divide by 20. That is today's 20-day average. Tomorrow, drop the oldest close, add the newest, and calculate again. Plot those values and you get a line that "moves" along with price. Because it averages many candles, one wild day barely shifts it. That is the whole point: less noise, clearer direction.

Example with round numbers: if the last five closes were Rs 100, 102, 104, 103 and 106, the 5-period average is 515 ÷ 5 = Rs 103. If the next close is 110, the oldest value (100) drops out and the new average is (102 + 104 + 103 + 106 + 110) ÷ 5 = Rs 105.

SMA vs EMA: the difference

The simple moving average (SMA) is exactly what you just saw: every candle in the window counts the same. The exponential moving average (EMA) uses a formula that gives the newest candles more weight and older ones progressively less. In practice that means:

  • EMA reacts faster. When price turns, the EMA bends sooner. Good for spotting changes early, but it also reacts to more noise.
  • SMA is steadier. It turns later but gets shaken less by a single big candle. Many traders use SMAs for long-term levels such as the 200-day.
Key idea: Neither is "better". EMA trades speed for noise; SMA trades noise for speed. Pick one, learn how it behaves, and stay consistent.

Choosing a length

The number after the name is how many candles are averaged. Common choices, and what people use them for:

  • 9 or 20: short-term trend, often used on intraday charts or for swing trading. The StockYatra charts page opens with a 20 EMA on the price by default.
  • 50: medium-term trend; a popular line on daily charts.
  • 100 or 200: long-term trend. Many people judge a stock's big picture by whether it is above or below its 200-day average.

There is nothing magical about these numbers. They are popular, and popularity is partly why they matter: when many people watch the same line, price sometimes reacts there.

Reading a moving average

  1. Slope first. A rising average says the trend is up, a falling one says down, a flat one says there may be no trend at all.
  2. Price position. Price consistently above a rising average is a healthy uptrend; repeatedly closing below it is a warning.
  3. Distance. When price runs far above its average, it is stretched. It often drifts back toward the line, which can act like moving support or resistance.

Crossovers: golden cross and death cross

A crossover is when a shorter average crosses a longer one. When the short one crosses above the long one, the recent average price has overtaken the longer-term average, a sign momentum has turned up. The famous version on daily charts, the 50-day crossing above the 200-day, is called a golden cross. The opposite, the 50 crossing below the 200, is a death cross.

Crossovers sound decisive, but understand what they are: two lagging lines crossing. By the time a 50/200 cross happens, price has often already moved a long way. They confirm what happened; they are not early warnings.

When moving averages fail

  • Sideways markets. When price chops in a range, short and long averages tangle and cross again and again. Each cross looks like a signal; most lead nowhere. This is the classic whipsaw.
  • Sharp reversals. After a sudden drop, a long average is still pointing up for days. It describes the old trend while price is already in a new one.
  • Optimising after the fact. Looking back, you can always find a length that "worked perfectly". It rarely works as well on the next chart.

Try it yourself

On the charts page, add a 20 EMA and a 20 SMA to the same stock and watch where they separate after a sharp move. Then add a 50 and a 200 on the daily chart and find the last crossover. Press Replay and step forward from a few candles before it: how long did price take to move after the cross, and how much of the move came before it? Our guide to practising with bar replay has a full routine, and the glossary defines every term used here. For an older introduction, see moving averages explained.

Key takeaways

  • A moving average smooths price to show direction; it always lags.
  • EMA reacts faster than SMA; both are fine if you use one consistently.
  • Read slope and price position first; crossovers second.
  • Expect many false crossovers when the market moves sideways.

Education only, not investment advice. StockYatra is a learning app: prices on its practice market are simulated around each stock's real-world price level, coins are virtual, and nothing in this article is a recommendation to buy or sell any security. Every example uses made-up round numbers to explain an idea, not to describe a real stock.

Summary in Nepali (नेपालीमा सारांश)

मुभिङ एभरेज भनेको पछिल्ला N वटा क्यान्डलको औसत बन्द मूल्य हो, जुन हरेक नयाँ क्यान्डलसँगै फेरि गणना हुन्छ। SMA ले सबै क्यान्डललाई बराबर महत्त्व दिन्छ, EMA ले भर्खरका क्यान्डललाई बढी महत्त्व दिन्छ त्यसैले छिटो प्रतिक्रिया दिन्छ। छोटो एभरेजले नजिकको ट्रेन्ड र लामो एभरेज (५०, २००) ले ठूलो ट्रेन्ड देखाउँछ। क्रसओभर ढिलो आउँछ र साइडवेज बजारमा प्रायः गलत हुन्छ। पहिले एभरेजको ढलान र मूल्य त्यसको माथि छ कि तल, त्यो हेर्नुहोस्। यो शिक्षाका लागि मात्र हो, लगानी सल्लाह होइन।

Practise on a real chart, free

Open the free StockYatra charts in your browser, no sign-up needed, or download StockYatra on iPhone or Android and start with 10,000 free virtual coins. Prices are simulated and coins are virtual, so no real money is ever at risk.

Open the charts Get the app

Chart reading for beginners: the full series

Frequently asked questions

What is the difference between SMA and EMA?
An SMA gives every candle in its window equal weight. An EMA gives more weight to recent candles, so it turns faster when price changes direction but also reacts more to noise.
Which moving average is best for beginners?
There is no single best. A 20 EMA for the short-term trend and a 50 or 200 SMA for the bigger picture is a common, simple starting point. Consistency matters more than the exact choice.
What is a golden cross?
When a shorter moving average, usually the 50-day, crosses above a longer one, usually the 200-day. It confirms that momentum has turned up, but it happens after much of the move.
Why do moving average crossovers fail?
Because both lines lag price. In sideways markets they cross back and forth repeatedly, producing many signals that lead nowhere.
Where can I add moving averages to a chart for free?
On the StockYatra charts page, which opens with a 20 EMA and lets you add SMA, EMA and many other indicators with editable lengths. Prices are simulated for practice.