xtquantai

xtquantai

site icon
2025.03.17 53
Python量化交易AI 集成金融服务金融服务
xtquantai 是一个基于 Model Context Protocol (MCP) 的服务器,它将迅投 (xtquant) 量化交易平台的功能与人工智能助手集成,使 AI 能够直接访问和操作量化交易数据和功能。
View on GitHub

Overview

基本能力

产品定位

xtquantai 是一个将量化交易平台与 AI 助手集成的服务器,旨在通过 AI 直接访问和操作量化交易数据和功能。

核心功能

  1. 基础数据查询
  2. 获取交易日期 (get_trading_dates)
  3. 获取板块股票列表 (get_stock_list)
  4. 获取股票详情 (get_instrument_detail)

  5. 行情数据

  6. 获取历史行情数据 (get_history_market_data)
  7. 获取最新行情数据 (get_latest_market_data)
  8. 获取完整行情数据 (get_full_market_data)

  9. 图表和可视化

  10. 创建图表面板 (create_chart_panel)
  11. 创建自定义布局 (create_custom_layout)

适用场景

  • 量化交易数据分析
  • AI 辅助交易决策
  • 股票市场研究和可视化

工具列表

  1. get_trading_dates - 获取指定市场的交易日期
  2. get_stock_list - 获取特定板块的股票列表
  3. get_instrument_detail - 获取股票的详细信息
  4. get_history_market_data - 获取股票的历史行情数据
  5. get_latest_market_data - 获取股票的最新行情数据
  6. get_full_market_data - 获取股票的完整行情数据
  7. create_chart_panel - 创建股票图表面板,支持各种技术指标
  8. create_custom_layout - 创建自定义的图表布局

常见问题解答

  1. QMT 生态系统目前仅支持 Windows,因此以下均在 Windows 环境实现。
  2. Windows 环境在实现 MCP 过程中有不少细节,需要注意。
  3. uv 是有缓存的,因此一旦中间有错误的运行,不删缓存就会一直不更新,记得运行一下删除。

使用教程

使用依赖

  • Python 3.11 或更高版本
  • 迅投 QMT 或投研终端
  • uv 包管理工具 (推荐)

安装 uv:

pip install uv

安装教程

下载项目:

git clone https://github.com/dfkai/xtquantai.git

调试方式

  1. 直接启动服务器:
python -m xtquantai

xtquantai
  1. 使用 MCP Inspector 进行调试:
npx @modelcontextprotocol/inspector uv run xtquantai
  1. 构建和发布:
uv sync
uv build
uv publish

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。