# 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.

warning

Historical performance does not guarantee live performance. Use backtesting as one review step, then validate on fresh data and demo conditions.

***

## Why Backtest?[​](#why-backtest "Direct link to 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[​](#how-backtesting-works "Direct link to How Backtesting Works")

The basic process is:

1. MT4 loads historical prices for the selected symbol and timeframe.
2. The EA processes each bar according to its rules.
3. MT4 simulates trade entries, exits, and account changes.
4. The Strategy Tester produces a report, chart, and trade list.

### What MT4 Can Simulate[​](#what-mt4-can-simulate "Direct link to 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[​](#what-mt4-cannot-simulate-perfectly "Direct link to 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[​](#modeling-modes "Direct link to Modeling Modes")

MT4 offers different test modes. The names and availability can vary by terminal build and broker.

### Open Prices Only[​](#open-prices-only "Direct link to Open Prices Only")

This is faster and can be useful for early checks or broad optimization, but it is less detailed.

### Every Tick[​](#every-tick "Direct link to Every Tick")

This is slower and more detailed. Use it for closer review before validation.

### Real Tick Data[​](#real-tick-data "Direct link to 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[​](#common-limitations "Direct link to Common Limitations")

### Past Data Is Not Future Data[​](#past-data-is-not-future-data "Direct link to Past Data Is Not Future Data")

Markets change. A setup can behave differently when volatility, spread, liquidity, or trend conditions change.

### Data Quality Matters[​](#data-quality-matters "Direct link to 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-is-a-real-risk "Direct link to 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[​](#what-to-review "Direct link to 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[​](#common-mistakes "Direct link to 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

***

## Next Steps[​](#next-steps "Direct link to Next Steps")

1. [MT4 Strategy Tester Guide](/banana-ea/mt4/docs/v4/backtesting-optimization/strategy-tester-guide.md)
2. [Backtesting Setup](/banana-ea/mt4/docs/v4/backtesting-optimization/backtesting-setup.md)
3. [Running Backtests](/banana-ea/mt4/docs/v4/backtesting-optimization/running-backtests.md)
4. [Validation And Forward Testing](/banana-ea/mt4/docs/v4/backtesting-optimization/validation-forward-testing.md)
