# Transaction costs and slippage

How do spread, slippage, fees, and market impact change a trade's net return?

In the synthetic example, a 0.4 percent gross trade loses 0.1 percent on each side to spread, fees and slippage, leaving 0.2 percent. Actual costs require market-specific quotes, order sizes and execution conditions.

The cost percentages are synthetic; replace them with measured market and order costs.

A signal's gross return excludes the cost of reaching a position. Net backtest returns require an execution assumption for each entry and exit.

## Separate the cost channels

Commission is a stated fee. Spread is the difference between the bid and ask. Slippage is a fill-price deviation from the chosen reference price; market impact can make that deviation size dependent. Perold's implementation shortfall compares an investment decision with its executed result.

## A round-trip calculation

Suppose a trade earns 0.40% before costs. Assume a commission of 0.05%, spread allocation of 0.02% and slippage of 0.03% on each of its two fills, all expressed against the same notional. Total modeled cost is 2 × (0.05% + 0.02% + 0.03%) = 0.20%. Net return is 0.40% - 0.20% = 0.20%. Do not add the full spread twice if a fill model already includes it.

```
Net return = gross return - sum(fill commissions + fill spread allocation + fill slippage)
```

One hand-chosen round trip: gross 0.40%, two fills costing 0.10% each, net 0.20% of the same notional. Inspect the [cost sample CSV](https://stochastly.com/repro/costs.csv), [calculated outputs](https://stochastly.com/repro/results.json), [generator](https://stochastly.com/repro/generate.py) and [provenance and SHA-256 instructions](https://stochastly.com/repro/README.md).

## Sensitivity and capacity

Run a range of plausible fill assumptions and report turnover. A fixed percentage cannot represent changing liquidity or order size. Novy-Marx and Velikov measured how trading costs alter the performance of anomaly strategies; their estimates are sample-specific, not default parameters for another market.

## In Stochastly

The desktop reality-check path accepts spread and slippage parameters and can run a more adverse fill profile. The result depends on the supplied profile and market data. It does not certify that an order could have filled at the modeled price.

## Frequently asked questions

### Is spread the same as slippage?

Spread is a quoted bid-ask difference. Slippage compares an assumed or actual fill with a reference price.

### Should costs be applied to entries and exits?

Yes. Count each fill and avoid counting a spread component twice.

### Does a positive net backtest establish capacity?

No. Capacity needs size-sensitive liquidity and impact evidence beyond a fixed fill assumption.

## Sources

Perold (1988). [The Implementation Shortfall: Paper versus Reality](https://doi.org/10.3905/jpm.1988.409150). Journal of Portfolio Management 14(3), 4-9.

Novy-Marx and Velikov (2016). [A Taxonomy of Anomalies and Their Trading Costs](https://doi.org/10.1093/rfs/hhv063). Review of Financial Studies 29(1), 104-147.

Arnott, Harvey and Markowitz (2019). [A Backtesting Protocol in the Era of Machine Learning](https://doi.org/10.3905/jfds.2019.1.064). Journal of Financial Data Science 1(1), 64-74.

[Primary source for Transaction costs and slippage](https://academic.oup.com/rfs/article-abstract/29/1/104/1844518)

## In the library

[Are Momentum Profits Robust to Trading Costs? The Capacity Question](https://stochastly.com/library/microstructure/are-momentum-profits-robust-to-trading-costs)

Implementation Shortfall: Paper Portfolio versus Real Portfolio (Perold)

No-Dynamic-Arbitrage Constrains the Shape of Market Impact (Gatheral)

Market Impact (Almgren-Chriss & the Square-Root Law)

Transaction Costs & Why Low-Frequency Edges Survive

## Related

[How to backtest a trading strategy](https://stochastly.com/learn/how-to-backtest-a-trading-strategy)

[Prop firm challenge simulator](https://stochastly.com/tools/prop-firm-challenge-simulator)

Transaction costs and low-frequency edges

---
Source: https://stochastly.com/learn/transaction-costs-and-slippage-in-backtesting
