In short: A moving average (MA) is the average closing price over the last N periods. The line smooths the price and shows the direction of the trend. It always lags behind the price and gives many false signals in sideways markets.
See also the practical example in Moving Averages in Practice. This tutorial explains the theory.
What is a moving average?
A moving average is recalculated every period. A 50-day average is the average of the last 50 closing prices. A day later the oldest price drops out and the newest is added, so the line “moves” along.
The aim is to remove noise. You see more quickly whether the price is moving up, down or sideways overall.
SMA and EMA
SMA (simple moving average)
The SMA is the ordinary average. An example with 5 closing prices: €10, €12, €11, €13 and €14. The 5-day average is (10 + 12 + 11 + 13 + 14) ÷ 5 = €12. The next day the price closes at €16. The oldest price (€10) drops out: (12 + 11 + 13 + 14 + 16) ÷ 5 = €13.20.
EMA (exponential moving average)
The EMA gives new prices more weight. The weighting factor is 2 ÷ (N + 1). For N = 5 that is 2 ÷ 6 = 0.333. Take the previous EMA of €12 and a new close of €16: EMA = 16 × 0.333 + 12 × 0.667 = €13.33. So the EMA sits slightly higher than the SMA (€13.20) and reacts faster.
Which one do you choose?
An EMA reacts faster, an SMA is calmer. Neither is “better”. Many traders use the SMA for long-term levels (such as 200 days) and the EMA for the short term (such as 9 or 20). Pick one and stay consistent.
What can you do with it?
1. The direction of the trend
- Price above a falling or flat average: no clear rise.
- Price above a rising average: uptrend.
- Price below a falling average: downtrend.
Many traders use the 200-day average as a filter: only buy when the price is above it. This is a rule of thumb, not a rule of the market.
2. Dynamic support and resistance
In a trend the price sometimes returns to an average (for example the 20-day or 50-day) and then continues. The average then acts as “moving support” or resistance. This fails more often in weak trends. You can read more about levels in Support and Resistance.
3. Crossovers
- Price crosses the average: the price closes above or below the line. This can be a first sign of a new direction.
- Two averages cross: a short average (for example 50 days) crosses a long average (200 days). A cross upward is called a golden cross, downward a death cross.
Crossovers come late. When the average crosses, the price has often already moved a lot. So you get confirmation, but a worse entry price.
Worked example (hypothetical)
Suppose stock X is at €52 and the 200-day average is at €47. The price is therefore above the average. You wait for a pullback to the 50-day average at €50 and see a rising candle there. You buy at €50.40.
- Stop-loss: €48.90 (below the 50-day average and the latest low). Risk per share: €50.40 − €48.90 = €1.50.
- Price target at a ratio of 2:1: €50.40 + 2 × €1.50 = €53.40.
This is a calculation example. The price can also fall through the average; then your stop-loss limits the loss. Decide your number of shares with the position size calculator.
Limitations
- Always behind: an average is based on the past. It predicts nothing.
- Sideways market (whipsaw): the price keeps crossing the average back and forth. Every signal looks valid and every signal produces a small loss, plus costs.
- Settings are not universal: 50 and 200 are habits, not laws. Anyone who keeps adjusting the setting until it fits history builds a system that often disappoints in the future (overfitting).
- Differs per market and timeframe: on a 5-minute chart of a stock it works differently than on a weekly chart of an index.
- Do not use alone: combine an average with, for example, volume or RSI, and with a stop-loss.
Practice questions
Try to answer these yourself. The answers are in the text above.
- What is the difference between an SMA and an EMA?
- Why does a golden cross usually come late?
- What happens to crossover signals in a sideways market?
- Why is the 200-day average no guarantee of a rising price?
What next?
First test on historical data how an average works on your market (see Backtesting Your Trading Strategy). Use a demo account to practise, and always decide your risk per trade in advance with the risk-per-trade tool.
Work it out yourself
Test yourself
Practice questions to check your understanding, not advice.
The last five closes are €10, €12, €11, €13 and €14. What is the 5-day SMA?
- €11
- €13
- €12
Show answer
Answer:C. €12
(10 + 12 + 11 + 13 + 14) ÷ 5 = €12.
The next close is €16 and the oldest (€10) drops out. What is the new 5-day SMA?
- €13.20
- €12.00
- €14.00
Show answer
Answer:A. €13.20
(12 + 11 + 13 + 14 + 16) ÷ 5 = €13.20. The average moves along: the oldest price drops out and the newest is added.
What is the difference between an EMA and an SMA?
- An EMA weighs all prices equally
- An EMA gives recent prices more weight and reacts faster
- An EMA does not lag behind price
Show answer
Answer:B. An EMA gives recent prices more weight and reacts faster
The EMA weighs new prices more heavily and reacts faster. Faster is not automatically better: an EMA also gives more false signals.
What happens to crossover signals in a sideways market?
- They become more reliable
- They disappear
- Price keeps crossing the average back and forth, mostly producing small losses and costs
Show answer
Answer:C. Price keeps crossing the average back and forth, mostly producing small losses and costs
In a sideways market (whipsaw), every crossover looks like a signal. An average lags, so this mainly produces small losses and costs.
Frequently asked questions
- What is the difference between an SMA and an EMA?
- An SMA (simple moving average) counts all prices in the period equally. An EMA (exponential moving average) gives recent prices more weight and so reacts faster. Faster is not automatically better: an EMA also gives more false signals.
- Which period should I choose?
- There is no best setting. Commonly used are 20 (short term), 50 (medium term) and 200 (long term). A short period reacts quickly but is noisy. A long period is calmer but lags more. Test on historical data what suits your market and timeframe.
- What are a golden cross and a death cross?
- In a golden cross a shorter average (often 50 days) moves above a longer average (often 200 days). A death cross is the opposite. Both signals come late, because the price has usually already moved a good way. They are not forecasts.
- Why do moving averages give false signals?
- An average is calculated from past prices and therefore lags. In a sideways market the price crosses the average back and forth. Every cross looks like a signal, but mostly it produces small losses and costs.
- Do moving averages also work for crypto?
- You can use them, but crypto is more volatile and trades 24 hours a day. Daily closing prices depend on the time at which the exchange ends the day. So test settings separately for crypto and adjust your risk.