Skip to content

Releases: Boschi404/mt5-mcp-server

v2.1 — Sharpe/Sortino/Calmar + Validation

Choose a tag to compare

@Boschi404 Boschi404 released this 02 Aug 19:04

v2.1 — Risk Metrics Done Right

New: get_risk_metrics tool (37th)

  • Sharpe Ratio — properly annualized using trading frequency, risk-free rate subtracted
  • Sortino Ratio — downside-only volatility, penalizes negative returns
  • Calmar Ratio — annualized return / max drawdown

Validation Checks

Every metric comes with sanity checks:

  • Sharpe > 10? → WARNING: suspiciously high
  • Sortino >> Sharpe? → CHECK: positive skew verified
  • Profit Factor > 100? → WARNING: likely look-ahead bias
  • Win Rate > 95%? → WARNING: survivorship bias
  • Output: GOOD / SUSPICIOUS / UNRELIABLE

Pipeline Integration

  • Monte Carlo phase now computes all risk metrics
  • Report shows Sharpe/Sortino/Calmar with colored indicators
  • Validation warnings displayed in report

v2.0.1 — Pipeline phases ALL REAL, no placeholders

Choose a tag to compare

@Boschi404 Boschi404 released this 02 Aug 18:02

v2.0.1 — Every Phase Implemented

All 9 pipeline phases now execute REAL computations:

  1. ✅ Create — MQL5 code generation
  2. ✅ Compile — MetaEditor compilation
  3. ✅ Screen — Multi-symbol 1M OHLC backtest
  4. ✅ Correlate — Correlation matrix + diversification score
  5. ✅ Optimize — Tick-data genetic optimization
  6. ✅ Monte Carlo — 1000 sims, skip 10% random trades
  7. ✅ Kelly — Position sizing from real trade data
  8. ✅ Robustness — 100 random 6-month windows
  9. ✅ Report — Full HTML report with all metrics

Zero placeholders. Every phase writes results to its folder.

v2.0 — AUTONOMOUS PIPELINE (36 tools)

Choose a tag to compare

@Boschi404 Boschi404 released this 02 Aug 17:54

🚀 v2.0 — Full Autonomous Strategy Pipeline

🆕 The Pipeline (2 new tools)

  • build_strategy_code — Generate complete MQL5 EA from natural language description
  • run_autonomous_pipeline — One command to run ALL phases:

Pipeline Phases

  1. Create — Generate MQL5 code from description with all parameters
  2. Compile — Compile to .ex5 + error check
  3. Screen — Test on 15+ major symbols with 1M OHLC
  4. Correlate — Find uncorrelated candidates for portfolio
  5. Optimize — Tick-data optimization with fixed risk
  6. Monte Carlo — 1000 simulations, skip 10% random trades
  7. Kelly — Position sizing, max 15% DD
  8. Robustness — 100x 6-month random start backtests
  9. Report — Final comprehensive PDF/HTML report

Report Includes

  • Strategy explanation + timeframe + assets
  • Correlation matrix between assets
  • Monte Carlo stats (probabilities, confidence intervals)
  • Z-Score, Sharpe, Sortino, LR Correlation
  • Max DD, Total Profit %, Time-normalized returns
  • Trade count + frequency, Win rate, Avg RR
  • Max/Avg Win & Loss, Max Win/Loss Streaks

Folder Structure

pipelines/StrategyName_20260101/
├── 01_create/        MQL5 code + parameters
├── 02_compile/       Compilation results
├── 03_screen/        Multi-symbol screening
├── 04_correlate/     Correlation analysis
├── 05_optimize/      Tick-data optimization
├── 06_montecarlo/    1000 simulations
├── 07_kelly/         Position sizing
├── 08_robustness/    100x 6-month tests
└── 09_report/        Final PDF report

Example

LLM → build_strategy_code('Channel breakout on M15 with EMA50 H4, SL 700pts, TP 3000pts')
LLM → run_autonomous_pipeline('GoldBreakout', strategy_description='...')

→ 20 minutes later: complete strategy report on your Desktop

v1.4 — Batch Testing + Portfolio Diversification Analyzer (34 tools)

Choose a tag to compare

@Boschi404 Boschi404 released this 02 Aug 15:56

🚀 v1.4 — Portfolio Intelligence (34 tools)

🆕 Batch Testing

  • run_multi_backtest — Test EA on multiple symbols in one call, get aggregate stats
  • backtest_to_returns — Convert results to returns series for portfolio analysis

