Monte Carlo Grid Stop Out MT5
- Utilities
-
Dennis Hoinkis
MT5Bots – Expert Advisors for MetaTrader 5 with published tests
We build and test our own Expert Advisors for MetaTrader 5: breakouts, chart patterns and trend strategies on US stocks, gold, indices and commodities.
How every bot is tested: - Version: 1.0
Monte Carlo Grid Stop Out is a script that estimates how often a simplified grid model would reach the broker's stop-out level within a chosen horizon. It builds many random price paths from the symbol's own history and simulates the grid on each path with spread, commission, leverage and stop-out.
Main features
- Block bootstrap of the loaded history (M1, M5 or M15): blocks of consecutive bars are chained in random order, so calm and volatile periods stay together.
- Bar-by-bar grid simulation that includes the high and low of each bar; free margin is checked before every fill.
- Fixed lots, a lot multiplier, or lots calculated from a risk percentage of the balance.
- Panel on the chart with a histogram of final equity and a fan chart of equity over time.
- CSV file with one line per path. With the same seed, history and inputs the results can be repeated.
How to read it
The stop-out probability is the share of paths that reached the stop-out level within the horizon; the checkpoints at 1, 3, 6 and 12 months show how this share grows over time. Final equity is shown as median, mean, 5th and 95th percentile, and the maximum drawdown as median and 95th percentile. In the histogram, bars below the start balance are red. In the fan chart the dark band covers 90% of the paths and the lighter band the middle 50%; the line is the median. The panel stays on the chart after the run, and the summary is also printed in the Experts log.
Main inputs
- History and paths: timeframe M5, 2 years of history, 1000 paths, horizon 6 months, block length 1 trading day, drift removal on, random seed.
- Entry: momentum of 0.30% within 71 minutes, cooldowns of 10 and 17 minutes, trend filter with SMA 20 on M5 and SMA 50 on M15.
- Grid: spacing 1.50 in price, 14 levels, basket take profit 1.00, lot mode fixed with 0.01 lot.
- Brakes: time brake 3 days, speed brake at level 5 within 5 minutes (0 = off).
- Costs: spread 25 points, commission 0.
- Account: start balance 3,000, leverage 1:100, stop-out level 50%, withdrawal 0%.
Notes and limits
- The paths only contain behaviour that is present in the loaded history. Events outside that history cannot appear.
- The entry logic is a simplified model. It does not describe the results of any particular Expert Advisor, and a real EA can behave very differently.
- Fills happen exactly at grid prices, the spread is constant, and swap and slippage are not included.
- The results are an estimate based on past behaviour, not a forecast.
This tool does not trade.
Part of the MT5Bots tool set.
