Oversættelsen er undervejs. Indtil videre vises den engelske original.
Backtesting Basics: How to Test an EA Without Fooling Yourself
A backtest simulates a strategy on historical data — and it is dangerously easy to produce beautiful, meaningless results. Learn data quality, key metrics, and the overfitting traps that separate honest tests from marketing curves.

Det vigtigste
- Backtest quality depends on tick data quality and realistic spread/slippage assumptions.
- Judge results by profit factor, max drawdown and trade count — not net profit alone.
- Out-of-sample and forward testing are the antidotes to overfitting.
- Too many optimized parameters guarantee a curve-fit strategy.
- A backtest is evidence, never a promise of future performance.
Why does data quality decide everything?
A backtest is only as honest as its data. Use the highest-quality tick data available with real variable spreads, and model commission and slippage explicitly. A scalping strategy tested on minute-bar interpolation with fixed spread is fiction.
In MT5, prefer 'Every tick based on real ticks' mode. Verify the modeling quality report, and test across periods that include different regimes — trends, ranges and crises.
Which metrics actually matter?
Profit factor (gross profit ÷ gross loss) above roughly 1.3 with several hundred trades is more meaningful than a huge net profit from twenty trades. Max drawdown tells you what the ride feels like — and whether the account survives it.
Check trade distribution too: if most profit comes from a handful of outlier wins, the strategy's edge is fragile. Consistent, boring equity curves usually generalize better than spectacular ones.
How do you avoid overfitting?
Every parameter you optimize is a chance to memorize the past. Keep parameters few, optimize on one period (in-sample) and validate untouched on another (out-of-sample). If performance collapses out-of-sample, the edge was an illusion.
Finish with a forward test on a demo account. Live spreads, requotes and execution latency reveal what historical simulation cannot. Only strategies that survive all three stages deserve real money.
Ofte stillede spørgsmål
›How many trades make a backtest statistically meaningful?
There is no magic number, but below ~100 trades randomness dominates. Several hundred trades across multiple market regimes give a far more stable estimate of the edge.
›Why do my live results differ from the backtest?
Usually execution reality: spread widening, slippage, swap and latency. Compare fills trade-by-trade against the test to locate the gap — and distrust any EA whose sales page shows only backtests.
›What is walk-forward analysis?
A rolling process: optimize on a window, test on the next unseen window, then slide forward. It approximates how you would actually re-tune a system over time and exposes fragile parameter sets.
Kilder og henvisninger
Handel med forex og CFD'er med gearing indebærer høj risiko for at tabe penge. Handl aldrig for penge, du ikke har råd til at tabe. Kun undervisningsindhold — ikke investeringsrådgivning.
