Library · Indicators

EMA (Exponential Moving Average)

The exponential moving average is a moving average that gives the most weight to the newest closing prices, so it reacts to changes sooner than a simple average.

  • Beginner
  • 5 min read
  • Updated

Why it matters

A simple moving average treats a close from 20 candles ago as exactly as important as the latest one. Many traders feel that recent prices deserve more attention. The exponential moving average (EMA) is built on that idea.

The EMA is also the engine inside other indicators. MACD is the difference between two EMAs, so learning this page explains half of that one.

What it looks like

EMA 20
A 20-period EMA. Like any moving average it follows price, but it bends toward new closes a little sooner than an SMA of the same length. Hypothetical data for illustration.

On the chart an EMA looks like any other moving average: one smooth line over the candles. The difference is in how the line responds when price changes pace.

SMA 20 (slower)EMA 20 (reacts faster)
Same price data, same period. The EMA stays closer to price and turns first. The SMA is smoother and turns later. Hypothetical data for illustration.

How it is calculated

Each new EMA value is a blend of two things: the latest close and the previous EMA value. A multiplier decides the mix.

Multiplier k = 2 / (N + 1)N is the period. For N = 9, k = 2 / 10 = 0.2. For N = 20, k = 2 / 21, about 0.095.
EMA today = (close today x k) + (EMA yesterday x (1 - k))The very first EMA value needs a starting point. Platforms commonly use an SMA of the first N closes.

In plain words

Picture a bucket of paint that you top up every day. Each day you pour out a fixed share and replace it with today’s colour. Today’s colour is always the strongest single ingredient. Older colours never vanish completely. They just get fainter with every top-up.

One step of a 9-period EMAHypothetical illustration

For a 9-period EMA the multiplier is 2 / (9 + 1) = 0.2. The latest close gets 20% of the weight and the previous EMA keeps 80%.

Suppose yesterday’s EMA was 100 and today’s hypothetical close is 105.

EMA today = (105 x 0.2) + (100 x 0.8) = 21 + 80 = 101.

If the next close is 105 again: (105 x 0.2) + (101 x 0.8) = 21 + 80.8 = 101.8.

The EMA keeps closing the gap to price, a fifth of the remaining distance at a time.

Where the weight goes

Weight of each close in a 9-period EMA
Latest close20%
1 candle ago16%
2 candles ago12.8%
3 candles ago10.2%
4 candles ago8.2%
Each older close counts for 80% of the one after it. In a 9-period SMA every close would count for the same 11.1%.

Because each step keeps a fixed share of the previous value, the influence of an old close shrinks by the same proportion on every candle. That steady shrinking is what “exponential” refers to.

Two consequences follow:

  • No drop-off. In an SMA, a close leaves the window all at once and the line can jump. In an EMA, old closes fade out gradually.
  • No hard window. The period N does not mean “the last N candles only”. In a 9-period EMA the latest nine closes carry roughly 87% of the weight. The rest comes from older data.

Settings and what they change

Period Multiplier Behaviour
9 0.20 Fast. Stays tight to price and turns often
21 about 0.09 Moderate
50 about 0.04 Slow
200 about 0.01 Very slow, changes direction rarely

A shorter period means a larger multiplier, so every new close moves the line more. A longer period means a smaller multiplier and a steadier line. Popular lengths such as 9, 12, 21, 26, 50 and 200 are conventions. Choosing a length because it fitted an old chart best is overfitting.

Going deeper

Faster is not better

The EMA reacts sooner than the SMA to a real change in direction. It also reacts sooner to a meaningless one-candle spike. Speed and false alarms come as a pair. The EMA vs SMA comparison covers this trade-off in more detail.

How to read it

The reading is the same as for any moving average:

  • A rising EMA means the weighted average of recent closes is increasing; a falling EMA means it is decreasing.
  • Price above the EMA means the latest close is above that weighted average.
  • When price moves sideways in a range, the EMA flattens and price crosses it repeatedly.

How practitioners use it

Short EMAs are popular on fast timeframes because they stay close to price. In a trend, some traders watch pullbacks toward an EMA as dynamic support or resistance, and pairs of EMAs are used for crossovers. All of these are descriptions of how price sits relative to its recent average. They work as context next to structure and volume, not as stand-alone triggers.

What it does NOT mean

  • The EMA is not a more accurate SMA. It is a different weighting. It gains speed and gives up smoothness.
  • A faster line does not remove lag. An EMA still uses only past closes and still turns after price does.
  • Price touching an EMA is not a signal. Price reaches its own average all the time, in trends and in ranges.
  • A 9-period EMA does not use only nine candles. Older closes keep a small, shrinking influence.

Common mistakes

  1. Assuming the EMA predicts turns. It follows them, slightly sooner than an SMA would.
  2. Shortening the period to “get in earlier”. A very short EMA is almost the price itself and whipsaws constantly.
  3. Comparing EMA values between platforms without checking the inputs. Different starting points and amounts of loaded history can produce small differences, especially on long periods.
  4. Tuning the period to past data. A perfect historical fit is hindsight, not a property of the market.

Risks and limitations

  • The EMA lags, like every moving average.
  • Its extra sensitivity produces more false turns in choppy markets.
  • It needs enough history to settle. The first values after the starting point are less reliable.
  • It is calculated from closing prices only and knows nothing about volume, news or liquidity.

Key takeaway

The EMA is a moving average that weights recent closes more heavily, using the multiplier 2 / (N + 1). It is quicker than an SMA, noisier than an SMA and still built entirely from the past.

Sources and further reading

  • Technical Analysis of the Financial Markets, John J. Murphy (1999). Chapter on moving averages
  • Technical Analysis: Power Tools for Active Investors, Gerald Appel (2005). Explains the exponential smoothing used in MACD