Risk Management

Trading Costs Explained: Spread, Commission, Swap and Slippage

The four costs that every trading bot pays - spread, commission, swap and slippage - how to measure them in R, how they change by time of day, and how to model them honestly in backtests.

By AlgoXP2 min readUpdated

Spread, commission and slippage per trade in R for scalping, intraday and swing stops

Every trade pays for itself before it can make money. Costs are invisible in the idea phase, easy to underestimate in a backtest and impossible to avoid in live trading. For many short-term strategies, the difference between profit and loss is not the entry signal - it is the costs.

1. Spread

The difference between the bid and the ask. You buy at the ask and sell at the bid, so every round trip pays the spread once.

  • Varies by time: tight during active sessions, wider in quiet hours, much wider around rollover and news.
  • Varies by symbol and broker.

2. Commission

A fee per trade, common on raw-spread accounts. Platforms often express it per million units traded or per lot per side. In cTrader backtesting, for example, commission is entered per million traded units.

3. Swap (financing)

A daily charge or credit for positions held over the rollover, based on the interest rate differential and the broker’s markup. Many brokers charge a triple swap once a week to cover the weekend.

  • Irrelevant for intraday strategies that close before rollover.
  • Significant for swing and grid strategies holding positions for days or weeks.
  • Can be positive in carry trades.

4. Slippage

The difference between the expected price and the fill price. Common on market and stop orders during fast moves, news and session opens. Limit orders avoid negative slippage but may not fill.

Measuring costs in R

Express all costs relative to the risk per trade:

Cost in R = (spread + commission + expected slippage) / stop distance

Example: stop 15 pips, spread 0.8 pips, commission 0.7 pip-equivalent, slippage 0.3 pips → 1.8 / 15 = 0.12R per trade.

If the strategy’s expectancy before costs is 0.15R, only 0.03R remains. Tight stops make costs larger in R; that is why scalping is so cost-sensitive. See risk/reward and expectancy.

Costs by strategy type

Strategy Dominant costs
Scalping Spread, commission
Intraday breakouts Slippage, spread at session opens
Swing and trend Swap, occasional gap slippage
Grids and averaging Swap on many open positions, spread on every level
News Spread spikes, slippage

Modelling costs in backtests

  • Commission: use your broker’s actual rate.
  • Spread: tick data carries historical spreads; bar data needs a fixed or random spread - choose a conservative value. In cTrader, the spread setting is used for bar data, while tick data already includes spread information.
  • Swap: check that the backtest applies it, and use current rates.
  • Slippage: add an allowance for market and stop orders, larger for breakout and news logic.
  • Stress test: rerun with all costs 50-100% higher. A robust strategy degrades; a fragile one turns negative.

Reducing costs

  • Trade during liquid hours; avoid rollover.
  • Use spread guards that skip entries when spreads are abnormal.
  • Prefer limit entries where the strategy allows.
  • Trade less often with larger targets, if the edge permits.
  • Compare account types by total cost per round trip.

Key takeaways

  • Spread, commission, swap and slippage are paid on every strategy, in different proportions.
  • Measure costs in R to see their real impact on expectancy.
  • Model them conservatively in backtests and stress-test with higher costs.
  • Time of day and order type change costs more than most parameter tweaks.

FAQ

Which cost matters most?

For short-term strategies, spread and commission - they are paid on every trade. For strategies that hold for days or weeks, swap can dominate. For breakout and news strategies, slippage often matters most.

How should I set costs in a backtest?

Use your broker's actual commission, tick data with historical spreads where possible, swap rates from the symbol specification, and an allowance for slippage. Then rerun with costs increased by 50-100% to see how much margin of safety you have.

Is a raw-spread account with commission cheaper than a no-commission account?

Often, but not always. Compare the total round-trip cost per lot - spread plus commission - for your symbols and trading hours.

Sources and further reading

  1. cTrader Help: Backtest a cBot (commission and spread settings) - help.ctrader.com
  2. StockCharts ChartSchool: Average True Range (ATR) - chartschool.stockcharts.com