A strategy can look profitable before costs and lose money after them. The more often it trades, the more this matters. Costs are one of the few things in a backtest you can estimate in advance, so it is worth getting them right.
The three main costs
- Commission: what the broker or exchange charges per trade.
- Spread: the gap between the bid and the ask. Buying at the ask and selling at the bid costs you that gap on a round trip.
- Slippage: the difference between the price you expected and the price you got, from fast moves or from your own order moving the market.
Backte.st models commission and slippage as basis points per side. One basis point is 0.01%, so 10 bps per side on a round trip costs about 0.2% of the traded amount.
Why frequency changes everything
The cost of one trade is small. The cost of a strategy is the cost per trade multiplied by the number of trades. A strategy that trades a few times a year barely notices a few basis points. One that trades many times a day can see its entire edge disappear.
Estimating realistic numbers
Costs vary a lot by market, broker and order size, so don’t trust a single default:
- Check your broker’s or exchange’s fee schedule for the commission.
- For spread and slippage, look at typical bid-ask spreads for the instrument at the times you would trade. Less liquid stocks, small-cap crypto and off-hours trading are usually more expensive.
- If you are unsure, err on the high side. Underestimating costs flatters every result.
The doubled-costs check
Because cost estimates are uncertain, Backte.st re-runs every strategy with commission and slippage doubled on every entry and exit. If the result survives, the edge has some margin for error. If it turns into a weak spot, the strategy depends on getting very cheap execution.
Things a simple model leaves out
- Market impact for large orders.
- Funding and borrowing costs for short or leveraged positions.
- Taxes.
These are listed in each report’s limitations. For most retail-sized tests, commission plus slippage is a sensible first approximation.
Set your own costs in step 3 of the lab and watch how the doubled-costs check responds.