How to actually measure slippage on your live account
Most traders guess their slippage rather than measuring it. To get real numbers, you need to log the price you sent in your order request versus the actual execution price reported by the broker. Don't rely on backtest assumptions because live liquidity is a different animal.
Start by calculating the difference for every trade. Keep in mind that slippage is not the same as the spread. If you buy at the ask and get filled at the ask, your spread cost is the difference between the bid and ask at that moment. True slippage is the price improvement or degradation relative to the market price you expected to hit when you clicked buy or triggered your script.
Here is a simple way to track this:
- Log the timestamp, symbol, side, requested price, and filled price.
- Subtract the requested from the filled price.
- Aggregate the average per trade.
Don't draw conclusions from ten trades. You need at least a few hundred samples to filter out the noise of random market volatility. If you are comparing two brokers, run them on the same instrument during the same time window. If one broker consistently shows a wider variance between requested and filled prices, that is your slippage penalty.
Remember that brokers often optimize for different things. Some prioritize speed at the cost of price, while others wait for better liquidity. Have you checked your execution logs against your order history lately to see if the reality matches your strategy's assumptions?