Monte Carlo Risk Simulator
- Utilità
-
Mohamed-amine Baddir
Sviluppo Expert Advisor per MetaTrader 5 e li testo correttamente prima che tu li utilizzi per fare trading.
Cosa faccio:
- Trasformo la tua strategia, il tuo script TradingView o le tue regole scritte in un Expert Advisor MT5 pulito - Versione: 1.0
Monte Carlo Risk Simulator shows how much worse a backtest could have gone with the same trades in a different order, and what more or less risk per trade does to its growth and drawdown. It reads saved Strategy Tester reports or the history of your account, runs thousands of simulations and writes one HTML page.
How To Use
- Backtests: in the Strategy Tester, right click on the Backtest tab > Report > save it as HTML into MQL5\Files\RiskSimulator (File > Open Data Folder).
- Account: set "Trades to simulate" to the history of this account; filter by start date, magic number and symbol if needed.
- Attach Monte Carlo Risk Simulator to any chart. Open MQL5\Files\RiskSimulator\RiskSimulator.html in any browser. Choose the report and the number of simulations at the top of the page.
What The Page Shows
- The balance of the test and a fan of simulated balances: the 5% to 95% band, the median and sample paths.
- The distribution of the maximal drawdown of the simulations, with the drawdown of the test marked.
- Headline figures: final balance and drawdown as tested, median drawdown of the simulations, the drawdown exceeded in 1 simulation out of 20, the share of simulations that lost half the starting balance, and the growth-optimal risk multiplier.
- A table for 0.25, 0.5, 0.75, 1, 1.5, 2, 3 and 4 times the tested risk: final balance and drawdown in the tested order, median final balance, the final balance of the worst 5%, median and 95th percentile drawdown, the share of simulations with a drawdown over 20%, that lost half the starting balance, or that were wiped out.
- A chart of median final balance and 95th percentile drawdown by multiplier.
How It Works
- Each trade keeps its result as a percent of the balance before it. The simulations draw the trades at random with replacement (bootstrap) and compound them.
- The multiplier scales that percent, like trading larger or smaller lots in proportion to the balance. A multiplier of 1 in the tested order reproduces the final balance and the maximal balance drawdown of the Strategy Tester report.
- The simulations use a fixed seed, so the same report always gives the same page.
Good To Know
- Closed trades only: the drawdown inside open trades is not included, and trades are assumed independent of each other.
- A simulation shows what the same trades could have done; it does not say that future trades will be like them.
- Up to 12 reports at once. Reports of any terminal language are read. The page is one file with no internet access needed.
- The demo runs in the Strategy Tester: put saved reports into the common folder Files\RiskSimulator (File > Open Common Data Folder); the page is written when the test ends.
- The utility reads files and history only. It does not trade and does not change any setting.
- The screenshots show a test of an example strategy. They show the page, not trading results to expect.
- To see how far each trade went against you and in your favour before it closed, and where a stop-loss could be, see Trade Excursion Analyzer by the same author.
Inputs
- Trades to simulate: saved Strategy Tester reports, or the history of this account
- Folder in MQL5\Files with the saved reports, or the report files separated by ;
- Folder in the common Files folder of all terminals
- Account history: from date, magic number, symbol
- Page title
