Introduction To Backtesting
Backtesting simulates EA behavior on historical market data. It helps you understand how a setup behaved during a selected period, but it does not predict future results.
Historical performance does not guarantee live performance. Use backtesting as one review step, then validate on fresh data and demo conditions.
Why Backtest?
Backtesting can help you:
- confirm that the EA runs on the selected symbol and timeframe
- check whether stop loss, take profit, and trailing rules are applied as expected
- compare different input combinations
- review trade frequency, drawdown, costs, and trade distribution
- identify settings that are not worth further testing
Backtesting should not be used as proof that a setup will work on a live account.
How Backtesting Works
The basic process is:
- MT4 loads historical prices for the selected symbol and timeframe.
- The EA processes each bar according to its rules.
- MT4 simulates trade entries, exits, and account changes.
- The Strategy Tester produces a report, chart, and trade list.
What MT4 Can Simulate
MT4 can simulate:
- signal detection
- order entry and exit
- stop loss and take profit
- trailing stop and break-even behavior
- partial closes
- lot-size calculations
- trading-hour filters
What MT4 Cannot Simulate Perfectly
Backtests may not fully reflect:
- slippage
- changing spreads
- broker order rejections
- live server latency
- VPS interruptions
- unusual liquidity conditions
- future market regime changes
Modeling Modes
MT4 offers different test modes. The names and availability can vary by terminal build and broker.
Open Prices Only
This is faster and can be useful for early checks or broad optimization, but it is less detailed.
Every Tick
This is slower and more detailed. Use it for closer review before validation.
Real Tick Data
If available, real tick data can provide a more detailed historical simulation. It still remains a simulation and should be validated separately.
Common Limitations
Past Data Is Not Future Data
Markets change. A setup can behave differently when volatility, spread, liquidity, or trend conditions change.
Data Quality Matters
Missing bars, incorrect prices, or poor tick data can distort a test. Use data that is suitable for the broker and symbol you intend to trade.
Overfitting Is A Real Risk
Overfitting happens when settings are adjusted too closely to one historical period. The setup may look good in that period and fail elsewhere.
Reduce overfitting risk by:
- optimizing fewer inputs at once
- using practical parameter ranges
- reserving out-of-sample data
- validating on demo
- avoiding decisions based on one headline metric
What To Review
When reviewing a backtest, check:
- symbol and timeframe
- broker data source
- spread and commission assumptions
- number of trades
- net result
- drawdown
- profit factor
- average trade
- consecutive losses
- equity curve shape
- whether one trade or one short period explains most of the result
There is no single metric that proves a setup is suitable.
Common Mistakes
Avoid:
- testing only a short or favorable period
- optimizing too many inputs at once
- judging only by net profit
- ignoring spread, commission, or swap
- using unrealistic account size or lot size
- moving straight from a backtest to live trading
- changing settings after every single result