PnL ProfitEncyclopedia
🌐 English

Moving Averages

7 min read · Updated Nov 23, 2026
More in Technical Analysis

A moving average is the average price over a set number of recent periods, recalculated as each new bar arrives, so that it "moves" along the chart. It smooths out short-term noise and makes the direction of the trend easier to see. Moving averages are the most widely used technical indicator and the building block for many others, including MACD and Bollinger Bands. Their basic limitation is lag: because they average past prices, they always react after price has already moved.

Key takeaways

  • A simple moving average (SMA) weights every period equally; exponential (EMA) and weighted (WMA) averages give more weight to recent prices.
  • Common periods are 20 (short term), 50 (medium term) and 200 (long term), and their popularity is partly self-reinforcing.
  • A golden cross (50 above 200) and death cross (50 below 200) are widely reported but slow signals that whipsaw in sideways markets.
  • Every moving average trades responsiveness for smoothness; there is no setting that is both fast and free of false signals.
  • Moving average rules are a core part of systematic trend following, which has historically worked in some markets with long losing periods.
On this page
  1. Types of moving average
  2. Worked example: SMA vs EMA vs WMA
  3. Common periods and how they are used
  4. Using moving averages
  5. The lag tradeoff
  6. What the evidence says
  7. Common mistakes

Types of moving average

Simple moving average (SMA)

The SMA adds the last N closing prices and divides by N. A 20-day SMA is the average close of the last 20 trading days. When a new day arrives, the oldest day drops out.

Because every day counts equally, an SMA can jump when a large move drops out of the window, even if today's price did nothing. This is sometimes called the drop-off effect.

Exponential moving average (EMA)

The EMA gives the most weight to the latest price and progressively less to older prices, without a hard cutoff. Each new value is:

  • EMA today = EMA yesterday + k x (close today - EMA yesterday)
  • where k = 2 / (N + 1)

For a 20-period EMA, k = 2 / 21, about 0.095. For a 5-period EMA, k = 2 / 6, about 0.333. The EMA needs a starting value, usually an SMA, and early values depend on that seed.

Weighted moving average (WMA)

The WMA assigns linear weights: in a 5-period WMA, the latest close is multiplied by 5, the one before by 4, and so on down to 1, and the total is divided by the sum of the weights (15). It reacts faster than an SMA.

Other variants exist, including the Hull moving average, the double and triple EMA, and Wilder's smoothing (used inside RSI and ATR). They all aim to balance smoothness and speed in different ways.

Worked example: SMA vs EMA vs WMA

Five daily closes: $10, $11, $12, $13, $14.

  • 5-day SMA = (10 + 11 + 12 + 13 + 14) / 5 = 60 / 5 = $12.00
  • Assume the 5-day EMA is also $12.00 at this point (seeded with the SMA).

The next day closes at $16, a larger jump than usual.

  • New SMA: drop $10, add $16. (11 + 12 + 13 + 14 + 16) / 5 = 66 / 5 = $13.20
  • New EMA: k = 2 / 6 = 1/3. EMA = 12.00 + (1/3) x (16 - 12.00) = 12.00 + 1.33 = $13.33
  • New WMA: (11 x 1 + 12 x 2 + 13 x 3 + 14 x 4 + 16 x 5) / 15 = (11 + 24 + 39 + 56 + 80) / 15 = 210 / 15 = $14.00

All three are below the latest price of $16, which is the lag. The WMA moved closest to price because it puts the most weight on the latest bar; the SMA moved least.

Common periods and how they are used

Period Typical use
9 or 10 Very short-term trend; often an EMA on intraday charts
20 or 21 Short-term trend; roughly one month of trading days. The middle line of Bollinger Bands
50 Medium-term trend; widely watched on daily stock charts
100 Intermediate; less common
200 Long-term trend; the most-watched average for stock indices

These periods have no special mathematical property. They became conventions, and their popularity means that many traders watch the same lines. For example, financial media often report when a major index crosses its 200-day moving average. That attention can create short-term reactions near these averages, partly as a self-fulfilling effect.

Moving averages can be calculated on any timeframe. A 50-period average on a 5-minute chart covers about four hours, not 50 days.

Using moving averages

Trend filter

