Fees and slippage: the distance between a signal and a result
Commission, spread and execution price are different costs. Small assumptions can change a frequently traded strategy more than its headline return suggests.
Name the cost you are modeling
A commission or transaction fee is an explicit charge associated with an order. The bid-ask spread is the gap between buying and selling quotes. Slippage is the difference between the expected execution price and the eventual fill. Slippage can help or hurt a trade, although a stress test should also consider unfavorable outcomes.
QuantConnect models fees, fills and slippage as related but distinct parts of a simulation. That distinction is useful even without writing code. A setting labeled 'zero commission' does not answer what spread was crossed, whether the order filled or how far the market moved while the order was pending.
A small numerical example
Imagine buying 100 shares at an expected price of $50 and selling them at an expected $51. The gross hypothetical profit is $100. Assume a $1 commission on each order and an adverse execution adjustment of 0.10% on each side. The adjusted purchase is $50.05 and the adjusted sale is $50.949, leaving $87.90 after both commissions.
Those numbers are illustrative assumptions, not a broker quote or a prediction. They show how to expose the arithmetic. If your fill prices already include the spread, adding a separate spread deduction for the same effect would double-count it. State which costs are included in the execution price and which are charged separately.
Check the assumptions behind every fill
A historical bar touching a limit price does not, by itself, show that your entire order could have filled there. Order size, available liquidity and the sequence of trading within the bar matter. QuantConnect's fill documentation explains that models determine both price and quantity and can incorporate spread costs.
Use a model suited to the asset and strategy. Record any minimum commission, currency-conversion cost, financing or short-borrow assumption that applies. If a cost is omitted because the necessary data is unavailable, say so. An unknown cost is not the same thing as a verified zero cost.
Test a range rather than a perfect estimate
Run a base case and a clearly less favorable case. For example, increase the execution adjustment while leaving the trading rules unchanged. Compare the effect on net return, turnover and losing periods. If a small change erases the apparent advantage, that sensitivity is part of the result.
Keep modeled costs separate from actual broker charges. QuantConnect notes that a fee estimate can differ from the amount eventually charged. A paper simulation can help identify a fragile idea, but it cannot establish the execution quality or capacity that a funded account would experience.
Go back to the source.
Original guidance and documentation behind this note. Sources accessed 24 November 2026. External documents may change after this review.
Turn a better question into
a more thoughtful test.