欢迎访问 外汇EA下载与MT4/MT5自动交易资源 - 聚合外汇EA、黄金EA、量化交易工具与自动化交易实战内容。
登录 注册

mt-数据-MCP | mt-data-mcp

author emer | 17 人阅读 | 0 人评论 |

MetaTrader5 的 MCP 服务器,提供市场数据和技术指标

mtdata

mtdata是MetaTrader 5(MT5)的研究与自动化工具包。它提供预测、体制检测、信号处理、风险分析和报告工具——将原始市场数据与数据科学相结合。

它以模型上下文协议(MCP)服务器还是独立服务器CLI.

这是给谁的?

  • 新手交易者/学习者:遵循指导的工作流程(无需定量背景)。
  • 系统性交易者:原型想法,快速回测,并通过CLI/MCP实现自动化。
  • 数据专家:将MT5市场数据导入可重复的分析流程。

平台支持(重要)

  • 必须有窗户 to run MetaTrader 5 (and therefore to run mtdata against MT5).
  • If you're on macOS/Linux, run mtdata on a Windows 虚拟机或 Windows 机器并实现远程连接(MCP/Web API)。
  • Python 3.14 是支持的运行时对于该仓库中的封装依赖集合。

安全第一

  • mtdata includes trade_* commands that can 下放/修改/关闭真实订单在目前登录MT5的账户上。
  • Use a 演示账户直到你了解工具和经纪人设置。
  • mtdata 没有内置的“纸币交易”模式;使用MT5演示账号进行模拟执行。
  • If you only want research, stick to data_, forecast_, regime_, patterns_, and report_* commands.

Capabilities

Category它的作用关键工具
Data从MT5获取蜡烛、tick、市场深度和排名市场扫描data_fetch_candles, data_fetch_ticks, market_depth_fetch, market_ticker, symbols_top_markets
Forecasting用经典模型、机器学习模型或基础模型预测价格路径forecast_generate, forecast_backtest_run
Volatility估算未来价格变动幅度forecast_volatility_estimate
Regimes检测趋势、波动或危机市场状态regime_detect
Barriers通过模拟计算TP/SL命中概率forecast_barrier_prob, forecast_barrier_optimize
Patterns识别烛台和图表模式patterns_detect
Indicators计算100+技术指标data_fetch_candles --indicators
Denoising平滑价格数据以揭示趋势--denoise option
Temporal发现会话效果和季节性模式temporal_analyze
Trading下单,管理仓位trade_place, trade_close
Fundamentals美国股市数据、筛选、新闻、日历finviz_fundamentals, finviz_screen, finviz_calendar
Options期权链与量化自由障碍定价forecast_options_chain, forecast_quantlib_barrier_price

快速入门

Prerequisites: Windows + Python 3.14 + MetaTrader 5 installed and running (demo account recommended).

# Lean core install
pip install -e .

# Full research/web install
pip install -r requirements.txt

# Verify MT5 connection (lists symbols from the running terminal)
mtdata-cli symbols_list --limit 5

# Scan the current MT5 watchlist for top markets
mtdata-cli symbols_top_markets --rank-by all --limit 5 --timeframe H1

# Fetch recent candles
mtdata-cli data_fetch_candles EURUSD --timeframe H1 --limit 50

# Generate a baseline price forecast
mtdata-cli forecast_generate EURUSD --timeframe H1 --horizon 12 --method theta

Notes:

  • pip install -e . now installs the lean core package only.
  • pip install -r requirements.txt installs the full validated Python 3.14 stack, including Chronos/TimesFM, StatsForecast, sktime, mlforecast, and the Web API.
  • gluonts/Lag-Llama, hnswlib, and tsdownsample are intentionally excluded from the default 3.14 environment because current wheel support is incomplete or incompatible.

Documentation

新来的?请遵循以下学习路径:
docs/SETUP.mddocs/GLOSSARY.mddocs/CLI.mddocs/SAMPLE-TRADE.md (then docs/SAMPLE-TRADE-ADVANCED.md and deep dives).

入门指南

核心主题

外部数据与选项

Tutorials

Reference

Configuration

Create a .env file in the project root:

MT5_LOGIN=12345678
MT5_PASSWORD=your_password
MT5_SERVER=your_broker_server
MT5_TIME_OFFSET_MINUTES=0  # Adjust if broker server time differs from UTC

Architecture

mtdata/
├── src/mtdata/
│   ├── core/           # Tool registry, schemas, server logic, all 52 MCP tools
│   ├── forecast/       # Forecasting methods, engines, and method registry
│   ├── patterns/       # Pattern detection algorithms
│   ├── services/       # MT5 data access, Finviz, options data
│   └── utils/          # Shared utilities (indicators, denoising, etc.)
├── webui/              # React + Vite frontend
├── docs/               # Documentation
└── tests/              # Test suite

License

MIT


文章来源:https://github.com/emerzon/mt-data-mcp

🔐
请登录后参与评论
注册满12小时后评论,即可解锁附件下载
立即登录