Skip to content
Finance
Skill

/mt5-robot-tester

Select the best MetaTrader 5 trading robots (Expert Advisors) that have not been backtested yet, by running the MT5 Strategy Tester from the command line through a 3-round pipeline. Use when the user wants to batch-test MT5 bots/EAs, screen robots across all symbols, optimize EA

BOOST
From plugin
claude-trading-skills
3k74 skills2 agents2 commands
Install
$ npx -y skills add tradermonty/claude-trading-skills --skill mt5-robot-tester --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/mt5-robot-tester

Context preview

The summary Claude sees to decide when to auto-load this skill.

Select the best MetaTrader 5 trading robots (Expert Advisors) that have not been backtested yet, by running the MT5 Strategy Tester from the command line through a 3-round pipeline. Use when the user wants to batch-test MT5 bots/EAs, screen robots across all symbols, optimize EA

SKILL.md

mt5-robot-tester.SKILL.md
name: mt5-robot-tester
description: Select the best MetaTrader 5 trading robots (Expert Advisors) that have not been backtested yet, by running the MT5 Strategy Tester from the command line through a 3-round pipeline. Use when the user wants to batch-test MT5 bots/EAs, screen robots across all symbols, optimize EA parameters, or move candidate bots to finalists based on profit, drawdown, positive months/years and equity-curve criteria. Runs terminal64.exe headless; Windows + MetaTrader 5 required at run time.

MT5 Robot Tester

Overview

Select the best MetaTrader 5 robots (Expert Advisors) from a *candidates* folder by driving the Strategy Tester from the command line through a **3-round pipeline**, moving each bot between folders as it advances, and **learning across runs** to improve selection each loop. The whole run is checkpointed and resumable.

  • **Round 1 — screening (all pairs):** backtest the EA on each symbol in the

configured `common.symbols` list (one `Optimization=0` backtest per symbol — MT5 build 6061 leaves the `Optimization=3` XML empty, so per-symbol backtests are used). Gate: **≥5 symbols profitable AND best symbol ≥3× deposit**.

  • **Round 2 — best-pair backtest:** single backtest on the best symbol; analyze

net profit %, worst drawdown %, % positive months, all-years-positive, LR Correlation, months-to-new-high.

  • **Round 3 — sequential parameter optimization:** optimize the 5–6 inputs after

`MagicNumber`, one at a time, range ±50% step 5%; then a final backtest.

  • **Finalist:** optimized result **improves** on Round 2 **and** profit **≥4×

deposit** **and** worst drawdown **≤12%**.

Tested bots move to *in-testing*; finalists are also copied to *finalists* with their optimized `.set`.

When to Use

  • "Prueba robots / bots / EAs en MetaTrader 5."
  • Screen a folder of MT5 Expert Advisors and pick the best across all pairs.
  • Optimize EA parameters and decide finalists by profit/drawdown/consistency.
  • Resume an interrupted testing run.

Prerequisites

  • **Windows + MetaTrader 5** installed (the tester runs `terminal64.exe`).
  • Broker **tick data** downloaded (default modeling is real ticks, `Model=4`).
  • The three folders under `MQL5\Experts`: *candidates*, *in-testing*, *finalists*.
  • **`common.symbols`** set in the config — the pairs Round 1 backtests (your

Market Watch symbols).

  • Optional per-bot `.set` files (config `sets_dir`) for the Round-2 baseline and

Round-3 parameter optimization. Every input is fixed during optimization except the one parameter currently being searched; without a `.set`, Round 3 is skipped and the verdict comes from Round 2.

  • **Close MetaTrader 5 before running** — the tester needs exclusive use of the

data folder.

  • Python 3.9+ (standard library only). No paid API.

Workflow

Step 1 — Configure

Copy `assets/pipeline_config.template.json`, fill in the three folder paths and set `terminal_path` to an explicit `terminal64.exe` path. For actual tester execution, a terminal path is **required** unless you opt into discovery when no path is supplied. Pass it via `--terminal-path`, config `terminal_path`, or `$MT5_TERMINAL_PATH`. `--dry-run` generates INIs without resolving or launching a terminal and needs no terminal path. Never commit real personal paths — pass the config at run time. Defaults already encode the agreed settings (2020.01.01→2026.06.30, H1, Model=4, 10000 USD, 1:100, gates and thresholds).

> **Terminal selection is opt-in.** For safety, the pipeline never auto-discovers > `terminal64.exe` under Program Files. On a machine that also trades live, the > auto-detected terminal is often the broker's **live** terminal; the generated > INI has no `Login`, so it wakes on whatever account was last used, and > `ShutdownTerminal=1` closes it at the end. To avoid silently borrowing (and > closing) a live terminal, pass an explicit path to a **portable, tester-only > install** (a `/portable` folder with its own data directory). If you > explicitly accept the risk, `--allow-auto-detect` restores Program Files > discovery only when no `--terminal-path` / `$MT5_TERMINAL_PATH` / > `config.terminal_path` is set.

> **Migration from the old precedence/fallback behavior:** selection now uses > `--terminal-path > config.terminal_path > MT5_TERMINAL_PATH`; config outranks > the environment variable. The highest-precedence supplied path must exist: > a missing path is a hard error, with no fallback even with `--allow-auto-detect`. > For example, a stale `config.terminal_path` blocks a valid `MT5_TERMINAL_PATH`. > Fix or remove the stale config setting, or override it with a valid CLI path. > Auto-detection is opt-in and applies only when no path is supplied.

Step 2 — Dry-run (optional)

Verify the generated Round-1 INIs without resolving or launching MT5. No terminal path or installed MT5 is required for this offline dry-run:

python3 skills/mt5-robot-tester/scripts/mt5_batch_tester.py \
  --config my_config.json --output-dir reports/mt5_pipeline --dry-run

Step 3 — Run the pipeline

python3 skills/mt5-robot-tester/scripts/mt5_batch_tester.py \
  --config my_config.json --output-dir reports/mt5_pipeline \
  --terminal-path "C:\Program Files\MetaTrader 5\tester\terminal64.exe"

Each bot flows R1 → R2 → R3 → finalist decision. Progress is written to `state.json` and `run.log` after every step.

Step 4 — Resume if interrupted

python3 skills/mt5-robot-tester/scripts/mt5_batch_tester.py \
  --config my_config.json --output-dir reports/mt5_pipeline --resume \
  --terminal-path "C:\Program Files\MetaTrader 5\tester\terminal64.exe"

`--resume` skips completed bots and reuses finished rounds only while the execution config, EA binary, and input `.set` fingerprints still match. A changed period, symbol list, binary, or `.set` restarts that bot safely.

Optional — HTML control panel

Launch a local dashboard to see the bots in each folder, each bot's phas

Read more
Ships withclaude-trading-skills

Claude Trading Skills started as a personal project to use AI to improve my own trading process. Claude Trading Skills is a Claude Skills-based trading workflow toolkit for time-constrained individual investors.

Get the whole plugin

Other skills on claude-trading-skills.