Demetra Robustness Lab Monte Carlo Stress Test
- Utilità
- Versione: 1.20
- Attivazioni: 10
Is the edge of your strategy robust, or did the backtest just get lucky? Robustness Lab takes the closed trades of a strategy and puts them through a set of stress tests: Monte Carlo risk, trade order, the best trades removed, luck, extra costs, missed trades and stability over time. The answer is one clear verdict and an A to F grade, with every test shown on one panel.
It reads the trades from your account history, from a Strategy Tester report saved as HTML, or from a CSV file. It is read-only: on live charts it never opens, modifies or closes a trade.
Main features
1. Three trade sources. Account history, with an optional magic number filter. A Strategy Tester report (.htm or .html) saved from the Backtest tab, whose initial deposit becomes the starting capital unless you set one. A CSV file with one closed trade per row. An optional symbol filter works on account history, on reports and on CSV files with a symbol column. From account history every closed position counts as one trade, partial closes included, with its commission, swap and fees.
2. Monte Carlo cone. Many simulated equity paths built from your own trades. The panel draws the band that holds most of the paths and the median path. When each path has as many trades as the history (the default), the real trades are drawn on top in their real order, so you can see whether the real result sits in the middle of the band or near its edge.
3. Simulated risk. Final profit or loss of the paths at the bad, typical and good end, maximum drawdown measured from the running peak, chance of ending in profit, chance of ruin at the drawdown you define, and the loss at the edge of the worst paths with their average loss.
4. Order test. The same trades shuffled many times: it shows how the drawdown of the real order compares with random orders, so a drawdown that was only lucky or unlucky is easy to spot.
5. Remove the best. The best trades are taken out and the rest is measured again, together with the share of profit made by the top trades. A strategy that lives on a few big wins shows it here.
6. Luck test. How often a strategy with no edge at all would reach the same result. A deflated profit factor and confidence take into account how many variants or optimisation passes you tried before picking this one.
7. Stress test. An extra cost on every trade (spread, slippage, commission), the break-even extra cost, and trades skipped at random as with downtime or filters.
8. Stability over time. The trades are split in time order and each part is measured on its own, so an edge that faded is visible.
9. Grade and verdict. ROBUST, MIXED or FRAGILE with an A to F grade and the number of checks passed. With too few trades it says NEEDS MORE DATA instead of a verdict. The thresholds can be changed in the inputs.
10. Repeatable results and report. A fixed random seed gives the same numbers every time. RE-RUN repeats every simulation with the next seed. REPORT saves an HTML report with the cone and all results, plus CSV files of the results and of the trades, in the MQL5\Files folder. On live charts the CSV files can also be written after each analysis.
11. Panel. Every line has a tooltip that explains it. The panel scales with the chart size and the screen DPI, works on dark and light charts and can be minimized. It checks for new closed trades, or a changed file, at the interval you set. When the source has fewer than two closed trades, an example strategy is shown instead, clearly marked SAMPLE DATA; on live charts this can be switched off.
Inputs
Trade source, history window, filters, file name and folder, and example data on or off; number of simulations, path length, starting capital, ruin level and random seed; settings of each test; verdict thresholds; CSV export, panel position and refresh interval. Values outside the allowed range are refused at start, with one clear message in the Experts log.
Any symbol and account currency: forex, gold, indices, crypto and more. Attach it to any chart; the analysis does not depend on the chart symbol unless you set the symbol filter.
Analysis only. It uses no DLL and no web requests. In the Strategy Tester the panel runs by itself and presses RE-RUN and REPORT; to give the tester some activity it places one small demonstration trade, which is left out of the analysis. This demo works only in the Strategy Tester and can be switched off. On live charts it never trades.
The tests describe how the trades you supply behaved in the past and how sensitive the result is to luck, order and costs. They do not predict future results, and no tool guarantees profits. Trading involves risk.
