Costs, slippage and realistic assumptions
Build a per-trade cost model for a backtest, calculate cost drag and break-even costs, and stress-test a system with higher slippage.
What you will learn
- Which cost items belong in a backtest and how to express them per round trip
- How to calculate cost drag and the break-even cost of a system
- Realistic fill assumptions for market, stop and limit orders in a simulation
- How to stress-test a system by doubling slippage
Explanation
How the order book creates spreads, slippage and market impact is covered in the course "Order Books, Liquidity & How Orders Are Filled". Here you turn those effects into numbers inside a backtest.
The cost model
A round trip is one complete trade: entry plus exit. For each round trip, a realistic backtest subtracts:
- Commission: the broker fee, charged on entry and on exit.
- Spread: the difference between the bid (selling price) and the ask (buying price). If you buy at the ask and sell at the bid, you pay half the spread on each side, so the full spread per round trip.
- Slippage: the difference between the price your backtest assumes and the price you actually get, charged on each side.
- Financing: overnight costs for leveraged products such as CFDs (contracts for difference), and currency conversion fees for foreign instruments, if relevant.
Express all items in basis points (bp) of position value, where 1 bp = 0.01%. This makes systems with different position sizes comparable.
Cost drag and break-even cost
Net result per trade = gross result per trade − cost per round trip
Cost drag = cost per round trip ÷ gross result per trade
The break-even cost is the cost per round trip at which the net result becomes zero; it equals the gross average result per trade. Systems with many trades and small average gains have a low break-even cost and are very sensitive to errors in the cost model. A useful rule of thumb: if realistic costs consume more than half of the gross average trade, the system has little safety margin.
Realistic fill assumptions
- No trading on the signal bar's close unless you can really do that. If the signal uses the daily close, a safer assumption is execution at the next bar's open plus slippage.
- Stop orders become market orders when triggered, so add slippage, and remember that gaps can fill you far beyond the stop price. Planned risk is not the same as maximum possible loss.
- Limit orders: do not count a fill just because price touched your limit. A stricter rule is that price must trade through the limit by at least one tick (the smallest price step).
- Size: if your order is large compared with typical volume, slippage rises. Keep orders small relative to average volume or model higher costs.
Stress testing
Because costs are uncertain, run the backtest again with costs doubled (or slippage doubled). A robust system remains positive; a fragile one collapses. Write the result into your test report.
Worked example
Hypothetical example: a share-trading system makes 120 round trips per year with an average position of €10,000. The gross average result per trade is +0.40%, i.e. €40. Assumptions: commission €4 per side, spread 0.10% of position value, slippage 0.05% per side. Taxes and currency conversion are excluded.
Step 1, commission: €4 × 2 = €8.
Step 2, spread: 0.10% × €10,000 = €10.
Step 3, slippage: 0.05% × €10,000 × 2 = €10.
Step 4, total cost per round trip: €8 + €10 + €10 = €28, which is 28 bp.
Step 5, net per trade: €40 − €28 = €12. Cost drag = 28 ÷ 40 = 70%.
Step 6, per year: gross 120 × €40 = €4,800; net 120 × €12 = €1,440.
Stress test with slippage doubled to 0.10% per side: slippage = €20, total cost = €38, net per trade = €2, net per year = 120 × €2 = €240.
| Scenario | Cost per trade | Net per trade | Net per year |
|---|---|---|---|
| Gross (no costs) | €0 | €40 | €4,800 |
| Base costs | €28 | €12 | €1,440 |
| Slippage doubled | €38 | €2 | €240 |
The break-even cost is €40 per round trip. The base case leaves only €12 of margin, and a small error in the slippage estimate almost removes the edge. This system would need fewer trades, larger average moves or cheaper execution.
Common mistake
Practice activity
On paper: a system trades 60 round trips per year with positions of €5,000 and a gross average result of €55 per trade. Commission is €5 per side, the spread is 0.08% and slippage is 0.10% per side. (a) Calculate cost per round trip, net per trade and net per year. (b) Repeat with slippage doubled. (c) What is the break-even cost?
Show solution
(a) Commission €10 + spread €4 + slippage €10 = €24. Net per trade €55 − €24 = €31. Net per year 60 × €31 = €1,860 (gross €3,300).
(b) Slippage €20, total €34, net per trade €21, net per year €1,260.
(c) €55 per round trip, the gross average result.
Limitations: costs are treated as fixed per trade; in reality they vary with volatility, time of day and order size, and taxes are ignored.
Key takeaways
- Model commission, full spread, slippage on both sides and financing for every round trip.
- Compare cost per trade with the gross average trade; a high cost drag means a fragile system.
- Assume next-bar execution, slippage on stops and strict limit-order fills.
- Always stress-test with doubled costs and report both results.
Next step
In the next lesson you will build position sizing rules into the system and see how they change returns and drawdowns.
Self-check
Answer the questions, then check your answers. You can retry as often as you like.
Automatic self-check for your own revision. Your answers are checked in your browser and are not seen or assessed by us. It is not an exam and not a qualification.
Your progress
“Complete” only means you marked the lesson as done. It is not a test of your understanding. Progress and notes are saved only in this browser on this device — not in an account.