Skip to main content

What Is a Moving Average? SMA vs EMA, Formulas and Limits

A moving average is the mean price over a rolling window of recent periods. SMA and EMA formulas, worked examples, crossovers and limits.

· By ZIPMEX · 18 min read

A moving average is the average price of an asset over a fixed number of recent periods, recalculated each period so the window "moves" forward: the newest price is added and the oldest is dropped. It smooths out short-term noise so the direction of a trend is easier to see. It does not forecast price. In the words of StockCharts' ChartSchool, a moving average "doesn't predict price direction. Instead, it defines the current direction."

How a moving average is calculated

Simple moving average (SMA)

The NIST/SEMATECH e-Handbook of Statistical Methods describes taking a moving average as "a smoothing process". Each value is the mean of the last N observations:

M_t = (X_t + X_{t-1} + ... + X_{t-N+1}) / N

ChartSchool gives a worked example. Five closing prices of 11, 12, 13, 14 and 15 produce a 5-period SMA of 13. On the next period, 11 drops out and a new close of 16 comes in, so the SMA becomes 14. One period later it is 15.

Every price in the window carries the same weight.

Exponential moving average (EMA)

The EMA gives more weight to recent prices. ChartSchool sets out the calculation:

  • Starting value: the first EMA uses an SMA as the "previous" value.
  • Multiplier: 2 / (number of periods + 1). For a 10-period EMA that is 2 / 11 = 0.1818, or 18.18%. A 20-period EMA uses 9.52%.
  • Formula: EMA = (Close − previous EMA) × multiplier + previous EMA.

Example: a 10-period EMA stands at 100 and the next close is 110. The new EMA is (110 − 100) × 0.1818 + 100 = 101.82.

ChartSchool notes that an EMA becomes more accurate as more data points go into it, and that its own charts calculate back at least 250 periods.

SMA vs EMA at a glance

SMAEMA
WeightingEqual for every periodHeavier on recent periods
Reaction to new pricesSlowerFaster
LagMoreLess

Why moving averages lag

A moving average is built only from past prices, so it always trails the price. ChartSchool puts it plainly: "The longer the moving average, the more the lag." Because the EMA weights recent prices more heavily, it lags less than an SMA of the same length.

ChartSchool groups lengths roughly as:

  • Short-term: 5 to 20 periods
  • Medium-term: 20 to 60 periods
  • Long-term: 100 periods or more

On a crypto chart, a "period" is whatever candle you choose (an hour, a day, a week), so a 50-period average on hourly candles covers far less time than one on daily candles.

Work out the next EMA value

Enter the EMA length, the previous EMA and the latest close to see the new EMA, using the multiplier 2 / (periods + 1).

Worked examples (new EMA = (close minus previous EMA) × 2 / (periods + 1) + previous EMA)
Number of periods in the EMAPrevious EMA value (the first one is seeded with an SMA)Latest closing priceNew EMA
10 periods100110101.82
20 periods100110100.95
10 periods110100108.18
  • All three values are your own inputs; the defaults repeat the article's worked example (10 periods, previous EMA 100, close 110, giving 101.82).
  • A shorter EMA has a larger multiplier, so it moves further toward the new close; a longer one moves less and lags more.

This calculates one EMA step from your inputs only: it does not seed the first EMA from an SMA, build a full price history, or say whether any crossover or trend signal is reliable.

How chartists use moving averages

Price crossovers

When price moves above its moving average, ChartSchool treats it as a bullish signal, and a move below as bearish. A common approach is to let a long average set the bigger trend and a shorter one generate signals. For example, when price is above the 200-day average, the chartist watches only the 50-day for signals.

Double crossovers, golden cross and death cross

The double crossover method, which ChartSchool attributes to John Murphy's Technical Analysis of the Financial Markets, pairs one short and one long average:

  • Golden cross: the shorter average crosses above the longer one (bullish).
  • Death cross (sometimes "dead cross"): the shorter average crosses below the longer one (bearish).

ChartSchool says "many chartists use the 50-day and 200-day moving averages together". It calls a 5-day and 35-day EMA pair short-term, and a 50-day and 200-day SMA pair medium-term, "perhaps even long-term". A triple crossover adds a third average, for example 5, 10 and 20 days.

Support and resistance

In an uptrend a moving average can act as support, and in a downtrend as resistance. ChartSchool mentions the 20-day SMA for short-term uptrends and the 200-day SMA for long-term ones. It also warns: "Do not expect exact support and resistance levels from moving averages, especially longer moving averages." Treat them as zones, not exact lines.

Where moving averages fail

  • Late signals. Both averages in a crossover lag, so ChartSchool describes the signals as "relatively late". In its words, "Don't expect to sell at the top and buy at the bottom using moving averages."
  • Whipsaws in ranges. Without a strong trend, crossover systems "will produce many whipsaws". Markets spend a lot of time in trading ranges, where moving averages become ineffective. Filters ChartSchool suggests include requiring a crossover to hold for a set number of days (it mentions three) or requiring a minimum gap between the averages.
  • Not a standalone tool. ChartSchool advises against using moving averages alone and suggests pairing them with other indicators such as RSI.

These calculations work the same way on stock and crypto price data. The asset changes, but the math does not.

Limitations: this explainer relies on two references (StockCharts ChartSchool and the NIST/SEMATECH e-Handbook) and describes how the indicator works, not how any strategy has performed.

Updated on Oct 25, 2026