Slippage is the difference between the price your trading bot asks for and the price the order actually fills at. It can land in your favour or against you, and it spikes around news, at the daily rollover and when the market reopens after the weekend. On 0.10 lot of gold, every $0.10 of slippage costs you exactly $1.00. For a swing bot that is noise. For a scalper chasing a few dollars per trade, it can eat the entire edge.

Your backtest never shows it and a demo barely does. It only surfaces live, smeared across hundreds of fills. That is why so many people are convinced their broker is robbing them, when usually it is a cost nobody ever bothered to add up.

Why does your bot fill differently live than in the backtest?

Because a backtest replays a perfect world. In the MT5 Strategy Tester you choose an execution delay yourself. Leave it on no delay and, according to the MT5 manual, every order is executed at the requested price without requotes. You are testing a bot that never pays a cent of slippage.

Live is messier. Your bot sees a price and sends an order, and between that moment and the fill there are milliseconds, sometimes more. Price can move in that gap. Or the liquidity at that level has already been taken by someone else. The broker then fills you at the next price that is actually there.

A demo only gets you halfway. Demo fills are simulated and never have to go through real liquidity, which is one reason a bot can be profitable on demo and losing live. The MT5 tester does offer a random delay: a 90 percent chance of 0 to 8 seconds and a 10 percent chance of 9 to 18. Crude. Still more honest than zero.

Slippage cuts both ways

Negative slippage is a worse price than you asked for. Positive slippage is a better one. A buy that fills 20 cents below what your bot requested is simply money in your pocket.

FXCM publishes its own numbers on this. Of all stop, limit, market and entry orders it executed between 1 January and 30 November 2025, 30.83 percent got positive slippage and 14.64 percent negative. Positive came up more than twice as often. One broker, one period, but it does puncture the idea that slippage always goes against you.

Order type matters most. At FXCM, 74.58 percent of limit orders received positive slippage, while 57.42 percent of stop orders slipped negatively. A limit says: this price or better, so according to FXCM it cannot slip against you. A stop turns into a plain market order the moment its level is touched and takes the first price available. And when does a stop get touched? Exactly when price is moving hard in that direction. So your stop loss is where slippage hurts most. Entering with a limit is cheaper, except that sometimes you miss the trade because price never comes back.

When slippage spikes

On a quiet Tuesday afternoon in the London session you often see nothing at all on EURUSD. Four moments change that:

A bot that trades in those windows pays more. And that is exactly where a zero-slippage backtest is furthest off.

What does the deviation setting in MT5 actually do?

Deviation is the maximum gap between requested and executed price your bot will accept, expressed in points. If the gap is bigger, the order is supposed to be rejected. Sounds like the fix. On most accounts it does nothing.

Deviation only counts under Instant Execution and Request Execution. The MQL5 documentation for MqlTradeRequest lists it as a required field for those two modes only. Under Market Execution the broker decides the price, under Exchange Execution the exchange does. Either way the field plays no role. Nearly every ECN, STP and raw account runs on Market Execution. A moderator on the MQL5 forum put it bluntly: market execution means you accept whatever price the market gives you at the moment of the fill.

You can see which mode you have in the contract specification of the symbol. Right-click it in Market Watch, open Specification and look at the execution line. If it says Market, you can set deviation to 5 or to 500 in your EA and nothing changes.

Mind the unit as well. A point is the smallest price step of the symbol. On gold quoted to two decimals that is 1 cent, so deviation 30 means $0.30, or 3 pips of gold.

What does work on Market Execution is a check before the order leaves. A bot can read the spread and skip the entry when it is above a limit, or stop opening new trades in the minutes around big news. That removes the worst fills before they exist.

How to measure trading bot slippage, and what it costs in money

Measuring is duller than complaining, but it pays. For pending orders and stops it is simple. Open the History tab in MT5, switch to the view with orders and deals, and put the order price next to the deal price. For a position that closed on its stop loss you see the S/L level and the close price side by side. The difference is your slippage.

Market orders are harder, because MT5 usually only shows you the execution price there. A well-built EA writes the quote it saw at the moment of sending to the Experts log, and you compare that with the fill in the Journal. If your bot does not do that, ask for it. Fifty live trades tell you more than fifty forum threads.

Now the money. One lot of gold is 100 troy ounces, so 0.10 lot is 10 ounces and every $0.10 of slippage costs $1.00. Say your bot buys 0.10 lot of XAUUSD and gets filled $0.25 above the requested price. That is $2.50. An hour later news hits, the stop is triggered and fills $0.40 below the stop level. Another $4.00. That makes $6.50 on one trade, on top of the spread you were already paying.

For a scalper taking a $3 move, $30 on 0.10 lot, $6.50 is almost 22 percent of its target per trade. For a swing bot aiming at a $30 move, $300 on the same position, it is just over 2 percent. Same slippage, ten times the weight. And the scalper pays it dozens of times a week. The full difference between the two is in scalping bot vs swing bot.

On EURUSD, 0.10 lot is 10,000 euros and one pip is worth $1. Half a pip of slippage on the way in and half a pip on the way out costs $1 per trade. If your bot targets 5 pips, a fifth of it is gone. A raw account lowers your spread and with it your total cost. The slippage itself is a separate line. How that trade-off works out is covered in raw ECN vs standard account.

An edge smaller than your average slippage only exists in the backtest.

So measure it. After fifty live trades you know whether you slip plus or minus on average. If it stays at a few cents on gold or a fraction of a pip on EURUSD, it is simply a cost. If it keeps running into dollars per trade, look at your broker or at the hours your bot trades.

A bot you can check fill by fill

An MT5 account in your own name, with your own password. Every fill shows up in your history and you can stop whenever you want. We take 30 percent of your profit and nothing when you lose.

Start now