How Spread, Commission and Slippage Affect MT5 Backtests
A profitable backtest can look materially different when trading costs and execution conditions change. For many Expert Advisors, especially strategies targeting relatively small price movements, these conditions can influence Net Profit, Profit Factor, Expected Payoff, drawdown, the number of trades that remain profitable and the historical equity path.
Sensitivity depends on the strategy’s design. Not every short-timeframe EA is highly sensitive to costs, and an M1 system is not automatically a scalper. Start with a consistent testing setup, as described in how to backtest an EA in MT5, then examine what the test assumes about trading friction.
Three different sources of trading friction
Spread is the Bid/Ask price difference. Commission is a separate broker/account trading charge where applicable. Slippage or an execution-price difference can arise when execution occurs at a different market price from the price associated with the original trade request or expectation.
These affect trading through different mechanisms and should be evaluated separately. Swap is a further, distinct financing or holding adjustment.
| FACTOR | WHAT IT IS | HOW IT CAN AFFECT A TEST | KEY CAUTION |
|---|---|---|---|
| Spread | Bid/Ask difference | Changes effective entry/exit economics | Can vary through historical data |
| Commission | Separate trading charge where applicable | Reduces net trading outcome according to commission structure | Not every account uses the same structure |
| Slippage / execution difference | Difference arising around trade execution as market price changes | Can alter execution price and trade outcome | Not fixed and not perfectly predictable |
| Swap | Financing/holding adjustment | May affect positions held across applicable financing periods | Separate from the three primary concepts |
What is spread?
The market is quoted using Bid and Ask prices. The spread is the difference: Ask − Bid.
It is not a fixed universal cost. Spread can vary by symbol, broker, account type, time and market conditions. There is no assumed “normal” XAUUSD spread in this guide; the relevant evidence is the data and conditions of the environment being evaluated.
How MT5 Strategy Tester handles spread
In MetaTrader 5 Strategy Tester, spread is not independently modelled as a fixed artificial value. It is taken from historical data and treated as floating.
If the historical spread is less than or equal to zero, the testing agent uses the last known spread available at that point. This does not mean that historical testing always uses today’s spread, nor that Real Ticks are the only testing mode that includes spread.
See the MetaTrader 5 Testing Features documentation and the MQL5 Strategy Testing reference for the official treatment.
Bid and Ask matter
Trades do not exist on a single abstract chart price. Bid and Ask affect entries and exits according to trade direction and order type.
A strategy that appears profitable when transaction-price differences are ignored may behave differently when Bid/Ask effects are represented properly. Evaluating only the visible chart path can miss an important part of execution economics.
Why spread matters more to some strategies
The importance of spread depends partly on its size relative to the price movement a strategy targets. If a hypothetical Strategy A seeks relatively small movements while Strategy B targets much larger movements, the same spread can represent a larger fraction of Strategy A’s expected move. Strategy A can be more sensitive; that does not establish that it is always worse.
Spread can change over time
Spread can vary with market conditions and broker pricing. Relevant periods may include different trading sessions, changing liquidity, fast market movement, news-related conditions and rollover or session transitions, depending on the instrument and broker.
There is no universal widening schedule. Inspect the historical environment rather than assuming that every broker or XAUUSD symbol follows the same pattern.
What is commission?
Commission is a separate charge applied by some broker/account structures to trading activity. It is distinct from spread.
An account may charge explicit commission, have no explicit commission, or use different rules for different products or account structures. “Zero commission” does not mean zero trading cost: Bid/Ask differences and other applicable conditions still matter.
Commission in MT5 Strategy Tester
MetaTrader’s Advanced Testing Settings allow commission rules to be configured for Strategy Tester simulations. Where supported, testing can use predefined/current trading-account commission settings, or custom commission settings can be configured.
Commission structures can depend on volume or turnover, entry/exit direction and the charging interval. Rules may use a deal or lot basis, with charges expressed in money, percentage or points. These are configuration possibilities, not one universal rate.
Check the settings applicable to the intended account rather than assuming a default is representative. See the MetaTrader 5 Strategy Testing documentation.
Why missing commission can distort a backtest
If the intended trading account charges commission but the test does not include equivalent costs, historical performance may be overstated. Net Profit, Profit Factor, Expected Payoff and final balance can be affected.
Recovery Factor may also change indirectly because profit and drawdown outcomes change. The amount of distortion cannot be established without actual test data and the applicable commission structure.
Profit in pips mode — important limitation
MT5 can calculate profit in pips for faster, rough strategy estimation. In that mode, swap and commission calculations are eliminated, and margin control is not performed.
This can be useful for quick estimation, but it should not be treated as the final realistic monetary validation of a strategy that will face monetary costs and margin constraints. Follow rough testing with appropriately configured monetary testing.
The limitations are documented in the MetaTrader 5 Strategy Testing documentation.
What is slippage?
The market price can change between the creation or processing of a trade request and its execution. The execution price can therefore differ from the price associated with the original request or expectation. This execution-price difference is commonly discussed as slippage.
Slippage is not a guaranteed fixed fee. It is not always negative: an execution-price difference can be favourable or unfavourable. Not every order experiences it, its size is not fixed, and a VPS does not eliminate it.
Execution delay in MT5 Strategy Tester
MetaTrader 5 Strategy Tester can emulate network/execution delay by inserting a delay between sending a trade request and its simulated execution. Market price can change during that interval.
This execution-delay emulation helps study how trade-processing delay may influence EA results. It is not a perfect reproduction of future broker latency or all aspects of Live execution.
For the available tester functionality, see the MetaTrader 5 Strategy Testing documentation.
Random vs fixed execution delay
The official Strategy Testing documentation describes No Delay, Random Delay and fixed-delay testing options. Random Delay varies the simulated delay; a fixed delay holds the selected delay assumption constant.
No Delay is an idealized request-processing assumption, not evidence that a future broker will execute instantly. Neither random nor fixed delay reproduces every possible Live condition.
Choose plausible assumptions for the intended operating environment where possible, and compare sensitivity. There is no universal delay value that every EA should use.
Order type can change execution behaviour
Not all order types behave identically in the Strategy Tester. For exchange instruments, official documentation describes limit orders triggering on Bid/Ask and executing at their specified price without slippage, while other order types execute at current Bid/Ask market prices, where execution-price differences can occur. This example should not be generalized into an identical execution rule for every broker or instrument.
Delay emulation applies to EA trade requests, including placing a pending order; subsequent triggering of an already placed pending order is not itself a network request from the EA. Less granular testing modes can also use simplified execution treatment for certain pending orders, Stop Loss and Take Profit events.
See Every Tick vs Every Tick Based on Real Ticks and the MetaTrader 5 Testing Features documentation for context.
Every Tick vs Real Ticks
Every Tick uses generated/simulated ticks according to MT5’s tick-generation methodology. Every Tick Based on Real Ticks uses historical ticks accumulated by the broker where available.
More detailed tick data can matter when strategy decisions or execution depend on intrabar price sequencing. Historical tick fidelity is still different from reproducing future Live execution: Real Ticks do not guarantee it.
The separate Every Tick vs Real Ticks guide explains the modelling distinction in more detail.
Spread is not the only cost
Seeing historical Bid/Ask spread in a test does not automatically mean every real-world trading friction has been reproduced.
- Commission where applicable.
- Swap or other relevant financing/holding costs.
- Execution delay.
- Slippage or execution-price differences.
- Broker and symbol specifications.
Not every strategy is equally affected by each factor. The relevant combination depends on its trading behaviour and intended account conditions.
Swap — a separate consideration
Swap or overnight financing is separate from spread, commission and slippage. It may matter for strategies that hold positions across applicable financing periods. Use the relevant broker/account conditions rather than an assumed universal swap rate.
Short-horizon vs longer-horizon strategies
Transaction costs often matter more when they represent a larger fraction of the price movement a strategy attempts to capture. Two strategies can therefore respond differently to the same spread or commission assumptions.
Timeframe alone does not determine sensitivity: M1 does not automatically mean high cost sensitivity, and M5 does not automatically mean low sensitivity. See M1 vs M5 for a gold Expert Advisor.
Trade frequency and cumulative cost
Repeated transaction costs can accumulate across many trades. All else equal, a strategy executing more transactions may accumulate more commission or spread-related cost than one executing fewer transactions. Trade frequency alone, however, does not determine profitability or strategy quality; fewer trades are not inherently better.
Position size also matters
Depending on commission structure and strategy design, trade volume can affect monetary transaction costs. Position sizing can also change monetary profit, monetary drawdown and commission impact. A comparison made with different sizing assumptions may describe a different exposure as well as a different cost environment.
Why backtest results may differ across brokers
Two brokers can provide different historical/testing environments because of differences in price history, historical ticks, Bid/Ask history, symbol specifications, commission structure, swap conditions and execution assumptions.
The same EA can consequently produce different historical results under different broker data or settings. One result is not automatically more correct merely because it is higher or lower; examine the underlying conditions.
XAUUSD-specific context
For an XAUUSD Expert Advisor, historical validation should use the intended broker’s symbol specifications and realistic trading-cost assumptions where possible.
Relevant differences may include symbol naming, contract specifications, price data, spread, commission structure and trading sessions. Do not infer a universal gold spread or cost profile from the symbol name alone.
Spread stress testing
A useful research approach is to examine how results respond when trading-cost conditions become less favourable. Conceptual comparisons include higher transaction costs, less favourable execution or a different broker environment.
The purpose is to understand sensitivity, not to satisfy a universal spread multiplier or pass/fail threshold. Since MT5 uses historical floating spread, do not confuse this research concept with a claim that the tester always offers an independent fixed-spread override.
Commission sensitivity testing
If the intended account charges commission, test conditions should reflect a plausible commission structure. A strategy whose historical edge disappears under small realistic changes in transaction cost deserves closer investigation. What counts as a small change depends on the actual environment; there is no universal acceptable deterioration threshold.
Execution-delay sensitivity testing
For execution-sensitive EAs, comparing results under different plausible tester delay assumptions can reveal dependence on processing time. A large historical change is informative, but does not automatically mean a strategy is invalid.
A VPS may improve network conditions depending on location, provider and broker connectivity, but it does not eliminate execution uncertainty or slippage. See how to run an MT5 EA on a VPS.
Do not optimize for perfect cost assumptions
Choosing assumptions solely because they produce the best historical equity curve can obscure the environment in which a strategy is meant to operate. Ground the setup in intended trading conditions; do not remove applicable commission or assume artificially favourable spread and zero delay simply to maximize historical profit.
How costs affect report metrics
- Net Profit: can decrease as trading costs increase.
- Profit Factor: can change because trading outcomes after costs change.
- Expected Payoff: can decline when per-trade costs increase.
- Drawdown: may increase or otherwise change as the historical balance/equity path changes.
- Trade count: may remain unchanged for some strategies, but can change if the logic depends on Bid/Ask or execution-sensitive conditions.
Do not assume that every metric must move in one fixed direction when the cost environment changes. Definitions are covered in MT5 backtest metrics; for interpreting the complete report, see how to read an MT5 Strategy Tester report.
Simple hypothetical example
Suppose a hypothetical Strategy A historically produces a modest average gain per trade. If transaction costs consume a meaningful part of that gain, profitability may deteriorate materially.
A hypothetical Strategy B targets substantially larger price movements. The same absolute cost may represent a smaller fraction of its expected move. This is a conceptual comparison, not an AXIFLARE performance model, and it does not establish which strategy is better overall.
Realistic does not mean pessimistic
The goal is not to make results artificially bad. It is to avoid assumptions materially more favourable than the intended trading environment. Use plausible, representative conditions, and be appropriately conservative where uncertainty exists. Extreme assumptions without supporting evidence can be misleading too.
Backtest vs forward testing
Historical testing studies cost and execution assumptions using past data. Real-time forward testing can then provide observations from the actual platform and broker environment as new market data arrives.
The two should not be expected to match perfectly, and neither guarantees future performance. See backtesting vs forward testing an Expert Advisor for the distinction.
Practical transaction-cost checklist
BEFORE TRUSTING AN MT5 BACKTEST
- Confirm the intended symbol and broker environment.
- Understand how spread is represented.
- Check whether the intended account charges commission.
- Verify commission assumptions where applicable.
- Consider swap if positions may be held across financing periods.
- Use a modelling mode appropriate to the EA.
- Consider execution-delay sensitivity if the strategy is execution-sensitive.
- Review both Balance and Equity Drawdown.
- Compare results across plausible trading conditions.
- Do not judge quality from Net Profit alone.
- Forward test operational behaviour before relying on Live deployment.
For the risk distinction behind the checklist, see balance vs equity drawdown in MT5.
Common mistakes
| MISTAKE | WHY IT IS MISLEADING | BETTER APPROACH |
|---|---|---|
| “Spread and commission are the same cost” | They are different mechanisms | Evaluate both separately |
| “MT5 always uses a fixed spread” | Strategy Tester uses historical spread and treats it as floating | Understand the test’s historical data |
| “Real Ticks means Live execution is perfectly recreated” | Historical tick data is still historical testing | Separate price-data fidelity from future execution |
| “Zero commission backtest is fine for a commission account” | Intended trading cost may be missing | Model plausible commission conditions |
| “A low-latency VPS removes slippage” | Execution depends on more than VPS latency | Treat latency as one execution factor |
| “One profitable test proves costs do not matter” | Sensitivity may not have been tested | Compare plausible conditions |
| “Profit in pips is a final realistic monetary test” | Commission/swap and margin control are excluded in this mode | Use it for rough estimation, then validate appropriately |
Transaction costs and AXIFLARE backtests
AXIFLARE publishes historical backtest results as simulations under defined testing conditions. Differences in broker data, spread, commission, execution assumptions and symbol specifications can affect historical results.
Published backtests do not guarantee that another broker, account or future Live environment will produce identical results. See the historical information on the systems page and the Risk Disclosure.
Final perspective
A backtest is only as informative as the assumptions surrounding it. Spread, commission and execution conditions can materially influence the historical outcome of an Expert Advisor.
The goal is not to create the most attractive backtest, but to understand behaviour under conditions that reasonably represent the intended trading environment. Historical testing remains evidence, not a guarantee of future performance. For a broader evaluation framework, see how to evaluate an XAUUSD Expert Advisor.
Educational content only. Nothing in this guide constitutes investment advice. Trading involves substantial risk.