SMA vs EMA: which moving average reacts faster?
By Oalgo · Last reviewed
The EMA reacts faster than the SMA. Both are averages of recent closes, but the SMA counts every candle in its window the same, while the EMA gives the newest candles more weight, so it turns sooner when price turns.
How do the SMA and the EMA differ?
#| SMA | EMA | |
|---|---|---|
| How it is calculated | The sum of the last N closes divided by N | A running average where each new close counts for 2 ÷ (N + 1) |
| Weight of recent candles | Every candle in the window counts the same | The newest candles count most |
| Reaction to a turn | Slower | Faster |
| Small moves | Smoothed more | Smoothed less |
| Old candles | The oldest candle drops out of the window, so the average can step | No candle drops out; old closes fade away |
| A 20-period example | The average of the last 20 closes | Each new close counts for about 9.5% |
| Made-up example: 3 closes of 10, then a close of 16 | SMA (3) | EMA (3) |
|---|---|---|
| Working | (10 + 10 + 16) ÷ 3 | 16 × 0.5 + 10 × 0.5, where 0.5 = 2 ÷ (3 + 1) |
| New value | 12 | 13 |
The same jump in price moves the EMA further than the SMA, because the new close carries more weight. With a longer setting both move less.
When do people use each?
#- SMA: to see the broad direction, or as a filter such as "only enter when the close is above the 50-period SMA".
- EMA: when a rule should react to a turn sooner, such as a short EMA crossing above a longer one.
- Both: two averages crossing each other, with the same length for the SMA version and the EMA version, to see what the weight changes. The moving average crossover page has the rules.
How do you test the choice in Oalgo?
#In Oalgo you can tell Oalgo AI your moving average rule in your own words, check the rule it builds, and test it. After testing, if you choose, you Go Live with your own Live Strategy on your own Venue Account at a Supported Venue.
- Build the same rule twice, once with an SMA and once with an EMA of the same length.
- Run a backtest of both on the same dates, and on more than one date range.
- Compare the number of trades and the fees, not only the report totals. A faster average can trade more often.
- Run a forward test of the one you keep, on new prices, with simulated funds.
What can neither tell you?
#Neither average predicts price. Both follow it. A faster average turns sooner and is also moved more by small, short-lived changes; a slower one turns later. The length you pick usually changes the behaviour more than the choice of SMA or EMA. For how each is built, see moving averages.
Read next
- Moving averages: SMA and EMA explainedA moving average smooths price into one line. Learn how the SMA and EMA are calculated, how they differ, and how to use them in your own rules.
- MACD vs RSI: trend momentum or overbought and oversoldMACD follows the gap between two moving averages; RSI compares up moves with down moves on a 0 to 100 scale. See how they differ and how to test them.