Lesson 19 of 50

EMA and SMA Explained on TradingView

A practical explanation of the Simple and Exponential Moving Average - how each is calculated, common periods traders watch, and what a crossover means.

What you will learn in this lesson

  • Understand what a Simple Moving Average (SMA) calculates, conceptually
  • Understand how an Exponential Moving Average (EMA) differs from an SMA
  • Recognize common periods traders watch, such as 20, 50, and 200
  • Understand the basic idea of a "crossover" between price and a moving average, or between two moving averages
  • Know how to add both an SMA and an EMA to the same TradingView chart for comparison

Ask an experienced trader to name the very first indicator they ever learned, and a huge number will say “moving average.” This lesson covers the two most common flavours found on TradingView - the Simple Moving Average (SMA) and the Exponential Moving Average (EMA) - what each calculates conceptually, the periods traders commonly watch, and the basic idea of a crossover.

What Is a Simple Moving Average (SMA)?

A Simple Moving Average takes the closing prices of a set number of recent periods and averages them, plotting the result as a single line directly on the price chart. A “20-period SMA” on a daily chart, for example, takes the last 20 daily closing prices, averages them, and plots that average. As each new day closes, the oldest day drops out of the calculation and the newest day joins it - the average “moves” forward continuously, which is where the name comes from.

Because every period within the chosen window counts equally, an SMA tends to smooth out short-term noise, showing a steadier picture of the broader trend rather than reacting sharply to any single day’s move.

What Is an Exponential Moving Average (EMA)?

An Exponential Moving Average calculates a similar average, but weights more recent prices more heavily than older ones within the same period. A 20-period EMA and a 20-period SMA look at the same span of data, but the EMA leans its calculation toward the most recent candles, so it tends to shift a little sooner when price makes a fresh move.

Neither approach is inherently correct - an SMA’s equal weighting produces a smoother, slower-moving line, while an EMA’s recency weighting produces a line that hugs current price a bit more closely. Many traders simply pick whichever behaviour suits how they read a chart.

Common Periods Traders Watch: 20, 50, and 200

While a moving average can technically be set to any period, three lengths come up again and again in trader conversation:

  • 20-period - often watched as a short-term reference
  • 50-period - often watched as a medium-term reference
  • 200-period - often watched as a long-term reference

There’s nothing mathematically magical about these specific numbers - they’ve simply become widely referenced conventions over time. A trader following Reliance Industries or the Nifty 50 might glance at where price sits relative to its 50-period and 200-period averages as one piece of broader context, alongside everything else on the chart.

Crossovers: What Traders Watch For

A crossover simply describes one line moving past another on the chart. Two common types come up in trader conversation:

  • Price crossing a moving average - for example, price moving from below its 50-period average to above it, or vice versa.
  • A shorter moving average crossing a longer one - for example, a 20-period average crossing above (or below) a 50-period average.
   Price / MA
      │                    20-period MA  ────╮
      │                                       ╰──╮
      │         ╭──── crossover point ──────╮    ╰──
      │  50-period MA ───────────────────────╯
      └───────────────────────────────────────────────  Time

It’s worth being precise about what a crossover is and isn’t. It’s simply a description of something that has just happened on the chart - two lines that were on one side of each other are now on the other side. Many traders watch crossovers as one useful observation among several, because they can reflect a genuine shift in short-term versus longer-term average price. But a crossover is calculated entirely from past and current closing prices - it doesn’t guarantee what price does in the sessions that follow.

Adding SMA and EMA on TradingView

Both are found under the same “Moving Average” family in the Indicators menu:

  1. Click “Indicators,” search “Moving Average.”
  2. Choose either the plain “Moving Average” (SMA) or “Moving Average Exponential” (EMA) option.
  3. In the indicator’s settings, adjust the period (20, 50, 200, or any custom number) and the price source.
  4. Repeat with a different period or type to compare multiple moving averages on the same chart.

Real-Life Example: Comparing Two Averages on Bank Nifty

