PK Tech SolutionsPK Tech Solutions

Gold EA slippage: how to measure execution costs on MT4 and MT5

Understand execution price differences, calculate hypothetical XAUUSD costs and evaluate an EA before live trading.

· PK Tech Solutions

Hypothetical buy request and fill price difference of 0.25 dollars per ounce

Slippage versus spread

Spread is the difference between ask and bid at a given moment. Slippage is the difference between a reference price when submitting an order and the actual fill. It can be favorable or adverse. Volatility, liquidity and latency are worth investigating, but a price difference alone does not establish its cause.

A hypothetical XAUUSD calculation

Suppose a buy is submitted at an ask of 4000.20 and filled at 4000.45. Adverse slippage is $0.25 per ounce. With a hypothetical contract size of 100 ounces per lot and a volume of 0.01 lot, the additional cost is $0.25. Another $0.15 of adverse exit slippage brings the total to $0.40, excluding spread and commission not already accounted for. These are illustrative numbers, not market quotes or trading results.

Measure execution consistently

Record timestamps, reference bid and ask, side, volume, fill price and order identifiers. For buys, subtract the reference ask from the fill; for sells, subtract the fill from the reference bid. Positive values indicate adverse slippage. Separate entries, exits and rejected requests. Check point size, tick size, contract size and account currency before converting to money.

EA evaluation checklist

  1. Check whether the EA records order outcomes and errors.
  2. Compare historical tests with demo results under comparable symbol specifications and conditions.
  3. Stress-test additional execution costs and review net profit and equity drawdown.
  4. Measure median and 95th percentile slippage by session, reporting sample sizes.
  5. Understand deviation settings and retry behavior under the broker's execution mode. Price restrictions may cause rejection and cannot guarantee zero slippage.

Why small profit targets are sensitive to execution

A hypothetical average return of $0.70 per cycle before additional costs falls to $0.30 after $0.40 of adverse slippage, before any other uncounted expenses. Higher costs can turn a positive result negative. Evaluate net outcomes rather than speed or win rate alone.

Trading involves risk. Automated trading software does not guarantee profits. Historical results do not guarantee future performance.

References and further reading

MetaTrader 5 Help — Basic Principles · Backtesting guide

Explore trading software

PK Tech Solutions operates the linked store. Check current product specifications and licensing before purchase.

Visit official store