Library · Indicators

Moving Averages

A moving average is a line that shows the average price over a set number of recent candles, smoothing out short-term noise so the general direction is easier to see.

  • Beginner
  • 5 min read
  • Updated

Why it matters

Price rarely moves in a straight line. Individual candles jump up and down, and it can be hard to tell whether the market is drifting higher, lower or nowhere. A moving average (MA) replaces that jagged path with one smooth line.

Moving averages are also the building blocks of many other tools. MACD, Bollinger Bands and several channel indicators are all constructed from them, so understanding the average makes the rest of the shelf easier.

What it looks like

EMA 10EMA 20EMA 50
Three moving averages on a rising market. The shortest hugs price, the longest trails well behind, and in a steady trend they stack in order. Hypothetical data for illustration.

A moving average is an overlay: a line drawn directly on the candles. It is called “moving” because the window of candles it averages slides forward by one each time a new candle closes.

In plain words

Think of a student’s average mark over their last five tests. One bad test pulls the average down a little, not all the way. When a new test arrives, the oldest one drops out. The average tells you how things have been going lately. It says nothing about the next test.

How it is calculated

The simplest version adds up the last N closing prices and divides by N. N is called the period or length.

Moving average = (sum of the last N closes) / NThis is the simple moving average. Other types use the same idea with different weights.

A 5-period average, step by stepHypothetical illustration

A hypothetical asset closes at 100, 102, 104, 103 and 106. The sum is 515, so the 5-period average is 515 / 5 = 103.

The next candle closes at 108. The oldest close (100) leaves the window and 108 enters. The sum is now 102 + 104 + 103 + 106 + 108 = 523, and the average is 523 / 5 = 104.6.

Price rose 2 on the last candle. The average rose 1.6, helped by a low old value leaving the window.

Types of moving average

The two most common types

SMA

Simple moving average.

  • Every close in the window counts equally
  • Smoother and slower
  • Old closes drop out all at once

EMA

Exponential moving average.

  • Recent closes count more
  • Turns sooner after price turns
  • Old closes fade out gradually

The SMA and the EMA are by far the most widely used. Neither is more “accurate”. They make different trade-offs between smoothness and speed, which the EMA vs SMA page compares side by side.

SMA 20 (slower)EMA 20 (reacts faster)
The same 20 periods, two calculations. The EMA reacts sooner when price changes direction; the SMA is smoother. Hypothetical data for illustration.

Settings and what they change

Period Character Commonly described as
9 to 21 Fast, close to price, turns often Short-term
50 Middle ground Medium-term
100 to 200 Slow, far from price, turns rarely Long-term

These numbers are conventions, not special values. A short period reacts quickly and produces more false turns. A long period is steadier and reacts late. Changing the period trades one weakness for the other.

The period counts candles, not days. A 20-period average covers 20 hours on a 1-hour chart and 20 days on a daily chart.

How to read it

  • Slope. A rising line means the average price has been increasing. A falling line means it has been decreasing. A flat line often accompanies a range.
  • Price relative to the line. Price above the average means recent closes are higher than the average of the window. Price below means the opposite.
  • Distance. When price stretches far from the average, some traders describe the market as extended. The gap can close by price coming back or by the average catching up.
  • Order of several averages. In a steady uptrend, shorter averages tend to sit above longer ones. When the lines tangle together, the market is usually moving sideways.

Going deeper

Moving averages as moving levels

In trends, price often pulls back toward a moving average before continuing. Traders call this dynamic support and resistance. The line is not a wall. It marks the area where price returns to its recent average, and widely watched averages can attract attention simply because many people draw them.

Crossovers

When price crosses an average, or a fast average crosses a slow one, traders call it a crossover. A crossover records that the short-term average has moved past the long-term one. It is a fact about past data, and it always arrives after the turn in price that caused it.

Where they struggle

SMA 20
In a sideways market, price crosses the average again and again and the line flattens. The average has little to say here. Hypothetical data for illustration.

Moving averages describe trends. In a range there is no trend to describe, so price whips back and forth across the line. These repeated false starts are known as whipsaws.

What it does NOT mean

  • Price above a moving average does not mean the market keeps rising. It means recent closes are above their own average. That was also true at every market top.
  • A moving average is not a support level that must hold. Price crosses averages constantly.
  • No period is the “right” one. 50 and 200 are popular because they are popular, not because of any mathematical property.
  • A crossover is not a signal. It describes what the averages have already done.

Common mistakes

  1. Expecting an average to lead. It is built from past closes and can only follow.
  2. Using trend tools in a range. Sideways markets produce whipsaw after whipsaw.
  3. Searching for the perfect period. A length tuned to fit the past chart is a case of overfitting and usually stops fitting on new data.
  4. Adding too many lines. Five averages on one chart are five versions of the same closes.
  5. Ignoring structure. Swing highs and lows show a trend directly. The average is a summary of them.

Risks and limitations

  • Moving averages lag. The longer the period, the later they react.
  • They give frequent false readings in choppy or sideways markets.
  • They use closing prices only, so they ignore volume, wicks and anything outside the chart.
  • Different platforms may use different price inputs or types by default, so the “same” average can differ slightly between charts.

Key takeaway

A moving average is a smoothed picture of where price has been. It makes direction easier to see and it reacts late by design.

Sources and further reading

  • Technical Analysis of the Financial Markets, John J. Murphy (1999). Chapter on moving averages