Suppose a trader adds a 20-period EMA and a 20-period SMA to a Bank Nifty daily chart, using two different colours to tell them apart. During a fairly calm, steady week, the two lines sit almost on top of each other. Then a sharp single-day move happens - perhaps driven by an RBI policy announcement - and for a few days afterward, the EMA shifts slightly faster in the new direction than the SMA, since it weights that recent, sharper move more heavily. Neither line “predicted” the RBI announcement; both simply reflect it at slightly different speeds once it has already happened.

Analogy: Two Ways of Averaging Your Commute Time

Imagine tracking how long your daily commute takes over the last 20 days. A Simple Moving Average is like averaging all 20 days equally - a single unusually bad traffic day nudges the average only slightly, spread evenly across the whole period. An Exponential Moving Average is like giving yesterday’s commute a bit more weight in your mental estimate than a commute from three weeks ago - useful if you suspect something about your route or traffic patterns has genuinely changed recently, and you want your estimate to catch up a little faster.

Common Beginner Mistakes

  • Assuming a crossover is a guaranteed signal. It’s a description of what has just happened on the chart, not a certainty about what comes next.
  • Using only one moving average and expecting it to work in every market condition. Different periods and types behave differently depending on how choppy or trending a chart currently is.
  • Not knowing whether a given crossover mention refers to price-vs-average or average-vs-average. These are related but distinct ideas, and mixing them up leads to confusion when reading about strategies.
  • Adding too many moving averages to one chart. Beyond two or three, many traders find the chart harder to read rather than easier.

Practical Tips

  • Start by adding just one moving average (try a 20-period EMA) to a chart you already know well, and observe it for a week or two before adding more.
  • Compare an SMA and EMA of the same period side by side at least once - seeing the difference directly makes the concept far more intuitive than reading about it.
  • Keep the “past and present, not future” framing in mind as this module continues - it applies to every indicator covered from here on, not just moving averages.

Practical Exercise

  • Add a 20-period SMA and a 20-period EMA to the same Nifty 50 or Bank Nifty chart, using two different colours. Watch both lines for a week and notice how the EMA tends to hug recent price moves a little more closely than the SMA.
  • Add a 50-period and a 200-period moving average to a stock you follow regularly, such as HDFC Bank or Infosys, and simply observe, over time, whether the shorter line ever crosses the longer one.

Mini Quiz

1. What does a Simple Moving Average (SMA) calculate?
  • The single highest price reached in the last year
  • A plain average of the closing prices over a specified recent number of periods
  • The total volume traded over a specified period
  • A prediction of the next day's closing price

An SMA simply averages the closing prices over however many periods are chosen (for example, the last 20 days), giving each of those periods exactly equal weight in the calculation.

2. How does an Exponential Moving Average (EMA) differ from an SMA?
  • An EMA ignores price entirely and only uses volume
  • An EMA gives more weight to recent prices, so it reacts somewhat faster to new price changes than an SMA of the same period
  • An EMA is only available on paid TradingView plans
  • An EMA and an SMA are calculated in exactly the same way

Both average recent prices, but an EMA weights recent prices more heavily than older ones within its period, so it tends to respond a little sooner to fresh price changes than a plain SMA of the same length.

3. Which periods are commonly watched by traders using moving averages?
  • Only 3 and 5
  • 20, 50, and 200 are widely watched periods, among others
  • Exactly 365, and no other period is ever used
  • Moving average periods are fixed by SEBI regulation

While a trader can technically set a moving average to any period, 20, 50, and 200 are commonly watched lengths - often associated loosely with short-term, medium-term, and long-term trend context respectively.

4. What is generally meant by a "crossover" involving a moving average?
  • A stock moving from the NSE to the BSE
  • Price crossing above or below a moving average, or a shorter moving average crossing a longer one
  • A change in a company's board of directors
  • A moving average being deleted from a chart

A crossover simply describes one line moving past another on the chart - either price crossing a moving average, or a shorter-period moving average crossing a longer-period one - something many traders watch as one input among several.

5. Does a moving average crossover guarantee a particular future price move?
  • Yes, crossovers are a certain signal of future direction
  • No - a crossover describes something that has just happened on the chart; many traders treat it as one observation to watch, not a guarantee
  • Only crossovers on Friday are meaningful
  • Crossovers only apply to cryptocurrency charts

