The strategy that I am currently developing performs very well in the strategy tester, but when I do forward testing it fails.
How can I shorteh the gap between strategy tester data and forward testing?
1. Use a Long Time Range: Perform a backtest of at least 2-3 years (for example from January 1, 2024 to the present) to see the resilience of the strategy in various market conditions.
The appropriate length of a backtest depends on the trading frequency of the EA being tested. In other words, I use a minimum of 10 years for a swing trading strategy that trades 2 or 3 times per week. For a scalping strategy that trades over 100 times per month. I regard the test sample size as the total number of trades─not necessarily the total number of months, years, etc.
2. Every Tick Based on Real Ticks: This is mandatory, so that the price simulation is close to actual market movements.
Testing on real ticks is mandatory for EA's that trade on every tick. In contrast, EA's that trade only on OHLC data can more efficiently be tested for longer periods of time on OHLC prices only. The issues of live spread and slippage can be mitigated by knowing/researching your broker-dealer's average spread and average slippage, and entering that information into the Tester. There are free utilities published in the CodeBase for collecting such data.
Testing on real ticks is mandatory for EA's that trade on every tick. In contrast, EA's that trade only on OHLC data can more efficiently be tested for longer periods of time on OHLC prices only. The issues of live spread and slippage can be mitigated by knowing/researching your broker-dealer's average spread and average slippage, and entering that information into the Tester. There are free utilities published in the CodeBase for collecting such data.
I've experimented with this, but didn't now that there were utilities in the CodeBase.
I'll experiment with this.
Thx!
The strategy that I am currently developing performs very well in the strategy tester, but when I do forward testing it fails.
How can I shorteh the gap between strategy tester data and forward testing?
A strategy that performs well in backtesting but fails in forward testing is usually overfitted to historical data. To reduce the gap:
- Use out-of-sample and walk-forward testing.
- Include realistic spread, slippage, commissions, and execution delay.
- Avoid over-optimization; simpler strategies are usually more robust.
- Test across different market conditions.
- Focus on real market logic, not only historical profit curves.
Also, backtest data will never be identical to real market data. Historical tick data is often compressed or averaged, while real markets may generate far more ticks inside each candle.
Many small price movements are lost in historical data, which is why forward testing is essential before going live.
Good points. I’d add one more check: separate the strategy logic from the execution assumptions and test them in two steps. First verify the entry/exit edge on out-of-sample data, then rerun with realistic spread, commission, and delay assumptions. If the edge disappears only after costs are added, the issue is probably that the expected move is too small for live conditions rather than a coding problem. If you want, I can help you outline a simple walk-forward test matrix for this.
That's a really good point!
The first draft of any EA that I code is basically "blind" other than entries and exits. If my test of that first draft EA doesn't approach a profit factor of 2.0 (or other impressive stats), I don't bother to refine that first draft. By the time that weekends, overnights, hours, spread, commission, swaps, and slippage are factored into a subsequent draft, a weak first draft simply isn't worth the effort─because of the "disappearing edge" that you mention.
Put simply, I don't spend time trying to resurrect a junk EA. Also, I really can't even recall the last time that I used the Optimizer.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
The strategy that I am currently developing performs very well in the strategy tester, but when I do forward testing it fails.
How can I shorteh the gap between strategy tester data and forward testing?