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.

Chart: example prices with a 20-period SMA and a 20-period EMA. The EMA follows turns sooner than the SMA.PriceSMA 20EMA 20EMA turns first
Example prices, made up for this page.

How do the SMA and the EMA differ?

#
SMAEMA
How it is calculatedThe sum of the last N closes divided by NA running average where each new close counts for 2 ÷ (N + 1)
Weight of recent candlesEvery candle in the window counts the sameThe newest candles count most
Reaction to a turnSlowerFaster
Small movesSmoothed moreSmoothed less
Old candlesThe oldest candle drops out of the window, so the average can stepNo candle drops out; old closes fade away
A 20-period exampleThe average of the last 20 closesEach new close counts for about 9.5%
Made-up example: 3 closes of 10, then a close of 16SMA (3)EMA (3)
Working(10 + 10 + 16) ÷ 316 × 0.5 + 10 × 0.5, where 0.5 = 2 ÷ (3 + 1)
New value1213

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