agentleFS
kecoma1kecoma1/MQL5-SKILLS/skills/run-backtests/SKILL.md

run-backtests

Skill17 starsChanged 7 months agoMITView on GitHub

Use when running MetaTrader 5 Strategy Tester backtests from the terminal in this workspace. Ask the user for the test configuration field by field before launching the test, using the current project defaults unless the user changes them.

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 12 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when the user wants to run a MetaTrader 5 backtest from the terminal.

    line 8
  2. Very specific:

    Run the main MetaTrader 5 installation with a tester .ini file:

    line 12
  3. Distinctive:

    Use that command pattern for backtests in this workspace.

    line 18
  4. Distinctive:

    Before running the test, ask the user for the configuration field by field.

    line 22
  5. Distinctive:

    Do not assume the final setup without confirming each field first.

    line 23
  6. Distinctive:

    When asking for a field, use JSON Schema style notation like this:

    line 24
  7. Very specific:

    Use the same notation for backtest questions.

    line 40
  8. Distinctive:

    Ask in this order:

    line 42
  9. Distinctive:

    Use these question shapes:

    line 55
  10. Distinctive:

    Use these values as defaults unless the user changes them:

    line 218
  11. Very specific:

    Create or update a tester .ini with the confirmed values.

    line 233
  12. Distinctive:

    After launching the test:

    line 262
  13. Distinctive:

    Read the tester logs.

    line 264
  14. Distinctive:

    Read the generated report or result files.

    line 267
  15. Distinctive:

    If the terminal opens but the test does not run, do not invent results.

    line 270

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Run Backtests

Use this skill when the user wants to run a MetaTrader 5 backtest from the terminal.

Command

Run the main MetaTrader 5 installation with a tester .ini file:

Start-Process -FilePath 'C:\Program Files\MetaTrader 5\terminal64.exe' -ArgumentList '/config:C:\Users\<user>\AppData\Roaming\MetaQuotes\Terminal\<terminal-id>\config\codex-fvgtrader-gbpusd-lastmonth-v2.ini' -Wait

Use that command pattern for backtests in this workspace.

Required Workflow

Before running the test, ask the user for the configuration field by field. Do not assume the final setup without confirming each field first. When asking for a field, use JSON Schema style notation like this:

{
  "type": "object",
  "properties": {
    "risk_level": {
      "type": "string",
      "description": "Select your preferred risk level",
      "enum": ["low", "medium", "high"]
    }
  },
  "required": ["risk_level"]
}

Use the same notation for backtest questions. Add enum options whenever the field has a bounded set of valid choices.

Ask in this order:

  1. Expert or strategy file.
  2. Symbol.
  3. Timeframe.
  4. Date range.
  5. Deposit.
  6. Deposit currency.
  7. Leverage.
  8. Tick model.
  9. Optimization on or off.
  10. Visualization on or off.

Use these question shapes:

  1. Expert or strategy file:
{
  "type": "object",
  "properties": {
    "expert": {
      "type": "string",
      "description": "Select the Expert Advisor or strategy file to run",
      "enum": ["Experts\\\\codex\\\\FVGTrader.ex5"]
    }
  },
  "required": ["expert"]
}
  1. Symbol:
{
  "type": "object",
  "properties": {
    "symbol": {
      "type": "string",
      "description": "Select the symbol to backtest",
      "enum": ["GBPUSD"]
    }
  },
  "required": ["symbol"]
}
  1. Timeframe:
{
  "type": "object",
  "properties": {
    "timeframe": {
      "type": "string",
      "description": "Select the chart timeframe",
      "enum": ["M1", "M5", "M15", "M30", "H1", "H4", "D1"]
    }
  },
  "required": ["timeframe"]
}
  1. Date range:
{
  "type": "object",
  "properties": {
    "date_range": {
      "type": "string",
      "description": "Select the date range preset or provide a custom range",
      "enum": ["last_week", "last_month", "last_3_months", "custom"]
    }
  },
  "required": ["date_range"]
}
  1. Deposit:
{
  "type": "object",
  "properties": {
    "deposit": {
      "type": "number",
      "description": "Enter the starting deposit amount"
    }
  },
  "required": ["deposit"]
}
  1. Deposit currency:
{
  "type": "object",
  "properties": {
    "currency": {
      "type": "string",
      "description": "Select the deposit currency",
      "enum": ["USD", "EUR", "GBP"]
    }
  },
  "required": ["currency"]
}
  1. Leverage:
{
  "type": "object",
  "properties": {
    "leverage": {
      "type": "string",
      "description": "Select the leverage",
      "enum": ["1:30", "1:50", "1:100", "1:200", "1:500"]
    }
  },
  "required": ["leverage"]
}
  1. Tick model:
{
  "type": "object",
  "properties": {
    "tick_model": {
      "type": "string",
      "description": "Select the tick generation model",
      "enum": ["open_prices", "control_points", "every_tick", "real_ticks"]
    }
  },
  "required": ["tick_model"]
}
  1. Optimization on or off:
{
  "type": "object",
  "properties": {
    "optimization": {
      "type": "string",
      "description": "Select whether optimization is enabled",
      "enum": ["off", "on"]
    }
  },
  "required": ["optimization"]
}
  1. Visualization on or off:
{
  "type": "object",
  "properties": {
    "visualization": {
      "type": "string",
      "description": "Select whether visualization is enabled",
      "enum": ["off", "on"]
    }
  },
  "required": ["visualization"]
}

Defaults

Use these values as defaults unless the user changes them:

  1. Expert: Experts\codex\FVGTrader.ex5
  2. Symbol: GBPUSD
  3. Timeframe: M15
  4. Date range: last month
  5. Deposit: 100000
  6. Currency: USD
  7. Leverage: 1:100
  8. Tick model: real ticks
  9. Optimization: off
  10. Visualization: off

Tester INI

Create or update a tester .ini with the confirmed values.

Use this structure:

[Tester]
Expert=<ask_user_expert>
Symbol=GBPUSD
Period=M15
Model=4
Optimization=0
FromDate=2026.02.28
ToDate=2026.03.28
ForwardMode=0
Deposit=100000
Currency=USD
Leverage=1:100
ExecutionMode=0
Visual=0
Report=<ask_user_report>
ReplaceReport=1
ShutdownTerminal=1
UseLocal=1
UseRemote=0
UseCloud=0

Validation

After launching the test:

  1. Read the tester logs.
  2. Confirm the backtest really started.
  3. Confirm it finished.
  4. Read the generated report or result files.
  5. Summarize the actual metrics for the user.

If the terminal opens but the test does not run, do not invent results. State clearly that the launch failed and inspect the tester log before trying again.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.