Method
Backtesting forex: specifics and pitfalls
7 min read · by the GetBacktest team
Backtesting a forex strategy follows the same rules as any backtest — clear rules, anti-look-ahead, a large sample — but the currency market adds its own traps: a spread that varies, very different sessions, and pairs that move together. Ignore them and you build a flattering backtest that won't hold up live.
Why forex changes things
Forex trades 24 hours a day on weekdays, with no single opening bell: the same pair behaves nothing like it does at 3 a.m. versus the London open. A backtest that lumps all hours together hides this reality.
Another quirk: you trade pairs (EUR/USD, GBP/JPY…), often correlated. Two “different” positions can actually carry the same disguised risk if the pairs move together.
The spread and cost trap
On forex, the main cost is the spread, and it isn't constant: it widens at the open, on news, and in the thin Asian session. Backtesting with a tiny fixed spread almost always overstates performance.
For small-target strategies (scalping), the spread alone can flip expectancy from positive to negative. Model a realistic spread — ideally variable — plus any swap (overnight fee) if you hold positions overnight.
Sessions and volatility
The London and New York sessions concentrate most of the volume and directional moves; Asia is often quieter and range-bound. A breakout strategy works better in an active session, a range strategy in a quiet one.
Testing with and without a session filter, over a large sample, reveals whether your edge depends on a specific window — useful to know, but beware over-optimizing a time window on history.
How to backtest it properly
Replay bar by bar (or tick by tick) on real forex data, including spread and costs, never seeing the future. Log each trade's session to analyze where your strategy truly performs.
On GetBacktest, replay runs on real data with the future hidden server-side, and the robustness verdict (Monte-Carlo, walk-forward, deflated Sharpe) tells you whether your forex edge survives out-of-sample.
Don't believe it — prove it
Backtest this concept on real data, tick by tick, and get a robustness verdict. 7 days of Pro free, no card.
Start for freeFrequently asked questions
Does the spread skew a forex backtest?
Yes, hugely for small-target strategies. A fixed, too-low spread inflates results. Model a realistic spread, ideally variable by session and news.
Should I account for swap (overnight fees)?
If you hold positions overnight, yes: swap can weigh on a swing strategy. For day trading closed each evening, it's negligible.
What data to backtest forex?
Quality data, ideally tick, over a large history covering several regimes. GetBacktest replays real data with guaranteed anti-look-ahead.
Read next