What back testing means in forex
Back testing is a way to evaluate a forex trading strategy by replaying its rules on historical price data. Instead of guessing, you define the strategy exactly (entry/exit rules, risk controls, and timing) and apply it to past bars or ticks to produce a simulated sequence of trades.
A useful goal is not to “predict the future,” but to measure whether the strategy’s behavior is consistent with its own logic under realistic assumptions. In forex, this typically means you also model trading frictions such as spread (the difference between bid and ask), commissions (if any), and whether orders fill at the intended price.
The mechanics: inputs, process, and data splits
Start with a written specification of the strategy rules. Make the following inputs explicit:
- Market data: define the instrument(s), timeframe, and the source/quality of historical data.
- Execution model: define how trades are executed (for example, at bar close, at next bar open, or using limit/market logic).
- Costs and slippage assumptions: represent spread and possible execution differences.
- Position sizing and risk controls: specify how you size positions and cap exposure.
Then run the back test in phases:
- In-sample (training) period: tune any adjustable parameters.
- Out-of-sample (validation) period: test the tuned strategy without further parameter changes.
- Demo forward test: after the rules are frozen, run the same strategy in a simulated or paper environment using updated market conditions.
A common verification check is walk-forward testing: repeat the cycle by moving the in-sample window forward and re-testing on the next out-of-sample segment. This reduces the chance that results come from one lucky period.
Example checks and what to look for
When you evaluate results, focus on robustness and consistency rather than a single headline metric. Checks you can apply include:
- Rule consistency: confirm the simulated trades follow the strategy specification exactly.
- Sensitivity to assumptions: test whether results change drastically if spread is higher or slippage is modestly larger.
- Stability across time: compare performance across different out-of-sample segments.
- Trade distribution: review whether outcomes depend on a very small number of trades.
Track outcomes such as total return, maximum drawdown, and volatility of results over segments. Also record whether the strategy’s behavior changes when you switch data periods or slightly alter execution timing.
Limitations and risks (what back testing cannot prove)
Back testing has important limitations:
- Overfitting: if you tune parameters too closely to historical noise, performance may not persist.
- Data and execution mismatch: historical candles and historical fills may not match how orders would execute in real time.
- Regime change: forex conditions can shift; a strategy that worked in one environment may not work later.
- No guaranteed future results: a good back test and demo forward test show plausibility under your assumptions, not certainty.
To stay verifiable, keep the strategy rules and assumptions frozen during out-of-sample and demo forward testing. If results deteriorate materially, treat that as evidence that the strategy is not robust rather than as a reason to keep tuning.
Suggested demo forward testing approach within back testing
A demo forward test is a continuation of the same verification idea, using paper execution or a simulation environment. The key is to re-run the strategy rules you already validated (no new parameter tuning midstream) and compare live-simulated behavior with your out-of-sample expectations.
Use the demo forward test to check whether your execution assumptions still look reasonable and whether performance remains within a plausible range. If you find major deviations, revisit the strategy definition and modeling assumptions, then re-validate with a fresh out-of-sample and another demo forward test cycle.