Moving average crossover strategy
The moving average crossover is the classic trend-following strategy: buy when a fast average crosses above a slow one, sell when it crosses back. It is simple, mechanical and a good first strategy to test.
In short
- Uses two moving averages – for example 20 and 50 periods.
- Buy when the fast one crosses above the slow one; exit or go short when it crosses back below.
- Catches big trends, but gives many small losing trades when the market moves sideways.
The idea
A moving average smooths out the price. When a short average rises above a long one, recent prices are higher than older prices – the market is trending up. The strategy does not try to predict; it follows. It will always be late at the start and late at the end of a trend, but it is in the market for the big middle part. Learn more in the guide to moving averages.
The rules
| Step | Rule |
|---|---|
| Market | A trending market such as EUR/USD, gold or an index, on the 4-hour or daily chart. |
| Entry long | The fast EMA (e.g. 20) closes above the slow EMA (e.g. 50). |
| Entry short | The fast EMA closes below the slow EMA (optional – many only trade long on indices). |
| Stop loss | Below the last swing low, or 2 × ATR from the entry. |
| Exit | The opposite crossover, or a trailing stop. |
| Filter (optional) | Only trade in the direction of the 200-period average. |
Example
On the daily chart of EUR/USD, the 20 EMA crosses above the 50 EMA at 1.0850. The last swing low is at 1.0760, so the stop is 90 pips away. With $10,000 and 1% risk, the position is $100 ÷ (90 × $10) = 0.11 lots. The trend runs to 1.1250 before the 20 EMA crosses back down at 1.1180: a gain of 330 pips – more than three times the risk. The next three signals are small losses. That is how trend following usually looks: a few big wins pay for many small losses.
When it works – and when it does not
Works best: trending markets with long, steady moves – such as gold in a strong year or an index in a bull market.
Struggles: sideways markets, where the averages cross back and forth and every signal is a small loss.
Build it as a robot
You can build this strategy in our free algo builder: choose “Moving average crossover”, pick EMA or SMA and the two periods, and download a robot for MetaTrader 4, MetaTrader 5, cTrader or TradingView. You can also test it on historical data directly in the builder.
Test before you trust it
No simple strategy wins all the time. Before you use real money, test the rules on several years of data and at least two markets, include spreads and commission, and look at the worst drawdown – not just the profit. Then trade it on a demo account for a few weeks. Settings that look perfect on past data are often just fitted to the past; that is called overfitting. Use the Monte Carlo simulator to see what losing streaks your win rate can produce.
Remember
The strategy decides when to enter. Your position size and stop decide whether you survive the losing streaks every strategy has.
Questions and answers
Which moving averages are best for a crossover?
There is no best pair. 20/50 and 50/200 are common. Shorter averages give more signals and more false ones; longer ones give fewer, later signals.
Is the golden cross the same strategy?
Yes – the golden cross is a crossover of the 50- and 200-day averages, usually on indices or stocks.
Why do I lose on most crossover trades?
Because markets move sideways much of the time. Trend strategies usually have a low win rate and rely on a few large winners.
Follow the markets
More guides
- Leverage and margin explained
- Stop loss: how to place it properly
- Risk management for traders
- Support and resistance
- Moving averages explained
- RSI and MACD explained
A Scandinavian broker with low spreads and the platforms you already know – Skilling Trader, cTrader, MetaTrader and TradingView.
- Spreads from 0.1 pips1,000+ instruments
- Four platformsSkilling Trader, cTrader, MetaTrader, TradingView
- Lloyd's account insuranceUp to €1 million per account
- Free demo accountPractise with real prices, no risk

65% of retail investor accounts lose money when trading CFDs with this provider.
About this content: Our articles explain how trading works, with an emphasis on risk. They are general information and not personal investment advice.