/metatrader-research:backtest-analysisfrom metatrader-research
Backtesting methodology and performance analysis for MQL5 EAs. Use for: interpreting backtest metrics (Profit Factor, Sharpe, Calmar, Max DD, Recovery Factor); overfitting and curve-fitting detection; walk-forward testing protocol; custom OnTester() optimisation criteria; Monte Carlo simulation framework; MT5 Strategy Tester configuration (tick modes, modelling, spreads, deposits); tester journal patterns; optimisation frames API; full ENUM_STATISTICS reference. Trigger: "backtest", "optimise", "walk-forward", "Monte Carlo", "Profit Factor", "Sharpe Ratio", "overfitting", "curve fitting", "out of sample", "strategy tester", "optimisation criteria", "is this EA prop firm ready", "robustness", "OnTester", "TesterStatistics".
Ships in metatrader-research. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Backtesting is hypothesis testing, not validation. Test correctly, interpret honestly, and avoid the traps that fool most traders.
Methodology and interpretation reference for MetaTrader strategy testing — scoring backtest reports, detecting overfitting, designing walk-forward and Monte Carlo validation, configuring the MT5 Strategy Tester, and writing custom optimisation criteria.
STAT_* constant or tester configuration optionDo NOT use for:
signal-enginetrade-manageranalyticsScore any backtest report against this table before drawing conclusions.
Metric Fail Acceptable Good Excellent
Profit Factor (PF) <1.2 1.2-1.4 1.4-1.7 >1.7
Win Rate (WR) <35% 35-45% 45-55% >55%
Sharpe Ratio <0.5 0.5-0.9 0.9-1.5 >1.5
Calmar Ratio <0.5 0.5-1.0 1.0-2.0 >2.0
Max Drawdown >20% 15-20% 10-15% <10%
Recovery Factor <1.0 1.0-2.0 2.0-4.0 >4.0
Expected Payoff <0 0-5 5-15 >15
Total Trades (3yr) <100 100-200 200-500 >500
Consecutive Losses >10 8-10 5-7 <5
The 3 metrics that matter most:
Red flags:
Green flags:
Total data: 5 years minimum (e.g. 2019-2024)
In-sample (IS): First 3 years — optimise parameters here
Out-of-sample: Next 1 year — validate only, do not touch
Forward test: Final year — treated as live proxy
WF Efficiency = Average OOS PF / Average IS PF
> 0.85 = Excellent
0.70-0.85 = Acceptable
0.50-0.70 = Marginal — likely overfit
< 0.50 = Reject
Run 1,000 simulations before live deployment:
Required outputs:
95th percentile Max DD -> must be < firm limit
5th percentile Net Profit -> must still be positive
Probability of ruin -> P(DD > hard limit) must be < 5%
Tools:
MT5 built-in Monte Carlo (optimisation results tab)
Quant Analyzer (standalone)
Manual: export trades to CSV, run in Python/Excel
double OnTester() {
double pf = TesterStatistics(STAT_PROFIT_FACTOR);
double maxDD = TesterStatistics(STAT_EQUITY_DD);
double netProfit = TesterStatistics(STAT_PROFIT);
double totalTrades = TesterStatistics(STAT_TRADES);
double sharpe = TesterStatistics(STAT_SHARPE_RATIO);
double recoveryFactor = TesterStatistics(STAT_RECOVERY_FACTOR);
double balance = TesterStatistics(STAT_INITIAL_DEPOSIT)
+ TesterStatistics(STAT_PROFIT);
if(totalTrades < 100) return 0;
if(pf < 1.1) return 0;
if(netProfit <= 0) return 0;
if(maxDD > balance * 0.08) return 0; // exceed configurable DD limit
double ddPenalty = 1.0 - (maxDD / (balance * 0.08));
double score = pf * recoveryFactor * sharpe * ddPenalty;
double tradeBonus = MathMin(totalTrades / 500.0, 1.0);
return score * (0.8 + 0.2 * tradeBonus);
}
ACCOUNT_BALANCE for DD limits instead of equity| File | Contents | Read when |
|---|---|---|
references/tester-configuration.md | Tick generation modes, execution delay, forward period, spread/deposit/leverage config, common mistakes | Setting up a Strategy Tester run; choosing tick mode |
references/metric-definitions.md | Drawdown types (balance vs equity DD, absolute/maximal/relative), Profit Factor, Recovery Factor, Sharpe, History Quality | Interpreting the Results tab; understanding MT5 metric calculations |
references/historical-data.md | Pre-start buffer requirements per timeframe, start date shift journal message, tick/history storage paths, multi-currency setup | Fixing "start time changed" warnings; preparing data for a test |
references/optimization-modes.md | Slow/Genetic/All Symbols types, genetic algorithm internals, optimisation criteria (Balance/PF/DD/Sharpe/Custom/Complex), forward behaviour | Choosing optimisation method; selecting the right criterion |
references/tick-generation.md | Every Tick algorithm, Open Prices Only limits, Real Ticks specifics, exchange instrument order triggering, spread handling | Understanding tick modelling accuracy; debugging tick-related anomalies |
references/tester-journal-agents.md | Journal message patterns, local/remote/cloud agent architecture, agent limitations, global variables during tests | Interpreting tester journal output; configuring remote/cloud agents |
references/optimization-frames-api.md | FrameAdd/FrameNext/FrameFilter, ParameterSetRange, controller pattern, MQL5 Cloud limits, full function reference | Passing custom data from test agents to controller; dynamic parameter ranges |
references/enum-statistics.md | Full ENUM_STATISTICS table — all STAT_* constants with types and descriptions | Looking up TesterStatistics() constants for OnTester() or frame output |
references/enum-statistics.md (opens in a new tab)references/historical-data.md (opens in a new tab)references/metric-definitions.md (opens in a new tab)references/optimization-frames-api.md (opens in a new tab)references/optimization-modes.md (opens in a new tab)references/tester-configuration.md (opens in a new tab)references/tester-journal-agents.md (opens in a new tab)references/tick-generation.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/analyticsMetaTrader analytics and research workflows in Python. Use for: analysing backtest outputs and trade histories; computing performance metrics (drawdown, Sharpe, Profit Factor, Calmar, recovery, expectancy); building pandas-based evaluation pipelines; comparing EA variants and parameter sets; performing portfolio analysis with correlation checks and concentration risk; preparing scorecards, reports, and experiment logs; regime segmentation and rolling metrics. Trigger: "analytics", "performance metrics", "pandas", "drawdown", "Sharpe ratio", "Calmar", "Profit Factor", "backtest analysis", "portfolio correlation", "equity curve", "regime detection", "rolling metrics", "scorecard", "EA comparison".
/imported-backtestHandles importing MT5 Strategy Tester HTML reports uploaded by users as first-class backtest results. Covers parsing via the canonical ReportParser, equity reconstruction from broker or Darwinex fallback price data, broker server resolution, and integrating imported results into comparison and analysis pipelines. Use for: uploading .htm reports from external MT5 sessions; reconstructing equity curves when no live terminal is available; making imported tests indistinguishable from native runs. Trigger on: "import backtest", "upload HTML report", "imported test", "import report".
Other plugins' skills for the same job
npx claudepluginhub algotradingspace-dev/metatrader-skills --plugin metatrader-research