Skip to main content
Glama
CaioAllgayer

TradeLab-MCP

by CaioAllgayer

TradeLab-MCP

定量調査のためのMCPサーバー。AIが戦略を定義します。MetaTrader 5 Strategy Tester がバックテストを実行します。

IA (Codex / GPT / Grok / Gemini / Claude)
        │ MCP
        ▼
Trading Research MCP
        │
        ▼
terminal64.exe  →  Strategy Tester oficial  →  runs/<run_id>/

PHUICMT/mcp-mt5 のフォーク (MIT)。テスターをPythonで再実装するものではありません。

原則

MT5 は、注文、約定、ティック、スプレッド、SL/TP、証拠金、手数料、P&L の公式な情報源です。

Python は実験を整理するだけです (run_id、マニフェスト、ハッシュ、パーサー、派生統計)。

各バックテストは一意の識別子を生成します。「最新のファイル」で取得されるものはありません。

runs/20260817_073412_a8f231/
  tester.ini
  strategy.mq5
  strategy.ex5
  report.htm
  tester.log
  trades.csv
  metrics.json
  manifest.json

Related MCP server: OpenFinClaw CLI

MCP ツール (V1)

ツール

機能

health

MT5、MetaEditor、ターミナル、データディレクトリ、Experts、Tester、ビルド

compile

.mq5 をコンパイルしてハッシュを返す

run_backtest

公式テスター → run_id + メトリクス + アーティファクト

run_batch

同じ戦略、複数の銘柄、逐次実行

get_run

run_id で実験を取得

get_trades

その run_id の正規化されたトレード

compare_runs

run 間のメトリクスの差分

walk_forward

IS/OOS ウィンドウ、それぞれが公式バックテスト

smoke_test

コンパイル + 短いテスター実行 (シンボル/期間/モデル/日付を設定可能)

インストール

Windows + MetaTrader 5 + Python 3.10+。

cd C:\Users\caioa\TradeLab-MCP
python -m pip install -e ".[dev]"

MCP クライアント:

{
  "mcpServers": {
    "tradelab": {
      "command": "tradelab-mcp",
      "env": {
        "MT5_INSTALL": "C:\\Program Files\\MetaTrader 5",
        "TRADE_LAB_ROOT": "C:\\Users\\caioa\\TradeLab-MCP\\research"
      }
    }
  }
}

変数: MT5_INSTALLMT5_DATAMT5_TERMINAL_HASHTRADE_LAB_ROOT

Compile este EA e faça um backtest de PETR4 D1,
entre 2015 e 2025, usando real ticks.

エージェントは run_backtest(strategy="experts/RSI2.mq5", symbol="PETR4", timeframe="D1", from_date="2015.01.01", to_date="2025.08.01", model=4) を呼び出して、次の結果を受け取ります:

{
  "run_id": "20260817_073412_a8f231",
  "status": "completed",
  "symbol": "PETR4",
  "period": "D1",
  "model": "real_ticks",
  "metrics": {
    "total_trades": 134,
    "net_profit": 18342.21,
    "profit_factor": 1.48
  }
}

get_run("20260817_073412_a8f231") はまさにその実験を返します。

MT5 内での EA の場所

すべての自動テスト EA は次の場所に公開されます:

<MQL5>\Experts\TradeLab MCP\

この PC では次のように解決されます:

C:\Users\caioa\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\Experts\TradeLab MCP

Strategy Tester では、エキスパートは TradeLab MCP\RSI2 として表示されます。フォルダーは常にアクティブなターミナルに相対的であり (layout.experts_dir)、固定ハッシュではありません。

git のソースは引き続き experts/ にあります。MCP はソース + .ex5 + ローカルインクルードをターミナルフォルダーにコピーします。

ラボの基本 EA (CTrade、ArraySetAsSeries、1ポジション) はまだ標準化されていません — 後でゆっくり追加します。

受け入れ EA

experts/RSI2.mq5

  • RSI(2)

  • RSI < 10 で買い

  • RSI > 70 で決済

  • 1ポジション

  • 最適化なし

受け入れテスト#1: 同じ EA / 銘柄 / 日付 / 入力 / 資本 / モデルを、手動の Strategy Tester と MCP 経由で使用した場合、同じメトリクスと同じトレードを生成しなければなりません。

テスト

pytest

統合テスト (Windows + 実 MT5):

$env:TRADE_LAB_INTEGRATION = "1"
$env:TRADE_LAB_SYMBOL = "EURUSD"
pytest tests/test_integration_mt5.py -v

優先順位

再現性 > 信頼性 > シンプルさ > 速度 > 機能

V1 は逐次実行です (データディレクトリに mt5.lock ロック)。並列 Python バックテスターはありません。公式ソースとしての .opt パーサーはありません。

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    MCP server that provides AI agents with financial tools including real-time quotes, backtesting, technical analysis, and multi-exchange data via a simple CLI interface.
    1
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    An MCP server exposing a registry of paper-backed quantitative trading methods plus a deterministic, no-LLM decision helper for reproducible trading research.
    13
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    MCP server that exposes the Backtest360 backtesting engine API as tools, enabling AI agents to conversationally discover indicators, build and validate strategies, run backtests, and read results.
    14
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • MCP server for Gainium — manage trading bots, deals, and balances via AI assistants

  • Build, backtest, and deploy quantitative trading strategies from your AI agent.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CaioAllgayer/TradeLab-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server