mt5-robot-tester

Backtest and optimize MetaTrader 5 Expert Advisors through a three-round command-line pipeline.

2.8k|632|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/tradermonty/claude-trading-skills --skill mt5-robot-tester
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mt5-robot-tester
Source: https://github.com/tradermonty/claude-trading-skills/tree/main/skills/mt5-robot-tester
Command: npx skills add https://github.com/tradermonty/claude-trading-skills --skill mt5-robot-tester

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Screening a folder of MetaTrader 5 Expert Advisors by hand is slow and inconsistent: each bot must be backtested across many symbols, its equity curve quality assessed, and its parameters optimized before it can be trusted. This Skill automates that entire selection process by driving the MT5 Strategy Tester headless from the command line.

Core Features & Use Cases

  • Three-round selection pipeline: Round 1 screens each EA across all configured symbols, Round 2 analyzes the best symbol's quality profile (profit, drawdown, positive months, LR correlation), and Round 3 sequentially optimizes parameters one at a time.
  • Resumable, checkpointed runs: Progress is saved to state.json after every step, and --resume reuses finished work only when config, EA binary, and .set fingerprints still match.
  • Cross-run learning: A learnings.json store accumulates parameter impact and symbol priors so later runs optimize the most impactful parameters first.
  • Local HTML dashboard: A localhost-only control panel shows folder contents, per-bot phase and verdict, editable gate thresholds, and a live log.
  • Use Case: You downloaded 40 candidate EAs into MQL5\Experts\candidates. Run the pipeline overnight; in the morning, read the leaderboard to see which bots passed the profit and drawdown gates and were copied to the finalists folder with optimized .set files.

Quick Start

Ask the assistant to test the MT5 robots in your candidates folder using a config file based on assets/pipeline_config.template.json, after closing MetaTrader 5.

Frequently Asked Questions about mt5-robot-tester

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I backtest multiple MT5 Expert Advisors from the command line?

Run mt5_batch_tester.py with a JSON config pointing to your candidates folder and symbol list. It launches terminal64.exe with a generated INI per bot and symbol, waits for each report, and gates bots through three rounds automatically.

How do I optimize MT5 EA parameters automatically?

Round 3 optimizes the 5-6 inputs after MagicNumber one at a time over a ±50% range with 5% steps, fixing each best value before moving on. It requires a .set file per bot; without one, Round 3 is skipped and the Round 2 result decides.

Does this MT5 tester work on macOS or Linux?

No. The pipeline launches terminal64.exe, so Windows with MetaTrader 5 installed is required at run time. The pure parsing and gating helpers are platform-independent, but actual backtests need the Windows terminal.

Can I resume an interrupted MT5 backtesting run?

Yes. Pass --resume and the pipeline reloads state.json, skipping completed bots and finished rounds. Work is reused only while the execution config, EA binary hash, and .set file fingerprints still match; any change restarts that bot safely.

Why is my MT5 optimization XML report empty?

MT5 build 6061 leaves the Optimization=3 all-symbols XML empty, writing results only to the binary .opt cache. This skill works around it by running one Optimization=0 backtest per symbol from the configured common.symbols list instead.

What are the limitations of automated MT5 robot screening?

Real-tick modeling requires downloaded broker tick data and runs slowly, often hours per bot. Backtest results do not guarantee live performance, and report formats can differ across MT5 builds, so parsing assumptions should be verified against your installed build.