거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

Robustness Lab: Optimisation robustness map with plateau score for the Strategy Tester - MetaTrader 5용 라이브러리

Panagiotis Paterakis
Panagiotis Paterakis
  • Algorithmic trading developer (MQL5, cTrader C#, Python) 에  Self-employed
  • 그리스
  • 333
I design, code and run automated trading systems. My own systems trade forex, indices and gold live on cTrader (C#), across several brokers, so I work through the full cycle: clear strategy rules, backtesting with realistic costs, robustness checks around the chosen parameters, live deployment, and
조회수:
122
평가:
(1)
게시됨:
\MQL5\Experts\RobustnessLab\ \MQL5\Include\RobustnessLab\
RL_Common.mqh (8.96 KB) 조회
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

The best line of an optimisation report is often the luckiest one. A parameter set is more trustworthy when its neighbours give similar results. This library shows that directly.

Optimisation robustness map with plateau score, demo EA on EURUSD H1

How it works

  • Each optimisation pass sends its statistics to the terminal through frames (FrameAdd). The collector in the terminal draws a heatmap of two chosen inputs and updates it during the optimisation.
  • Metric per cell: net profit, profit factor, recovery factor, Sharpe ratio, the value returned by OnTester, or the MC recovery factor (net profit divided by the 95th percentile Monte Carlo drawdown of that pass).
  • If more than two inputs are optimised, each cell holds the mean (or best) over the other inputs.
  • Plateau score of a cell = mean - k x standard deviation of the valid cells within the chosen radius. At least 60% of the neighbourhood must be valid. Passes with too few trades are excluded and shown grey.
  • At the end it marks the best single cell (white) and the most robust cell (cyan) and tells you if the best cell sits on a weaker neighbourhood.

How to use it in your EA

  1. Copy the three .mqh files to MQL5\Include\RobustnessLab and add #include <RobustnessLab\RL_OptimizationMap.mqh>.
  2. Declare a global CRLOptimizationMap object and add the four tester functions (OnTester, OnTesterInit, OnTesterPass, OnTesterDeinit). RL_Demo_EA.mq5 shows them in a few lines.
  3. Optimise two inputs, choose "Custom max" as the criterion if you want the MC recovery factor to drive the optimisation, and watch the map on the chart that opens.
  4. Reports go to Terminal\Common\Files\RobustnessLab (HTML and CSV) and the picture to MQL5\Files\RobustnessLab.

A single test (not an optimisation) writes a Monte Carlo drawdown report for that run instead.

Demo EA

RL_Demo_EA is a plain EMA crossover with ATR stops. It exists only to demonstrate the tools and is not a trading recommendation.

Notes

  • Works with complete and genetic optimisation. Grid up to 200 values per axis.
  • A robust cell still needs an out-of-sample (forward) check before live use.

The screenshot shows the optimisation of the demo EA on EURUSD H1, 2021-2025: fast EMA 4-40 and slow EMA 20-200, 361 combinations (grey cells are invalid combinations where fast >= slow).

Robustness Lab: Monte Carlo drawdown analysis of your trading history Robustness Lab: Monte Carlo drawdown analysis of your trading history

Takes the closed trades of your account (all, or filtered by magic number and symbol), reshuffles or resamples them thousands of times and shows how deep the drawdown could realistically get. You get drawdown percentiles, the probability of a drawdown above your limit, the spread of final equity, an equity fan chart and a drawdown histogram, on the chart and as an HTML report. Part of the free Robustness Lab set.

Robustness Lab: Market regime indicator (bias-corrected Hurst, efficiency ratio, volatility) Robustness Lab: Market regime indicator (bias-corrected Hurst, efficiency ratio, volatility)

Classifies the market as trend, mean-reversion or noise using three public measures: the Hurst exponent by rescaled range with small-sample bias correction, Kaufman's efficiency ratio and the percentile of the current ATR. A colour strip shows the regime bar by bar, and a panel shows the regime on M15, H1, H4 and D1 at the same time. Part of the free Robustness Lab set.

Prop Firm Risk Manager - daily loss and trailing drawdown guard Prop Firm Risk Manager - daily loss and trailing drawdown guard

Account guard for prop-firm challenges. It does not open trades: it watches the whole account (manual trades and any EA) and closes everything before the firm's limits are broken. - Daily loss limit: closes all and blocks trading until the next day. - Max drawdown: static or trailing (can lock at the start balance); closes all and locks the account. - Optional profit-target lock, max lots / max positions, Friday close. - On-chart panel (equity, today's P/L, daily and drawdown room left) and push alerts. - Equity peak and lock are saved per account, so a restart does not reset the protection. Main inputs: StartBalance, DailyLossUSD, DDMode, MaxDDUSD, LockAtStart, safety buffers, TargetUSD, MaxOpenLots, MaxOpenPositions, FridayCloseOn, ResetLock. Attach to any one chart, any symbol and timeframe, with Algo Trading enabled.

Return-to-Mean Clock: How Many Bars Does Price Take to Come Back to the Moving Average Return-to-Mean Clock: How Many Bars Does Price Take to Come Back to the Moving Average

Measures how long price takes to come back to its moving average. The histogram shows the distance of the close from an EMA in ATR. Every time that distance first reaches a stretch level (1, 2 and 3 ATR by default), the indicator follows the stretch until the close is back at the average, runs further, or the wait is over. A panel shows, for each level, how often price came back, how often it ran further first, and the median and 80th-percentile number of bars the return took. One line can be pasted into a comment to compare symbols. It is a statistics tool and gives no trade signals.