The rules tested
The strategy buys EUR/USD when the 20-bar exponential average crosses above the 50-bar one, and sells when it crosses back below. Stop loss at 2 ATR, take profit at 3 ATR, 1% of the account at risk per trade, on 1-hour bars.
- Instrument
- EUR/USD
- Timeframe
- 1 hour (H1)
- Entry
- crossover of two exponential moving averages of 20 and 50 bars
- Filters
- none
- Stop loss
- 2 times the 14-bar ATR
- Take profit
- 3 times the 14-bar ATR
- Other exits
- none
- Risk per trade
- 1% of the virtual account, position size set from the stop distance
- Costs
- spread actually recorded hour by hour, slippage of half a spread on every stop, no commission; swaps not included
- Period tested
- from August 1, 2022 to September 25, 2026
The button opens the lab with exactly these settings: change one, run it again and compare.
A raw edge that costs wipe out
Without spread or slippage, the rule would have made 20.6% over the period, an average of +0.053 R per trade in multiples of the risk taken. With costs, it loses 19.1%, or -0.044 R per trade. The spread paid on every entry and the slippage taken on stops average 0.07 R per trade: more than the rule's entire raw edge.
- Without spread or slippage
- With costs
Costs do not simply come off the final result. A buy fills at the ask, slightly above the quoted price, so the stop loss and take profit set from that price end up one a little closer and the other a little further away. A sell takes the same shift on the way out. Some trades that would have reached their target hit their stop instead, and over 413 trades those small shifts add up.
No nearby setting does any better
The loss is not down to an unlucky parameter. With a slow average anywhere from 25 to 100 bars, all nine settings tested lose, from -9.3% for the least bad to -26.2% for the worst. The design period (-10.6%) and the out-of-sample period (-9.5%) point the same way. Longs and shorts both lose as well, -8.3% and -11.8%: the rule is not hurt by a one-way market, it is hurt by its costs.
What this test says about moving average crossovers
A moving average crossover on one-hour bars of a very liquid pair produces plenty of signals for a tiny raw edge, when there is one at all. That is exactly the profile costs punish the most. A backtest that ignores the spread, or books it at its lowest value, shows the “without spread or slippage” line; a live account lives the “with costs” one. It is one of the reasons, covered in our article on whether forex trading robots actually work, why a simple idea that looks fine on a chart fails once it trades.
By contrast, in the 20-bar breakout on gold (XAUUSD), costs barely register: fewer trades, and stops that are very wide compared with the spread. To see how the lab charges the spread hour by hour, read the lab's Method section.
Design period against out-of-sample
Design period: Aug 1, 2022 to Jun 27, 2025
- Result
- -10.6%
- Trades
- 292
- Maximum drawdown
- 24.7%
- In R
- -9.1 R
Out-of-sample: Jun 27, 2025 to Sep 25, 2026
- Result
- -9.5%
- Trades
- 121
- Maximum drawdown
- 22.1%
- In R
- -9.1 R
Tune the strategy while looking at the design period, then judge it on the out-of-sample period, which played no part in the tuning. A wide gap between the two often means the settings were fitted to the past.
Sensitivity of the main setting
Year by year
| Year | Trades | Result (R) |
|---|---|---|
| 2022 | 37 | -2.4 R |
| 2023 | 100 | +3.5 R |
| 2024 | 107 | -14.0 R |
| 2025 | 95 | +8.4 R |
| 2026 | 74 | -13.8 R |
In R, the multiple of the risk taken on each trade: a yearly total cannot be read as a % of the account, since gains and losses compound from one year to the next.