Skip to content
All library documents

Adjusting MT5 Backtests for Positive Slippage on Limit and Take-Profit Orders

Article MQL5 code base

Summary

The document describes a MetaTrader 5 testing issue in real-tick mode: limit and take-profit orders may receive unrealistically favorable positive slippage, inflating simulated results. It presents a utility that reports slippage in account currency and offers callbacks to calculate a balance adjusted for positive slippage or to correct the displayed backtest balance after testing.

The method is intended to make simulated payoff and execution quality less optimistic by accounting for this specific source of favorable execution. The document provides code-level integration points but no validation data, comparison across brokers, or evidence that the adjustment models all execution costs. Its scope is narrow: it addresses positive slippage on the named order types in the MT5 tester, so it should not be read as a complete transaction-cost or realistic-fill model.

Key ideas

  • MT5 real-tick tests may assign unusually favorable positive slippage to limit and take-profit orders.
  • The utility reports slippage in account currency and can adjust the test balance for that effect.
  • The adjustment targets a specific backtest artifact and does not establish a complete model of execution costs.
  • The document provides integration code but no empirical validation of the correction.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.