Lesson 04 · Trend following
Moving Average Crossover Strategy
1 of 13
Overview
The moving average crossover strategy buys when a short-term average price rises above a longer-term one, and gets out when it drops back below. It is a simple trend following system: it doesn’t try to predict, it waits for a trend to appear and then follows it.
- Timeframe
- Daily or 4-hour charts
- Markets
- Shares, indices, forex, commodities
- Difficulty
- Beginner
Builds on: Trading for Beginners: The Basics, Position Sizing and the 1% Rule in Trading, ATR Stop Loss and Position Sizing, Breakout Trading Strategy: Support and Resistance Breakouts
See it on a chart
- Price (candles)
- 20-period SMA
- 50-period SMA
- Long signal
- Short / exit signal
The 20-period average (gold) crosses above the 50-period average (blue): buy. Later it crosses back below: get out. Prices are made up for illustration.
What is a moving average?
A moving average is the average closing price over a set number of recent candles. A 20-day moving average adds up the last 20 daily closes and divides by 20. Each day it drops the oldest price and adds the newest, so the line “moves”1.
It smooths out day-to-day wobbles so you can see the direction of the trend. A simple moving average (SMA) counts every candle equally. An exponential moving average (EMA) gives more weight to recent prices, so it reacts faster1.
Worked example: a 5-day simple moving average
- Last five closes
- £50, £52, £51, £53, £54
- Add them up
- £260
- Divide by 5
- £52
- Next day the close is £56. Drop the oldest (£50), add the newest
- £52 + £51 + £53 + £54 + £56 = £266
- Divide by 5
- £53.20
- The average “moves” from £52 to £53.20
- +£1.20
What is a moving average crossover?
The strategy uses two moving averages: a fast one (for example 20 periods) and a slow one (for example 50 periods).
When the fast average crosses above the slow one, recent prices are higher than older prices, a sign an uptrend may be starting. When it crosses back below, the uptrend may be over1.
Two crossings have their own names. When the 50-day average crosses above the 200-day average, it is often called a golden cross. The opposite is called a death cross1.
What each crossing means
| What you see | What it suggests |
|---|---|
| Fast average crosses above the slow one | An uptrend may be starting: the buy signal |
| Fast average crosses below the slow one | The uptrend may be over: get out |
| 50-day crosses above the 200-day | A golden cross |
| 50-day crosses below the 200-day | A death cross |
Why trend following can work
Markets sometimes trend for months. A crossover system doesn’t try to guess when a trend will start. It waits until the averages confirm one, then rides it.
The trade-off is many small losses in exchange for the occasional big win. Trend following systems often win fewer than half their trades and still make money, because the winners are much bigger than the losers. That is the expectancy idea from Lesson 3.
Ten trend-following trades: few wins, but big ones
Only 3 wins out of 10, but they add up to +11R. The 7 losses cost −7R. Total: +4R. Made-up numbers for illustration.
When crossovers fail: whipsaw and lag
In a sideways market the averages tangle together and cross back and forth. Each false signal is a small loss. This is called whipsaw1.
- Price (candles)
- 5-period SMA
- 15-period SMA
- Long signal
- Short / exit signal
Whipsaw: in a sideways market the two averages tangle and cross again and again. Each signal is followed by a small loss. Prices are made up for illustration.
Moving averages also lag: they are built from past prices, so they only turn after a move has begun1. You miss the start of a trend and give some back at the end.
Many traders add a filter. One is to buy only when price is above the 200-day moving average, a common marker of the long-term trend3. Another uses the ADX (Average Directional Index), an indicator that measures how strong a trend is, but not its direction. Readings above 25 suggest a strong trend, and readings below 20 suggest little or no trend2.
Reading the ADX (trend strength, not direction)
A crossover when ADX is under 20 is more likely to be whipsaw. ADX doesn’t say whether the trend is up or down.
Choosing settings, and the danger of overfitting
Shorter averages give earlier signals but more false ones. Longer averages give fewer, later and more reliable signals. Common pairs are 9/21 for short-term trading, 20/50 for trades lasting weeks, and 50/200 for long-term trends.
No setting is “best”. Test your choice on past data. But be careful: if you keep adjusting the settings until they fit the past perfectly, you are overfitting. The results then tend to disappoint on new data.
Common pairs of averages
| Pair | Used for | Signals |
|---|---|---|
| 9 / 21 | Short-term trading | Early, but more false ones |
| 20 / 50 | Trades lasting weeks | In between |
| 50 / 200 | Long-term trends | Late, fewer, more reliable |
Moving average crossover trading rules
Entry
- Buy when the fast average closes above the slow average. Wait for the candle to close.
- Optional filter: only buy when price is above the 200-period average.
- Sell short (if your account allows) when the fast average closes below the slow one.
Exit
- Get out on the opposite crossover, or
- Use a trailing stop, for example below the slow average or 2–3 × ATR below price, to lock in gains sooner.
Risk
- Put the first stop below the most recent swing low.
- Risk 0.5–1% of your account per trade.
- Expect runs of small losses in sideways markets. Size so you can survive 10 or more in a row.
Worked example: a crossover trade on an index
- On a daily chart of a share index, the 20-day average has been below the 50-day for two months while price drifted lower.
- Price rallies, and the 20-day closes above the 50-day at 4,510. You buy when the market next opens, at 4,515.
- The most recent swing low is 4,420, so your stop goes there: 95 points of risk.
- Price trends up for six weeks. You trail your stop under the 50-day average.
- The 20-day finally crosses back below the 50-day, and you get out at 4,770. You made 255 points for 95 risked: about +2.7R.
Pros and cons of moving average crossovers
Strengths
- Completely rule-based, so it is easy to test and automate.
- Catches big trends when they happen.
- Works on any market and timeframe.
Weaknesses
- Late entries and exits, because averages lag.
- Repeated small losses (whipsaw) in sideways markets.
- Winning less than half the time can be hard to stick with.
Key terms
- Moving average
- The average closing price over a set number of recent candles.
- SMA / EMA
- A simple average weights every candle equally; an exponential average weights recent ones more.
- Golden cross / death cross
- The 50-day average crossing above / below the 200-day average.
- Whipsaw
- Repeated false signals in a sideways market.
- Lag
- An indicator turning only after price has already moved.
- ADX
- An indicator of trend strength (not direction). Above 25 is strong; below 20 is weak.
- Overfitting
- Tuning settings to fit past data so closely that they fail on new data.
Sources
Numbers in the lesson, like 1, point to these sources.
- Moving Averages – Simple and Exponential. StockCharts ChartSchool.
- Average Directional Index (ADX). StockCharts ChartSchool.
- Murphy, J. J. (1999), Technical Analysis of the Financial Markets. Book (New York Institute of Finance).
Lesson complete
You have reached the end of the lesson. Now test what you learned with the five-level quiz.
Quiz zone
Test yourself: Moving Average Crossover quiz
Five levels, from the basics to expert judgment. Clear each level to unlock the next.
- Level 1: Foundations. Recognise the strategy and its vocabulary.
- Level 2: Mechanics. Know how the signals and rules work, and why.
- Level 3: Application. Apply the rules to realistic chart situations.
- Level 4: Numbers & risk. Size, measure and manage the trade with real calculations.
- Level 5: Mastery. Judge edge cases, failure modes and market conditions.
Loading the quiz…
See all 30 questions in this quiz
The questions only. Answers and explanations appear when you take the quiz above.
Level 1: Know the parts of a crossover system
What does a 20-day simple moving average show?
- The highest price of the last 20 days
- How much the price moved in 20 days
- The average closing price of the last 20 days
- The price 20 days ago
In a crossover system, what is the classic buy signal?
- The slow average crosses above the fast average
- Both averages are flat
- The fast average crosses above the slow average
- Price touches the slow average
True or false: a “golden cross” usually means the 50-day average crossing above the 200-day average.
True or false?
What kind of market is a crossover strategy designed for?
- Markets that gap a lot
- Any market, equally well
- Trending markets
- Sideways markets
Level 2: Understand how signals behave
Why do moving average signals come after a trend has already started?
- The averages are drawn wrongly
- Averages are built from past prices, so they lag
- They only update once a week
- Brokers delay the signals
Compared with a 20-day SMA, a 20-day EMA…
- reacts slower
- reacts faster, because it gives recent prices more weight
- is exactly the same line
- ignores the most recent price
You switch from 50/200 averages to 10/30 averages. What will you most likely get?
- Fewer, more reliable signals
- More signals, with more of them false
- No signals at all
- Exactly the same signals
True or false: you should act on a crossover the moment the lines touch, even before the candle closes.
True or false?
What is whipsaw?
- A very strong trend
- A type of moving average
- A sudden gap
- Repeated false signals in a sideways market
Level 3: Use the rules on a chart
Over two months, the 20-day crossed above the 50-day three times and below it three times. Price stayed between £98 and £104. What’s happening?
- Whipsaw: the market is sideways, so crossovers are unreliable
- A golden cross
- A breakout
- A strong uptrend
Your rules only allow buying when price is above the 200-day average. The 20-day crosses above the 50-day, but price is below the 200-day. What do you do?
- Sell short
- Skip the trade
- Buy anyway
- Buy twice as much
You bought on a crossover. Price rallies hard and is far above both averages, but there’s no opposite cross yet. What’s a sensible way to protect your gains?
- Use a trailing stop, for example below the slow average
- Sell half and buy it back tomorrow
- Remove your stop
- Do nothing until the averages cross
Which market suits a crossover strategy best right now?
- An index that jumps up and down with no direction
- A share about to report results tomorrow
- A share stuck between £20 and £22 for six months
- A currency pair making steady higher highs and higher lows for three months
The ADX reads 15. What does that suggest?
- Little or no trend, so crossovers are more likely to whipsaw
- A strong uptrend
- The price will rise 15%
- A strong downtrend
The 50-day average crosses below the 200-day average. What is this called?
- A death cross
- A golden cross
- A retest
- A whipsaw
Level 4: Work out averages and results
The last five daily closes were £50, £52, £51, £53 and £54. What is the 5-day simple moving average, in pounds?
Type a number.
Carry on: the 5-day average was made from £50, £52, £51, £53 and £54. The next close is £56. What is the new 5-day average, in pounds?
Type a number.
Your account is £20,000 and you risk 1%. You buy at £80 with a stop at £76. How many shares so that hitting your stop loses only 1%?
Type a number (shares).
You buy an index at 4,515 with a stop at 4,420. How many points are you risking?
Type a number (points).
You bought at 4,515 with a stop at 4,420 and sold at 4,770. How many R did you make? Give two decimal places.
Type a number (R).
A crossover system wins 35% of trades. Wins average 3R and losses average 1R. What is its expectancy, in R a trade?
Type a number (R).
You take 10 trades. 3 win +4R each and 7 lose −1R each. What is your total result, in R?
Type a number (R).
Level 5: Judge results carefully
You tested lots of settings on five years of data. 17/43 averages did amazingly well, far better than 15/40 or 20/50. What is the main worry?
- The averages are too short
- Nothing: 17/43 is clearly the best
- Five years is too much data
- Overfitting: that result is probably luck that fits the past and won’t repeat
How can a system that wins 35% of the time make money while one that wins 60% of the time loses money?
- Win rate is the only number that matters
- The 35% system must be using luck
- It can’t: the 60% system always wins
- Profit depends on how big the wins and losses are, not just how often you win
Which change best reduces whipsaw without trying to predict the future?
- Only take crossovers when ADX is above about 20 to 25
- Trade more often
- Guess when the trend will start
- Use shorter averages
You’ve lost nine trades in a row during a sideways year. Your testing showed runs like this are normal. What does a disciplined trader do?
- Stop at once and switch strategy
- Skip the next few signals
- Keep following the rules at the same risk, and only review the system if losses go beyond what testing showed
- Double the risk to win it back
Why do the rules say to size so you can survive 10 or more losses in a row?
- Because 10 losses will definitely come next
- Sideways markets can give a long run of small losses before the next trend
- To make each trade bigger
- Brokers require it
Why might a trader use a trailing stop instead of waiting for the opposite crossover to exit?
- Crossovers never happen on exits
- Averages lag, so waiting for the cross can give back a lot of profit
- It means you never lose
- Trailing stops guarantee a bigger win
Your settings looked great on the past five years but disappoint on new data. What is the most likely reason?
- The new data is wrong
- Moving averages stopped working
- You need even more settings
- The settings were overfitted to the past
Many crossover systems only buy when price is above the 200-day average. What does this filter do?
- Keeps you trading in the direction of the long-term trend
- Gives you more signals
- Guarantees every trade wins
- Makes the averages react faster