Claude Connects to MetaTrader 5 for Backtesting and Optimization
Trader connects Claude to MT5 via MCP, gets account analysis, chart reading, and a full EA backtest/optimization from prompts.
- Used for
- Side business
- Skill needed
- No code
- Shown in video
- Partial demo
- Summary based on
- Transcript
I Connected Claude to My MT5 Account (Here's What It Does)
Published Nov 11, 202610:02114,250 views1,329 likes
What they made
Claude analyzed trade history, read EURUSD RSI, and ran a backtest and optimization of ExpertMACD, improving from -$40 to +$89 with profit factor 1.45 and 52% win rate on a demo account.
profit factor 1.45, win rate 52%, +$89
5:32How they did it
- Human1:27
Enabled MT5 internal MCP server, generated API key, and created .mcp.json config file.
Stated in video · MetaTrader 5 - AI3:08
Listed available MT5 tools and read account balance, equity, and open trades.
Stated in video · Claude - AI3:41
Analyzed full trade history, broke down performance by expert advisor, and reported win rate and loss streaks.
Stated in video · Claude - AI4:16
Opened EURUSD H1 chart, added RSI(14), and read its value.
Stated in video · Claude - AI4:47
Ran backtest of ExpertMACD on EURUSD H1 for first half of 2026 and reported -$40, profit factor 0.84, win rate 26%.
Stated in video · Claude - AI5:32
Ran optimization of MACD settings, then re-tested best settings on every tick, achieving +$89, profit factor 1.45, win rate 52%, drawdown 0.3%.
Stated in video · Claude - AI6:38
Refused to open a trade, citing inability to distinguish demo from real account, but reviewed the trade with broker and calculated margin.
Stated in video · Claude
What you can reuse
- Claude can connect to MT5 via built-in MCP to analyze accounts, read charts, and run backtests/optimizations from natural language prompts.
- Claude refused to open trades even on a demo account, acting as a review assistant rather than an autonomous trader.
- Optimization results may be overfit; Claude itself warned about small sample size and limited date range.
Trade-offs
- MT5 must remain open and Claude must run on the same computer.
- Claude does not monitor markets or trade autonomously.
- Optimization sample was small (99 trades) and only tested on 2026 data.
AI-generated case summaries can contain mistakes. Report an error



