The default optimisation criteria reward the highest profit, even when it comes from a handful of trades or from a fragile equity curve. RobustnessScore.mqh adds one custom criterion that prefers results that are profitable after costs, have enough trades, a moderate drawdown and a steady equity curve.

It takes two lines in any EA you have the source of:
#include <RobustnessScore.mqh>
double OnTester() { return RobustnessOnTester(); } Then set the optimisation criterion to "Custom max".
The score is 100 × (PF − 1) × fN × fDD × R², calculated on net trade results: profit factor after commission, a penalty when there are few trades, a penalty for drawdown, and the R² of the cumulative P/L. Passes with a net loss or too few trades get −1,000,000.
On a single test it also prints a summary per half-year, with and without commission, and can export every closed trade to a CSV file in Common\Files for further analysis. It also writes a readable HTML report to Common\Files (English or Spanish): every metric explained in plain language, a one-sentence verdict, a half-year table and the equity curve. Open it in a browser or print it to PDF.
Inputs:
The demo EA (a moving-average crossover) only shows how to connect the library; it is not meant to be profitable.
Smart Money Concepts MT5
Smart Money Concepts MT5 — BOS / CHoCH structure, Order Blocks, Equal Highs/Lows, Fair Value Gaps and Premium/Discount zones. MT5 adaptation of the MAJID Smart Money Concepts indicator, free for non-commercial use under CC BY-NC-SA 4.0.
JsonParserByLeo
High-performance JSON library for MQL5: single-pass tape parser, DOM, SAX streaming, builder, JSON Pointer, JSONPath-like query VM and typed struct mapping. No DLL required.
Monte Carlo Drawdown from Your Account History, with Capital Check
Shuffles your closed trades thousands of times to show how deep the drawdown can realistically get (p50/p95/p99), and checks whether your account size can carry it. Reads the account history or a CSV file and writes a readable HTML report.
ATR Stop Loss Take Profit Levels
ATR stop loss and take profit levels for Gold (XAUUSD) and any symbol on MT5. Draws the stop and two targets from the ATR for a buy at the ask and a sell at the bid, with the lot for your risk in percent of the balance. Open source code.