🆕 Portfolio Diversification (0-100 score)

  • analyze_portfolio_diversification — Comprehensive scoring with:
    • Correlation matrix + pair analysis
    • Diversification score (0-100) with verdict
    • Volatility reduction benefit %
    • Concentration risk detection
    • Asset class coverage analysis
    • Specific recommendations (which pairs to remove)

🆕 Live Portfolio Health

  • get_portfolio_health — Real-time portfolio analysis:
    • Total P&L, exposure, margin usage
    • Win/loss ratio
    • Concentration risk (single symbol dominance)
    • Health verdict: HEALTHY / CONCENTRATED / DRAWING DOWN

Scoring Scale

  • 80-100: 🏆 EXCELLENT — Highly diversified
  • 60-79: ✅ GOOD — Well diversified
  • 40-59: ⚠️ MODERATE — Some concentration risk
  • 20-39: 🔴 POOR — High correlation
  • 0-19: ❌ NOT DIVERSIFIED — Single asset portfolio

Full Pipeline Now

Write EA → Compile → Multi-Backtest → Returns → Diversification Score → Kelly Sizing → Live Trade → Monitor Health

v1.3 — Live Trading + Portfolio + Data (30 tools)

Choose a tag to compare

@Boschi404 Boschi404 released this 02 Aug 15:46

🚀 v1.3 — 30-Tool Complete MT5 Suite

🔴 LIVE TRADING (NEW — 6 tools)

  • place_order — Market & pending orders (buy/sell/limit/stop)
  • get_positions — Open positions with real-time P&L
  • close_position — Close by ticket or close all
  • modify_position — Modify SL/TP on open positions
  • get_account — Balance, equity, margin, leverage
  • get_order_history — Historical deals with P&L

📊 PORTFOLIO (NEW — 3 tools)

  • calc_correlation — Correlation matrix, diversification score
  • calc_efficient_frontier — Markowitz optimal weights, max Sharpe
  • calc_risk_allocation — Equal risk, Kelly, inverse-DD allocation

📡 DATA (NEW — 5 tools)

  • get_bars — OHLC bar data for any symbol/timeframe
  • get_ticks — Raw tick data with spread stats
  • list_symbols — All available trading symbols
  • get_latest_price — Real-time bid/ask for multiple symbols
  • get_symbol_info — Spread, swap, margin, tick value

📈 Previously (v1.0-v1.2)

Backtest, Optimization, EA dev, Compilation, Monte Carlo, Walk-Forward, Kelly, CSV export

Full Pipeline

LLM can now: Write EA → Compile → Backtest → Optimize → Monte Carlo → Walk-Forward → Kelly sizing → Live Trade → Monitor positions — all via MCP

v1.2 — Advanced Analytics Suite

Choose a tag to compare

@Boschi404 Boschi404 released this 02 Aug 15:36

🚀 v1.2 — 17-tool MCP Server with Advanced Analytics

New Tools (6 added since v1.1)

Monte Carlo:

  • run_monte_carlo — 1000-simulation robustness test with P5/P95 confidence intervals
  • run_walk_forward — Rolling window OOS validation to detect overfitting

Position Sizing:

  • calc_position_size — Kelly Criterion, Optimal F, Risk of Ruin calculator

Data & Analysis:

  • get_symbol_info — Full symbol specs: spread, swap, margin, tick value
  • export_trades — Export backtest results to CSV
  • get_trade_stats — Expectancy, Z-score, Sharpe, streaks

Full 17-Tool Suite

1-5: Backtest & Optimization
6-9: EA Development & Compilation
10-11: Results & Parameters
12-17: NEW — Advanced Analytics

Install

git clone https://github.com/Boschi404/mt5-mcp-server.git
pip install fastmcp MetaTrader5 numpy

v1.1 — Full MT5 Control Suite

Choose a tag to compare

@Boschi404 Boschi404 released this 02 Aug 15:13

🚀 v1.1 — 11-tool MCP Server

New Tools (6 added since v1.0)

Optimization:

  • run_mt5_optimization — Genetic & complete parameter sweeps
  • get_optimization_results — Parse .opt files with best passes

EA Development:

  • write_expert — Write/update .mq5 source code with auto-compilation
  • compile_expert_file — Compile .mq5 → .ex5 via MetaEditor
  • read_expert_code — Read full MQL5 source
  • get_ea_parameters — Extract input params, types, defaults

Full Workflow Now Possible

  1. Write EA code → compile → optimize → analyze results — all via LLM
  2. Perfect for: backtesting, EA development, portfolio optimization
  3. Works with Hermes Agent, Claude Desktop, and any MCP client

Install

git clone https://github.com/Boschi404/mt5-mcp-server.git
pip install fastmcp MetaTrader5
hermes mcp add mt5-backtest --command python --args server.py --timeout 600