Loading live market prices…

Forex Trading · lesson 20 of 33

Moving Averages Explained

3 min readBy the Pajama Markets team

Learn this in a 5-minute interactive lesson

Real charts and practice questions. Free, no sign-up needed.

Start lesson 20

What an indicator is

An indicator is a calculation based on price (and sometimes volume) that's drawn on or under the chart. Indicators don't know anything the chart doesn't. They just reorganise the same information so it's easier to see. The moving average is the simplest and most popular one.

Simple and exponential

A simple moving average (SMA) is the average closing price over a set number of candles. A 20-period SMA on a 4-hour chart is the average of the last 20 four-hour closes. Each time a new candle closes, the oldest one drops off and the newest is added, which is why the average "moves."

Worked example
A 5-period simple moving average

The last five closes on EUR/USD were 1.1150, 1.1160, 1.1145, 1.1170, and 1.1175.

Add them up: 1.1150 + 1.1160 + 1.1145 + 1.1170 + 1.1175 = 5.5800.

Divide by 5: 5.5800 ÷ 5 = 1.1160.

When the next candle closes, drop the 1.1150, add the new close, and do it again. Thank goodness the platform does this for you.

An exponential moving average (EMA) gives more weight to the most recent prices, so it reacts faster when the price changes direction. Many traders prefer EMAs for that reason. Common settings are the 20 (short term), the 50 (medium term), and the 200 (long term).

Step by step
Adding a moving average

MetaTrader: Insert → Indicators → Trend → Moving Average. Set the Period (for example 50), the MA method to Exponential, and Apply to Close. Pick a colour and click OK.

TradingView: click Indicators, search for "EMA," click it, then click the settings cog on the chart to change the length.

How traders use them

A 20 EMA (blue) and a 50 EMA (gold). In the uptrend, price stays above both lines, the lines slope upwards, and pullbacks often stop near them. When the market goes sideways on the right, the lines flatten and tangle and price chops back and forth through them. Pajama Markets diagram. Illustrative data.
A 20 EMA (blue) and a 50 EMA (gold). In the uptrend, price stays above both lines, the lines slope upwards, and pullbacks often stop near them. When the market goes sideways on the right, the lines flatten and tangle and price chops back and forth through them. Pajama Markets diagram. Illustrative data.

Trend direction. If price is above a rising moving average, the trend is up. If it's below a falling one, the trend is down. A flat moving average with price crossing back and forth means there's no trend.

Dynamic support and resistance. In a trend, pullbacks often stop near the 20 or 50 EMA, so they act like moving support (in an uptrend) or resistance (in a downtrend).

Crossovers. When a faster average crosses above a slower one, some traders read it as a buy signal, and below as a sell signal. The famous ones are the golden cross (the 50 crossing above the 200) and the death cross (the 50 crossing below the 200), which sound like something out of a fantasy film but are really just two lines touching.

The catch: lag

Moving averages are built from past prices, so they always lag. By the time two averages cross, a big chunk of the move has often already happened. And in a sideways market, averages cross back and forth again and again, giving a string of losing signals. Traders call this getting whipsawed. A moving average is a great way to see the trend and spot pullbacks. It's a bad way to predict the future on its own.

Key terms from this lesson

Indicator
a calculation based on price, drawn on or below a chart.
Simple moving average (SMA)
the average closing price over a set number of periods.
Exponential moving average (EMA)
a moving average that gives more weight to recent prices.
Dynamic support / resistance
a moving level, such as a moving average, that price tends to react to.
Crossover
when one moving average crosses another.
Lag
the delay between a change in price and the indicator showing it.
Whipsaw
repeated false signals in a choppy market.
Full trading glossary →

Learn this in a 5-minute interactive lesson

Real charts and practice questions. Free, no sign-up needed.

Start lesson 20

Related guides

Pajama Markets provides education, not financial advice. Trading forex, crypto and leveraged products carries a high risk of losing money. Practise on a demo account first.