The simplest use is direction: price above a rising 200-day average is treated as a long-term uptrend; below a falling one, a downtrend. Many traders only take long trades when price is above a chosen average, and only short trades below it. The slope matters as much as the position: a flat average suggests a range. See trends and market structure.

Crossovers

A crossover system uses two averages, one fast and one slow. A buy signal occurs when the fast average crosses above the slow one, and a sell signal when it crosses below.

  • Golden cross: the 50-day crosses above the 200-day.
  • Death cross: the 50-day crosses below the 200-day.

Golden and death crosses are slow by design. By the time a 50-day average crosses a 200-day average, price has usually already moved a long way. In sideways markets, the averages can cross back and forth repeatedly, producing a series of small losses called whipsaws. A price crossing a single average (for example, closing above the 50-day) is a faster but noisier version of the same idea.

Dynamic support and resistance

In a steady trend, price often pulls back toward a moving average and then resumes. Traders treat the average as a moving version of support and resistance. The 20 and 50 are popular for this in stocks. As with horizontal levels, the average is a zone, not an exact line, and it fails regularly, especially when the trend is ending.

Building block for other indicators

MACD is the difference between two EMAs. Bollinger Bands are a moving average plus and minus standard deviations. Keltner Channels use an EMA and ATR. Understanding moving averages makes these tools easier to interpret.

The lag tradeoff

All moving averages lag. On a steady, straight-line trend, an N-period SMA trails price by about (N - 1) / 2 bars. A 20-day SMA is roughly 9.5 days behind; a 200-day SMA is roughly 100 days behind.

An N-period EMA has about the same average lag on a steady trend. Its advantage is that it responds sooner when price changes direction suddenly, because the latest bar carries more weight. The cost is that it also reacts more to random spikes.

Choice Benefit Cost
Shorter period Earlier signals, closer to price More false signals and whipsaws
Longer period Smoother, fewer false signals Later entries and exits, more profit given back
EMA or WMA instead of SMA Faster response to turns More sensitive to one-off spikes

There is no setting that removes this tradeoff. Optimizing the period on past data to find the "best" one tends to produce settings that fit the past and fail in the future. See overfitting.

What the evidence says

Moving average rules are among the most studied technical tools. Brock, Lakonishok and LeBaron (1992) found that simple moving average rules on the Dow Jones index had predictive power over a long historical sample, but later work that adjusted for data snooping found the effect did not persist in more recent data. More broadly, the academic research on time-series momentum supports the idea that trend-following rules, often built from moving averages, have historically earned returns across diversified futures portfolios over long periods. That success has come with long flat or losing stretches and depends on trading many markets with disciplined risk control. See trend following.

For a single stock or crypto asset, a crossover rule may beat or trail buy-and-hold depending on the period tested. Results are sensitive to the period, the asset and costs.

Common mistakes

  • Expecting averages to predict. A moving average summarizes the past. Crossovers confirm a move that has already happened.
  • Using crossovers in ranges. Sideways markets produce repeated whipsaws and a string of small losses.
  • Over-optimizing the period. The 47-day average that worked best last year is unlikely to be special next year.
  • Stacking many averages. Five moving averages on one chart are five versions of the same information.
  • Treating the 200-day as a wall. Price can and does cut straight through widely watched averages.

FAQ

What is the difference between SMA and EMA?

An SMA gives every period in its window equal weight, while an EMA gives more weight to the most recent prices. The EMA reacts faster to sudden changes but is also more sensitive to one-off spikes.

Which moving average is best for day trading?

There is no best setting. Day traders often use short EMAs, such as 9 or 20 periods, on 1- to 15-minute charts, along with intraday benchmarks such as VWAP, but the choice should be tested on the market and timeframe being traded.

What is a golden cross?

A golden cross occurs when the 50-day moving average crosses above the 200-day moving average. It is widely reported as a bullish sign but is a slow signal that often comes after much of the move has happened.

Why is the 200-day moving average important?

It is the most widely watched long-term trend line, especially for stock indices, so many traders and media outlets track whether price is above or below it. That attention can cause reactions near it, but it is a convention, not a law.

Educational content only. Nothing here is financial, investment, legal or tax advice. Trading carries a high risk of loss, and leveraged products can lose more than you deposit. Rules, fees and platform details change: check current terms with your broker, exchange or regulator before you trade.