SMA, EMA and WMA: three ways to calculate a moving average

A moving average can be simple, exponential or weighted; they differ in how much weight recent prices get. Most brokers and charting software default to SMA.

Updated:

The default is SMA

In most brokers and charting software, a “moving average” defaults to the SMA (simple moving average), and so does this site: unless you pick otherwise, MA means SMA. EMA and WMA are two other methods; switch the “kind” in the MA settings on the Technical tab when you need them.

SMA: simple moving average

The arithmetic mean of the last N closing prices, every day weighted equally:

SMA = (C₁ + C₂ + … + C_N) ÷ N

For a 5-day SMA, add the last 5 closes and divide by 5; when a new day comes in, the oldest day drops out. It is the simplest and most universal definition, so different programs agree; the downside is that old and new prices count the same, so it reacts more slowly to recent changes.

EMA: exponential moving average

More recent prices get more weight, and the weights fall by a fixed ratio going back:

EMA reacts faster than SMA; MACD uses the 12-day and 26-day EMAs. Because the formula reaches back indefinitely, how the starting value is chosen (for example the first close, or the SMA of the first N days) makes the early values differ slightly, so different programs may not match exactly.

WMA: weighted moving average

The weights of the last N days are 1, 2, …, N, with the most recent day weighing most:

WMA = (1 × C₁ + 2 × C₂ + … + N × C_N) ÷ (1 + 2 + … + N)

The weights rise linearly, so the speed usually sits between SMA and EMA, and both the calculation and the starting point are unambiguous; fewer people use it than SMA or EMA.

Which one to use

There is no “right answer”:

Where to see it on this site

On a stock page, open the Technical tab, add MA and choose the kind (SMA, EMA or WMA) and the period; the screener’s moving-average conditions use SMA. Use adjusted prices, otherwise ex-dividend gaps distort the averages.

This article only explains the calculation. It is not investment advice.

See it on this site

Citing and copyright

This article is original content of “Tenmizu FinTech”. You are welcome to cite it; please credit the source and link to this page. Concepts or data that come from others are credited under “Sources”; their copyright belongs to the original authors.

Keep reading