Real-world trading
Spread, slippage, and execution costs
Small trading costs compound. Here is how to measure the difference between a clean backtest and a real MT5 fill.
The price you see is not always the price you get
The spread is the difference between the bid and ask. A market order usually pays that difference when entering and gives it up again when exiting. Slippage is the difference between the requested price and the actual fill, which can be positive or negative depending on the order and market conditions.
Commission and swap add further costs. The exact calculation depends on the broker, symbol suffix, account type, and whether the position is held across a rollover.
Why backtests can look too clean
A tester may use a fixed spread, idealised execution, or price history that does not contain every tick and liquidity event. Those assumptions can be acceptable for an initial idea test, but they should not be mistaken for a live execution forecast.
A strategy with a small average edge is especially sensitive to costs. If the average expected profit per trade is close to the typical spread, commission, and slippage, the edge may disappear outside the tester.
- Use variable or observed spreads where the test platform supports them.
- Include commission and swap in the strategy tester settings.
- Compare expected and realised entry and exit prices.
- Record slippage by session, symbol, and market condition.
Measure execution after deployment
Export the order request, fill price, stop distance, spread at entry, and time of day. Compare those fields with the assumptions in your research. A broker or VPS change can alter execution without changing a single strategy input.
When costs worsen, reduce exposure or pause to investigate. Increasing position size to overcome higher costs magnifies the problem rather than solving it.
Execution quality is part of the strategy. It is not a detail to inspect only after the equity curve disappoints.
Discuss this article
Ask a setup question, share a backtest, or compare notes with other algorithmic traders. Use a display name; your email remains private.
Create an account or sign in above to join the conversation.
Loading discussion…