Skip to content
All library documents

Stress Testing Trade Sequences with Bootstrap Monte Carlo

Article MQL5 articles

Summary

The document explains how to assess the path risk hidden by a single historical equity curve. It resamples realized trade profits and losses with replacement to create alternative sequences, then tracks equity paths, percentile bands, maximum drawdown, final-equity VaR, and the share of runs exceeding a ruin threshold. A MetaTrader script reads trades from CSV, draws percentile curves, and can subtract fixed commission and randomized slippage.

An illustrative example reports that some reorderings of a 200-trade EURUSD history hit a margin call before trade 80, despite the original strategy having positive performance measures. The article presents this as a sequence-risk demonstration, not evidence that the same outcomes will occur in future. Its method assumes trades are independent and exchangeable, so it can miss serial dependence and changing market regimes. The authors suggest block resampling to preserve short-run trade clustering and note that small samples make percentile estimates unstable; the output should be treated as scenario analysis rather than a forecast.

Key ideas

  • Bootstrap resampling with replacement reveals how trade order can change equity paths even when the trade outcomes are unchanged.
  • Percentile equity curves summarize the spread of simulated outcomes at each trade step.
  • The method reports drawdown, final-equity VaR, and ruin-threshold frequency as complementary risk measures.
  • Optional commission and random slippage deductions provide a conservative execution-cost scenario.
  • Independent resampling does not preserve serial correlation or regime changes, and small samples weaken percentile estimates.

Tags

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