How should transaction costs be added to a forex backtest?
Record spread, round-trip commission and an explicit slippage assumption for every completed trade. Use values that match the instrument, account type and session being studied, then rerun the same rules with worse costs. Do not subtract a cost twice if the platform already includes it.
Core principle: a backtest should use costs that match the instrument, account type, session and broker conditions you intend to study. A single universal spread or commission assumption is not reliable.
A simple round-trip cost formula
For a group of equally sized trades, use this documented estimate:
Total cost = trades × lots × [pip value × (spread + round-trip slippage) + round-trip commission per lot].
Estimated net result is the simulated gross result minus total modeled cost. This is an accounting framework, not a prediction of live execution. It cannot recreate queue position, rejected orders, partial fills, latency, market impact or a broker’s variable markup.
Worked example: 190 cost and 310 estimated net
Assume 10 completed trades at 1 standard lot, a pip value of 10 account-currency units, a 1-pip spread, a 7-unit round-trip commission per lot and 0.2 pip of round-trip slippage. If the simulated gross result is 500:
- Spread: 10 × 1 × 10 × 1 = 100.
- Commission: 10 × 1 × 7 = 70.
- Slippage: 10 × 1 × 10 × 0.2 = 20.
- Total modeled cost: 100 + 70 + 20 = 190.
- Estimated net: 500 − 190 = 310.
The example uses constant trade size and costs so the calculation is easy to audit. If size, spread or commission changes by trade, calculate each group separately or sum the cost trade by trade.
Run the example in the free calculator
How to model spread in manual forex backtesting
Spread is the difference between bid and ask. A fixed spread is useful for a baseline, but it hides variation around news, rollover, market opens and thin liquidity. If the replay uses mid prices or a single chart price, document how spread is applied to entries and exits. If the platform already simulates bid and ask, confirm whether adding another spread input would double-count the same cost.
For strategies that trade during one narrow session, use a spread sample from that session rather than an all-day average. For strategies exposed to news or rollover, add a separate harsh scenario with a wider assumption. The purpose is to see whether the conclusion survives less favorable costs.
Per-side versus round-trip commission
Commission can be quoted per side or for the completed round trip. A 3.50 commission on entry and another 3.50 on exit equals 7 per lot round trip. Entering 7 into a field that charges it on both sides would model 14 and overstate costs. Record the unit, currency, lot basis and whether the platform expects one side or both.
Also check whether the account is commission-based with a tighter spread or spread-only with a wider markup. Comparing the commission from one account with the spread from another produces a cost model that does not represent either account.

Slippage and execution limits
Slippage is the difference between the intended and simulated fill. A manual replay often assumes that an order fills exactly at the displayed price. That can be too optimistic for fast markets, stop entries and thin sessions. Use a small explicit baseline only if it is supported by the market and account being studied, then add a worse scenario.
Visible spread, commission and slippage still do not capture every execution effect. Partial fills, latency, rejected orders and market impact remain outside a simple manual model. State those omissions beside the result instead of presenting the net figure as a live-performance forecast.
Run three cost scenarios
| Scenario | Purpose | What changes |
|---|---|---|
| Baseline | Represent the normal session and account being studied | Documented spread, commission and modest slippage assumption |
| Moderately worse | Test whether a small cost increase removes the edge | Wider spread and/or higher slippage; commission unchanged unless the account changes |
| Harsh | Expose fragile conclusions | Deliberately unfavorable but clearly labeled assumptions |
Keep the strategy rules, sample and position sizing unchanged between scenarios. If several variables change at once, the difference cannot be attributed to transaction costs alone.
A repeatable forex backtest record
- Instrument and data source
- Date range, timezone and session hours
- Account type and quote currency
- Spread method and value
- Commission unit, currency and value
- Round-trip slippage assumption
- Position sizing rule
- Stop, target and pending-order logic
- News and rollover handling
- Known omissions such as partial fills and latency
Download the free calculator and manual test-record template before comparing tools. The FX Replay review, Forex Tester Online review and Soft4FX review show where these assumptions appear—or remain undocumented—in each workflow.
Forex backtesting cost questions
Should spread be charged once or twice?
Model the economic cost once for the completed trade unless the platform’s input explicitly uses a per-side convention. Check whether bid/ask pricing already includes spread before adding a separate deduction.
What if my trades use different lot sizes?
Calculate each size group separately or sum costs trade by trade. A single average can hide the effect of larger positions.
Should swaps or financing be included?
Include them when positions remain open across the broker’s financing cutoff. This calculator does not model swaps, taxes or financing automatically.
Can this formula prove a strategy will work live?
No. It makes cost assumptions visible and comparable. It does not reproduce every live fill, behavioral decision or market condition, and simulated results do not guarantee future performance.