A moving average smooths price into a single line so the direction is easier to see. It is one of the oldest indicators, and it is simple enough to calculate by hand. Doing it once removes the mystery, and it shows why two averages with the same length can behave differently.

The Simple Moving Average (SMA)

The SMA is the plain average of the last N closing prices. Take ten closes: 100, 102, 101, 103, 105, 104, 106, 108, 107, 110. A 5-period SMA starts once you have five prices:

  • Average of the first five (100, 102, 101, 103, 105) = 102.2.
  • Drop 100, add 104: the average of 102, 101, 103, 105, 104 = 103.0.
  • Next: 103.8.
  • Then: 105.2, 106.0 and 107.0.

Each new bar adds the latest price and drops the oldest one, so the average moves along with the market. Every price in the window has the same weight.

The Exponential Moving Average (EMA)

The EMA gives more weight to recent prices. The multiplier is 2 ÷ (N + 1), which is 2 ÷ 6 = 0.3333 for a 5-period EMA. The formula for each new bar is:

EMA = (close × multiplier) + (previous EMA × (1 − multiplier)).

The first EMA value is usually seeded with the SMA, which is 102.2. Then:

  • Next close 104: 104 × 0.3333 + 102.2 × 0.6667 = 102.8.
  • Next close 106: 106 × 0.3333 + 102.8 × 0.6667 = 103.87.
  • Next close 108: 105.25.
  • Next close 107: 105.83.
  • Next close 110: 107.22.

Compare with the SMA at the last bar: the SMA is 107.0 while the EMA is 107.22. The EMA is higher because it weighted the recent jump to 110 more heavily. In a rising market, the EMA sits closer to price, and in a falling market it drops faster.

Choosing a Length

  • Short averages (such as 10 or 20) follow price closely and give earlier signals, but also more false ones.
  • Long averages (such as 50, 100 or 200) are slower and smoother, and are often used to judge the larger trend.
  • There is no best number. Common choices are popular partly because many traders watch them, which can make them self-reinforcing.

Common Ways to Use Them

  • Trend direction: price above a rising average suggests an uptrend, and below a falling one suggests a downtrend.
  • Dynamic support and resistance: in a strong trend, price often bounces off a moving average such as the 20 or 50.
  • Crossovers: when a short average crosses above a long one, some traders see a bullish signal, and the reverse as bearish. The 50-day crossing above the 200-day is often called a golden cross, and the opposite a death cross.

The Limits

A moving average is a lagging indicator. It uses past prices, so it tells you what has happened, not what will happen. In a sideways market, crossovers produce many small losses, often called whipsaws. By the time a long average turns, a large part of the move may be over. The indicator also does not tell you where to place a stop or how big a trade should be.

Our guide to technical analysis basics shows how it fits with other tools.

A Practical Approach

  • Use one moving average to define the trend and one price level to define the entry.
  • Test your choice on past data before risking money, and count how often it would have helped.
  • Combine it with risk rules: decide the stop first, then the size. Our forex risk management guide explains how.

A Simple Check

Pick a chart, plot a 20-period EMA and a 50-period SMA, and look at ten past crossovers. How many led to a good move, and how many were noise? This is educational, not investment advice.