A crossover is simply a description of what recent price and moving average values have just done. It's watched by many traders as one useful observation among several, never as a guaranteed signal of what happens next.

6. Can both an SMA and an EMA be added to the same TradingView chart at once?
  • No, only one moving average is allowed per chart
  • Yes - multiple moving averages, of any type and period, can be applied to the same chart simultaneously
  • Only if they use the exact same period
  • Only on the TradingView mobile app

TradingView allows multiple instances of the Moving Average indicator (SMA, EMA, or other variants) to be applied to a single chart at once, each with its own period and colour - a common way to compare them directly.

Frequently Asked Questions

Is EMA always "better" than SMA, or the other way around?

Neither is universally better - they simply weight data differently. An EMA reacts a little faster to recent price changes, which some traders prefer, while an SMA's equal weighting can feel smoother and less prone to reacting to short-lived price noise. Many traders pick based on personal preference and what they're trying to observe.

What does the "period" in a moving average actually mean?

The period is simply how many recent candles (days, hours, minutes, depending on the chart's timeframe) are included in the average. A "50-period" moving average on a daily chart covers the last 50 trading days; on an hourly chart, it covers the last 50 hourly candles instead.

Why are 20, 50, and 200 such commonly referenced periods?

These lengths became widely referenced over time partly through convention - many traders informally treat them as rough proxies for a short-term, medium-term, and long-term view of a chart, respectively. There's nothing mathematically special about these exact numbers; a trader is free to use any period.

Does a moving average work the same way on an intraday chart as on a daily chart?

Yes, the calculation itself doesn't change - only what a "period" represents changes based on the chart's timeframe (minutes versus days, for example). The same Moving Average indicator setting is used either way.

What is a "golden cross" or "death cross"?

These are informal names some traders use for specific crossovers, typically involving longer periods like 50 and 200 - a "golden cross" describes a shorter average crossing above a longer one, and a "death cross" the opposite. Like any crossover, these describe a past/current chart event, not a guaranteed future direction.

Can I change the moving average's source, such as using the high or low price instead of the closing price?

Yes - TradingView's Moving Average settings typically allow choosing the price source (close, open, high, low, or others). Closing price is the most commonly used default, but this is fully adjustable.

Do moving averages work for both stocks and indices like Nifty 50 or Bank Nifty?

Yes - moving averages, like most indicators, apply the same way to any chart with available price history, whether it's an individual stock, a broad index, a Futures contract, or an Option.

Is it common to use more than two moving averages on a single chart?

It happens, though many traders find that beyond two or three moving averages, a chart can start feeling cluttered rather than clearer. Starting with a smaller number and adding more only if genuinely useful is a reasonable approach.

How does this lesson connect to the MACD lesson later in this module?

MACD, covered in Lesson 22, is itself built from a combination of EMAs. Understanding what an EMA is and how it behaves here makes MACD's construction much easier to follow when that lesson introduces it.

Glossary

Key Takeaways

  • A Simple Moving Average (SMA) is a plain average of closing prices over a chosen number of recent periods, weighting each period equally.
  • An Exponential Moving Average (EMA) weights recent prices more heavily, making it respond a little faster to new price changes than an SMA of the same length.
  • 20, 50, and 200 are commonly watched periods, loosely associated with short-term, medium-term, and long-term views of a chart.
  • A "crossover" describes price crossing a moving average, or a shorter moving average crossing a longer one - an observation many traders watch, not a guarantee.
  • Multiple moving averages, of different types and periods, can be applied to the same TradingView chart at once for direct comparison.
  • Like every indicator, moving averages are built from past and current price data - they describe recent behaviour, not a certain future.

Conclusion

SMA and EMA are the simplest possible starting point for reading trend on a chart - one weighting all recent prices equally, the other leaning toward the most recent ones. With that foundation set, the next lesson introduces VWAP, an intraday-specific average that many day traders treat as a fair-value reference point during the trading session.

Disclaimer:This lesson is for educational purposes only and covers the TradingView platform itself - it is not investment, trading, or financial advice. No indicator, drawing tool, or automation setup guarantees future results. Trading and investing involve risk of loss and are not suitable for every investor. Please do your own research and consult a SEBI-registered investment adviser before making trading or investment decisions.