The Moving Average Crossoverthe most-tested rule in trading
A fast average crosses a slow one and you take the position. It is the first system almost everyone builds and it has been tested more times, by more people, than any other rule in this library.
The results of all that testing are consistent and unflattering: the effect is real and small, it has weakened over time, and the specific pair of lengths does not matter nearly as much as people think. What matters is that it is a trend filter, and what it costs is a large number of whipsaws in ranging markets.
This is one of the first methods most traders meet. That popularity is a reason for caution rather than confidence — an edge available to everyone for decades is unlikely to still be sitting there.
- Category
- Foundations · Trend
- Timeframe
- D1 for the classic version · H4 for a faster one
- Suitable pairs
- Instruments that trend — majors, gold, indices
- Session
- Bar close
- Indicators / tools
- EMA(20) and EMA(50) · ATR(14)
Valid setup
Exact rules
Entry
- Long when the EMA(20) closes above the EMA(50). Short at the mirror. That is the whole signal.
- Enter at the close of the crossing bar, not intrabar. An average that has crossed and uncrossed within a bar has not crossed.
- Do not add confirmations. Every indicator added to this is another parameter to fit, and the published testing does not support any of them.
- The classic version uses 50 and 200 on a daily chart. Those need more history than a single screen can show; the logic is identical and the horizon is longer.
Stop loss
- 2 × ATR(14) from entry.
- The crossover on its own has no stop — a pure version reverses on the opposite cross. Adding a stop changes the strategy and should be tested as a change, not assumed to be an improvement.
- Risk 0.5%–1%.
Take profit / exit
- No target. Exit on the opposite cross, or on the stop.
- Expect a hit rate around a third and a long tail of small losses between the few large wins. That shape is not a fault in your implementation.
- If your version has a high hit rate, you have added something to it, and that something is where the risk now lives.
Build The Moving Average Crossover
Reading this page is free and always will be. Taking it is what costs — the complete MQL5 for the rules above, yours to keep, permanently. Five of them cost $10 and they never expire.
More from Foundations
Trading carries risk and most retail accounts lose money. Nothing on this page is financial advice or a recommendation to trade. The chart is an illustration of the rules on constructed candles — it is not a record of a trade and not a backtest.
