MFXG CAPITAL · FINANCIAL ENGINEERING · QUANT RESEARCH · RISK ANALYTICS · TRADING TECHNOLOGY
MMFXG CAPITALMYFOREXGLOBAL CAPITAL
Menu ▾
Home / Trading Systems & Execution / Backtesting Transaction Costs
RESEARCH & INSIGHTS · trading-systems

Backtesting Transaction Costs

A transaction-cost model converts theoretical signals into implementable returns by charging the costs associated with each trade, holding period and market condition. One fixed fee is rarely enough.

Written by MyForexGlobal Editorial TeamReviewed by Paul Mukara Last reviewed September 4, 2026

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

CategoryExamplesWhen it occurs
ExplicitCommission, exchange fee, clearing feeAt an order or transaction event
SpreadDifference between executable bid and askWhen crossing the market to enter or exit
SlippageDifference between assumed and achieved executionDuring order processing and price movement
Market impactPrice movement associated with the strategy's own demandIncreases with size relative to available liquidity
Holding costFinancing, borrow fee, rollover or fundingAccrues 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

  1. Document the actual instrument and execution convention.
  2. Apply current or historically appropriate explicit fees.
  3. Use bid/ask data where available or a justified spread model.
  4. Add slippage and impact assumptions linked to conditions and size.
  5. Accrue financing, borrow or rollover during the holding period.
  6. Report gross, base-case net and stressed net results.
  7. 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