EMA (Exponential Moving Average)
A moving average that weights recent candles more heavily -- how the smoothing factor works and when to prefer EMA over SMA.
What is the Exponential Moving Average?
The Exponential Moving Average (EMA) is a moving average that gives more weight to recent candles. Unlike the SMA, which treats every candle equally, the EMA prioritizes what happened most recently. This makes it faster to react when the price changes direction -- but it also means it follows noise more closely.
EMA is the most widely used alternative to SMA. It is the default choice for traders who want their moving average to keep up with price more closely, and it serves as a building block inside other indicators like MACD.
How It's Calculated
The EMA uses a "smoothing factor" (also called the multiplier) to blend the new candle's price with the previous EMA value:
In plain English: take the current closing price and multiply it by the smoothing factor. Then take the previous EMA value and multiply it by (1 minus the smoothing factor). Add them together. The smoothing factor determines how much weight the newest candle gets.
For a 20-period EMA, the smoothing factor is 2 / 21 = 0.095. This means each new candle contributes about 9.5% to the new EMA value, and the accumulated history contributes the remaining 90.5%. Shorter periods produce larger smoothing factors -- a 5-period EMA has a factor of 0.333, giving each new candle a third of the weight.
Why EMA Reacts Faster
With SMA, every candle in the window has the same influence. If the price suddenly jumps, that one large candle is diluted by all the other candles in the window. The average moves slowly.
With EMA, the newest candle always gets the largest weight. When the price jumps, that candle immediately pulls the EMA in its direction. The older candles still contribute, but their influence decays exponentially -- each one matters less than the one after it.
This faster response is the main reason traders choose EMA over SMA. The tradeoff is that EMA also reacts faster to noise -- a single outlier candle moves the EMA more than it would move the SMA.
EMA vs SMA: When to Use Which
Prefer EMA when
You want your moving average to stay close to the current price. EMA is a better choice for short-term trading, crossover systems where speed matters, or when you are using the MA as a dynamic trailing stop reference.
Prefer SMA when
You want a stable, well-known reference level. The 50-day and 200-day SMA are watched by more traders than the equivalent EMAs, which can make them more significant as support and resistance levels. SMA is also better when you want the average to not overreact to a single unusual candle.
Common Uses
Crossover signals
Just like SMA, EMA can be used in dual-moving-average crossover strategies. A fast EMA (e.g., 12-period) crossing above a slow EMA (e.g., 26-period) is a buy signal; crossing below is a sell signal. EMA crossovers fire earlier than SMA crossovers because the lines react faster.
Trend filter
Use a longer-period EMA (50 or 100) as a trend filter: only take long trades when price is above the EMA, only take short trades when price is below. This keeps you trading in the direction of the prevailing trend.
Inside other indicators
EMA is a building block for several other indicators. The MACD is built from the difference between a 12-period and 26-period EMA. The DEMA and TEMA are constructed by layering multiple EMAs. Understanding how EMA works helps you understand these derived indicators.
Things to Watch Out For
EMA overreacts to outlier candles
Because EMA weights the newest candle most heavily, a single extreme candle (a news-driven spike, for example) will pull the EMA sharply in that direction. If the spike is a one-off event and the price reverts, the EMA may generate a false signal. SMA is more robust against outliers because every candle shares equal weight.
EMA still lags -- just less than SMA
EMA reduces lag compared to SMA, but it does not eliminate it. No moving average can react to a price change before it happens. If you need even less lag, consider DEMA or TEMA -- but be aware that less lag comes with more noise.
Where to Go Next
SMA (Simple Moving Average) -- the equal-weight alternative to EMA.
DEMA & TEMA -- further lag reduction beyond EMA.
MACD -- a trend/momentum indicator built from EMAs.
Moving Averages Overview -- all 10 moving average types available in Simula.