Skip to content
All library documents

Measuring Strategy Robustness to Execution Costs and Slippage

Article MQL5 articles

Summary

The article describes an analyzer that evaluates how much transaction cost a strategy’s historical results can absorb before its edge disappears. It models cost per closing deal as a fixed charge plus a per-lot amount, then calculates average edge and breakeven cost, a cushion relative to assumed costs, and profit factor after repricing deals. It also measures winners turned into losers by costs and the share of gross profit held in winners close to the cost threshold. Those measures feed a composite grade and recommendations.

The tool reads deal results and volumes exported from MetaTrader 5 backtests and re-evaluates the record under rising cost assumptions. The author illustrates that strategies with identical aggregate profits may have very different cost resilience, especially when one relies on many small wins. A sample is reported as receiving a C grade, with a 2.49-times cushion and 40% of net profit lost to modeled costs. The model is intentionally linear; actual spread and slippage vary by instrument and market conditions, so its estimates depend on realistic cost inputs.

Key ideas

  • A strategy’s net profit and profit factor depend on the execution costs assumed in its backtest.
  • The analyzer models per-deal cost as a fixed charge plus a volume-scaled charge.
  • Breakeven cost, cost cushion, repriced profit factor, and winner erosion measure different aspects of cost sensitivity.
  • Small winning trades close to the cost threshold are especially vulnerable to higher costs.
  • The linear cost model is a transparent approximation and relies on realistic assumptions.

Tags

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