Technical Analysis

What is EMA (Exponential Moving Average)?

Reviewed by Karthikeyan Anbarasan (Founder, TradeLyser) · Updated 19 Oct 2026 · Editorial policy

DefinitionAn EMA (exponential moving average) is a moving average that gives more weight to recent closes, so it reacts faster to new prices than a simple moving average of the same length. With a 20-day EMA at 24,800 and Nifty closing at 25,010, the new EMA is 24,820: it moves 20 points, about a tenth of the gap.
Formula
EMA today = (Close today − EMA yesterday) × k + EMA yesterday, where k = 2 ÷ (N + 1); the first EMA is usually seeded with the SMA of the first N closes
Example
Illustrative 20-day EMA: k = 2 ÷ 21 = 0.0952; (25,010 − 24,800) × 0.0952 + 24,800 = 20 + 24,800 = 24,820

A simple moving average gives each of its N closes equal weight and drops the oldest close entirely when a new one arrives. An EMA never drops a close; each one’s weight shrinks a little with every new bar. The result is a line that turns sooner when price changes direction, at the cost of reacting more to noise.

How the EMA is calculated

  1. Choose the length N and work out the smoothing factor k = 2 ÷ (N + 1). For a 20-day EMA, k = 2 ÷ 21 = 0.0952.
  2. Seed the first value, usually with the simple average of the first N closes.
  3. For each new bar, take the gap between the close and the previous EMA and multiply it by k.
  4. Add that amount to the previous EMA. The EMA closes about 9.5% of the gap each day at N = 20.
DayCloseGap to previous EMAGap × 0.095220-day EMA
Start24,800.00
125,010+210.00+20.0024,820.00
225,115+295.00+28.1024,848.10
324,890+41.90+3.9924,852.09
424,760−92.09−8.7724,843.32
524,980+136.68+13.0224,856.33

Illustrative Nifty closes. Notice how little the EMA moves even when price swings 200 points: at k = 0.0952 each close shifts it by under a tenth of the gap. A 9-period EMA would shift by a fifth and a 200-period EMA by about one hundredth.

The same weights explain the trade-off traders feel. On day 1 above, a 9 EMA starting from 24,800 would have jumped to 24,842 (a fifth of the 210-point gap), while the 20 EMA moved to 24,820. The faster line gets you into a new move sooner and also pulls you into more moves that fade. There is no free setting; the right one is whichever your own tagged trades support.

k for 9 EMA
0.200
k for 20 EMA
0.0952
k for 50 EMA
0.0392
k for 200 EMA
0.00995

How traders use it and log it

  • Trend filter: longs only while price and a fast EMA (for example 20) are above a slow one (for example 50 or 200).
  • Pullback entries: in a trending market, a pullback that holds near the 20 EMA is a common planned entry, with the stop beyond the swing low.
  • Crossovers: a fast EMA crossing a slow one, such as 9 over 21 on intraday charts. MACD is itself built from the 12 and 26 EMAs.
  • Trailing exits: hold while price closes above the EMA; exit on a close below it.
  • Journal fields: EMA lengths and timeframe, whether price was above or below each EMA at entry, and the distance from the EMA in points. After 30 or more trades, compare expectancy above and below.
Why platforms disagree
Because an EMA carries a trace of every past close, its value depends on how much history the platform loaded and how the first value was seeded. Two charts can show slightly different EMAs on the same day. Load plenty of history, and use one platform for both signals and review.

Limits and common mistakes

  • It still lags. A faster reaction than an SMA is not a forecast; every EMA is built only from closes that have already happened.
  • Ranges: in sideways markets a 9 or 20 EMA runs through the middle of price, and crossovers or "above/below" rules flip repeatedly.
  • Live bar: the EMA on the current bar moves with every tick until the close. Signals taken mid-bar can disappear by the close, so define whether you act on closed bars.
  • Stacking: plotting five EMAs makes it easy to find one that price respected after the fact. Choose the lengths before you look at the trade.

EMA vs SMA

EMA

Recent closes weigh more. Turns sooner after a change of direction, and reacts more to single large bars.
Common for intraday and swing entries

SMA

All N closes weigh the same. Smoother and slower; an old large bar affects it until it drops out of the window.
Common for 50 and 200-day regime lines
For Indian traders
An EMA uses only closing prices, so it works on the Nifty and Bank Nifty indices even though they have no volume of their own. On intraday charts, decide whether your EMA carries over from the previous session (the usual default) or starts fresh at 9:15; overnight gaps make a large difference to the first bars of the day.

Reference guide

ContextValueReading
One EMA setting per strategy, written in the planTestableResults can be compared across months because the rule did not change
EMA crossovers in a sideways marketWhipsawsFast EMAs cross back and forth in ranges; add a trend or volatility filter
Swapping EMA lengths after a few lossesCurve-fittingChange settings only at a scheduled review with enough trades behind it

Questions

How is EMA calculated?

EMA today = (close − previous EMA) × k + previous EMA, with k = 2 ÷ (N + 1). For a 20-period EMA, k is about 0.0952, so each close moves the EMA by under a tenth of the gap.

What is the difference between EMA and SMA?

An SMA weights all N closes equally; an EMA weights recent closes more. The EMA turns sooner but reacts more to noise.

Which EMA is best for intraday trading?

There is no single best length. 9, 20 and 21 are common on 5- and 15-minute charts. Choose one, keep it fixed per strategy and judge it on your own tagged trades with charges included.

What does the 200 EMA mean?

It is a slow average often used as a long-term trend line. Price above a rising 200 EMA is commonly read as a long-term uptrend; it is a filter for direction, not an entry signal.

Why does my EMA value differ from another platform?

EMAs depend on how much history is loaded and how the first value is seeded, so small differences between platforms are normal. Use one platform consistently.

Related terms