Advertise

GlossaryMetric

Moving Average (SMA and EMA): What It Is

A moving average is the average of the last N closing prices, updated with every new bar. By smoothing short-term swings in price, it shows the direction of the trend more clearly.

Last updated Sources

gate.com

What is a moving average?

The moving average (MA) is one of the oldest and most widely used tools in technical analysis. It averages a fixed number of periods; when a new bar closes, the oldest value drops out, the newest comes in, and the average "moves" one step. The result is a smooth line that travels along the price chart.

That line does two jobs. First, it filters noise, showing the overall direction instead of every candle's ups and downs. Second, it is a building block for many other indicators: MACD is the difference between two exponential averages, and Bollinger Bands are drawn around a 20-period average. The crypto technical analysis guide places the moving average in the wider toolkit.

bitget.com

Moving averages are trend-following tools: they are calculated from past data, so they follow price rather than forecast it.

SMA: formula and example

The simple moving average (SMA) is the arithmetic mean of the last N closes:

binance.com

SMA = (C₁ + C₂ + … + Cₙ) / N

A five-period example: with closes of 10, 12, 11, 13 and 14, SMA(5) = (10 + 12 + 11 + 13 + 14) / 5 = 60 / 5 = 12. If the next bar closes at 15, the oldest value (10) drops out and 15 comes in: (12 + 11 + 13 + 14 + 15) / 5 = 13.

Every close carries the same weight (1/N) in an SMA. That keeps the line calm and smooth, but an old value leaving the window can still move the average: when a very high or very low close drops out, the SMA can jump even if price did not change that day.

EMA: the 2/(N+1) multiplier

The exponential moving average (EMA) gives more weight to recent data. It updates on each new bar as follows:

EMA today = (Close − EMA yesterday) × k + EMA yesterday, where k = 2 / (N + 1)

For EMA(10), the multiplier is 2 / 11 = 0.1818. If the previous EMA is 12 and the new close is 14, the new EMA is 12 + 0.1818 × (14 − 12) = 12.36. In other words, about 18% of the gap between the new close and the old average is added to the average.

Older data loses weight geometrically but never drops to exactly zero. The first EMA value is usually seeded with an SMA, which is why platforms can show small differences at the start even with the same data.

SMA vs EMA

SMAEMA
WeightingEvery close equalRecent closes weigh more
SpeedSlowerFaster
NoiseFewer false turnsMore sensitive to short swings
Data leaving the windowCan cause a sudden jumpEffect fades gradually
Typical useLong-term trend (e.g. 200)Short-term trend, inputs to MACD

There is no single answer to which one is "better". The EMA catches turns earlier but is wrong more often; the SMA turns later but gives fewer false signals.

Other averages exist too. A weighted moving average (WMA) spreads weights linearly: in a five-period WMA the newest close gets a weight of 5, the oldest 1, and the total is divided by 15. Wilder's smoothing is an exponential average with a 1/N multiplier, used inside indicators such as RSI and ATR. In everyday use, SMA and EMA remain the two most common types.

Common periods: 20, 50, 100, 200

  • 20 periods: the short-term trend; on a daily stock chart, roughly a month of trading days.
  • 50 periods: the medium-term trend, and the fast leg of crossover setups.
  • 100 periods: an intermediate reference between medium and long term.
  • 200 periods: the most-watched measure of the long-term trend.

A period is a bar, not a day. On a four-hour chart, 200 periods cover about 33 days. The calendar span also depends on the market: stocks trade about 252 days a year, so a daily 200 SMA spans roughly nine and a half months, while in crypto, which trades every day, it spans exactly 200 calendar days (about six and a half months).

Our technical analysis pages show both SMA and EMA values for 20, 50, 100 and 200 periods on the selected timeframe.

Crossovers: golden cross and death cross

  • Golden cross: the 50-period average crosses above the 200-period average. It is read as consistent with the long-term trend turning positive.
  • Death cross: the 50 crosses below the 200, consistent with a weakening long-term trend.
  • Price crossing an average: a close moving above or below a single average signals a shorter-term change.

Crossovers lag by design. The centre of mass of an SMA(N) sits about (N − 1) / 2 bars back, so a 200-period SMA roughly reflects conditions 100 bars ago. A golden cross therefore often appears after a large part of the advance has already happened. It is better read as a summary of the existing trend than as a timing tool.

The moving average as dynamic support and resistance

Horizontal support and resistance levels are fixed prices; a moving average offers a reference that travels with price. In a strong uptrend, pullbacks may find a reaction near the 20- or 50-period average; in a downtrend, the same averages can behave like resistance on rallies.

This works best in trending phases where the slope of the average is clear. Candlestick patterns forming near the average and an RSI reading help judge the strength of the reaction. For a trend line that is based on ATR and flips direction, Supertrend does a similar job with a different calculation.

Limits: whipsaws in range-bound markets

Markets spend a good part of their time in narrow ranges without a clear trend. In those phases price crosses the average again and again, short and long averages tangle, and crossovers produce one false alarm after another. This is known as a whipsaw.

Other limits:

  • Lag: the longer the average, the later it shows a turn.
  • Period choice: a period that looks good on one asset or one stretch of history may not work elsewhere, and hunting for the best period on past data leads to overfitting.
  • Sudden events: averages are built from past prices and cannot anticipate unexpected news or macroeconomic shocks.

Live examples

To see live SMA and EMA values, the Bitcoin technical analysis and support and resistance levels page lists where price sits relative to the 20, 50, 100 and 200-period averages; the same table appears on the Ethereum technical analysis page.

For session-based markets, where the calendar span of an average differs, see NVIDIA technical analysis and Gold (XAU) technical analysis. To compare price against its averages across many assets on one screen, use the crypto technical summary table and the stocks and commodities technical summary.

Frequently Asked Questions

7 questions
What is a moving average?

The average of the last N closing prices, updated with every new bar. It smooths short-term swings and shows the direction of the trend.

What is the difference between SMA and EMA?

An SMA weights every close equally. An EMA gives more weight to recent closes, so it reacts faster to price changes but is also more sensitive to short swings.

What does the 200-day moving average show?

It is the most-watched measure of the long-term trend. Price above it is read as consistent with a positive long-term bias, and price below it with a weaker one.

What is a golden cross?

The 50-period average crossing above the 200-period average. It is consistent with the long-term trend turning positive, but it is a lagging indicator.

Which period is best?

There is no single right period. 20 is common for the short term, 50 for the medium term and 200 for the long term; the choice depends on the timeframe and purpose.

Why does a moving average lag?

It is an average of past prices, so it follows price. The centre of mass of an SMA(N) sits about (N − 1) / 2 bars back.

Is it calculated the same way for stocks and crypto?

The formula is the same. The difference is the calendar: stocks trade about 252 days a year and crypto trades every day, so the same period covers a different span of time.