A backtest should deduct every cost caused by entering, holding, adjusting and exiting a position. That includes explicit fees and implicit execution losses. Because spread, slippage and impact vary with liquidity, size and volatility, a credible model uses documented assumptions and stress ranges rather than one optimistic fixed number.
Separate the cost categories
| Category | Examples | When it occurs |
|---|---|---|
| Explicit | Commission, exchange fee, clearing fee | At an order or transaction event |
| Spread | Difference between executable bid and ask | When crossing the market to enter or exit |
| Slippage | Difference between assumed and achieved execution | During order processing and price movement |
| Market impact | Price movement associated with the strategy's own demand | Increases with size relative to available liquidity |
| Holding cost | Financing, borrow fee, rollover or funding | Accrues while exposure is carried |
Apply costs at the event that creates them
Charging an annual percentage to the final return can hide how rebalancing frequency and turnover create costs. The simulation should identify each change in position, the executable price assumption, the quantity traded and any time-dependent charge. Gross and net returns should remain separately available for diagnosis.
Spread depends on the side of the trade
A strategy buying immediately generally pays an ask-side price; one selling immediately generally receives a bid-side price. Mid-price signals are useful for research, but mid-price execution is not automatically available. Pips and spreads explains the FX quote mechanics, while orders and execution owns live order behavior.
Slippage is conditional
Slippage may change with order type, latency, volatility, session, queue position and available depth. A fixed assumption can be a transparent baseline, but it should be supplemented with worse conditions and, where data permits, a model tied to spread, volatility or participation.
Financing and borrow can change holding-period economics
Leveraged and short positions can incur financing or borrow charges. Rolling FX products can apply provider-specific adjustments and cutoffs. The research record must state the instrument, provider convention and historical source rather than inserting a universal rate.
Turnover makes small edges fragile
Turnover measures how much position is bought and sold relative to capital. Two strategies with the same gross return can have very different net results if one trades much more frequently. Always report turnover alongside net performance and examine whether the return is concentrated in trades whose expected advantage is close to the cost assumption.
Capacity limits scale
A backtest using small orders may reasonably assume limited impact; the same rule at larger size may consume more available liquidity. Capacity analysis compares trade size and urgency with realistic volume or depth and recognizes that market conditions can worsen when many participants seek the same exit.
Cost-sensitivity workflow
- Document the actual instrument and execution convention.
- Apply current or historically appropriate explicit fees.
- Use bid/ask data where available or a justified spread model.
- Add slippage and impact assumptions linked to conditions and size.
- Accrue financing, borrow or rollover during the holding period.
- Report gross, base-case net and stressed net results.
- Reject conclusions that disappear under plausible costs.
Keep cost error separate from design bias
Costs cannot repair future-data leakage, survivor-only universes or repeated tuning. Audit those risks through backtesting biases, then evaluate the complete result with strategy validation.
Evidence sources
- Use the exact exchange, broker, financing and data-vendor documentation applicable to the simulated instrument and period.
- U.S. SEC market-structure resources
- BIS market and execution research