Skip to main content

QMT Bridge

将 miniQMT(xtquant)封装为 HTTP/WebSocket API,供局域网内任意语言调用。

在线文档:QMT Bridge 文档

调用方(HTTP / QMTClient)               Windows(与 QMT 同机)
┌──────────────────────┐                ┌─────────────────────────┐
│  策略 / BFF / 脚本    │   HTTP/WS     │  miniQMT 客户端(登录中)  │
│                      │ ◄───────────► │  qmt-server (本仓库)      │
└──────────────────────┘   局域网       │  xtquant                 │
                                       └─────────────────────────┘

本仓库只提供 API 与 Python 客户端。自然语言交易 / 复盘工作流已迁至独立仓库 qmt-trading-skill(不再包含 skills/)。

安装

面向开发者:

git clone https://github.com/atorber/qmt-bridge.git
cd qmt-bridge
pip install -e ".[full]"
cp .env.example .env

面向桌面用户(无需本机 Python):从 GitHub Release 下载 QMTBridge-Setup-*-x86-win.exe(Intel/AMD)或 *-arm-win.exe(ARM)。本地打包见 快速开始。

仅客户端(零依赖 stdlib):pip install qmt-bridge-pro 或 pip install -e ".[client]"。导入仍为 from qmt_bridge import QMTClient。

启动

QMT 勾选「独立交易」登录并保持运行,然后:

qmt-server --port 8080

qmt-server --port 8080 --trading --api-key your-secret-key \
  --mini-qmt-path "C:\你的QMT路径\userdata_mini" \
  --stock-account-id 普通账户ID --credit-account-id 信用账户ID

代码默认端口 8000;若 .env 里改了 QMT_BRIDGE_PORT,客户端与 Skill 必须用同一端口。验证:http://127.0.0.1:<端口>/docs 或 GET /api/meta/health。长期运行见 scripts/pm2-start.bat。

完整配置见 docs/configuration.md。

Python 客户端

from qmt_bridge import QMTClient

client = QMTClient(host="127.0.0.1", port=8080, api_key="your-key")
snapshot = client.get_market_snapshot(["000001.SZ"])
from qmt_bridge.accounts import resolve_default_trading_account

文档

文档 说明
快速开始 安装、启动、客户端示例
REST API HTTP 参数与响应
WebSocket 实时推送
Python 客户端 QMTClient

许可

MIT

Metadata

Release files for qmt-bridge-pro 2.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qmt-bridge-pro 2.11.0
File Size Uploaded
qmt_bridge_pro-2.11.0.tar.gz 124.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qmt-bridge-pro 2.11.0
File Interpreter ABI Platform
qmt_bridge_pro-2.11.0-py3-none-any.whl Python 3 none any Details

Total release size: 279.7 kB

Release files / qmt_bridge_pro-2.11.0.tar.gz

Download URL qmt_bridge_pro-2.11.0.tar.gz
Size 124.2 kB
Tags Source
SHA-256 checksum
How to use checksums
91cae28ca006f3a0c17d13519948b709fd35cc59c46547edfc9ef4554147f1b8
BLAKE2b-256 checksum
How to use checksums
0aabfd9333b3cca237b3887bb3c54fc8b74e015b58c9a67fa1918f856927535a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / qmt_bridge_pro-2.11.0-py3-none-any.whl

Download URL qmt_bridge_pro-2.11.0-py3-none-any.whl
Size 155.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85556b08762b9e4d3a28ec80b638f8b463d33d13b2f05dac9ac662a91eed04e2
BLAKE2b-256 checksum
How to use checksums
f4fd810351a89858f6fb1a02b45357ff7ab90e95682a2d48581ed64feaccd853
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

2.11.5

2 release files

2.11.3

2 release files

2.11.2

2 release files

2.11.1

2 release files

This release

2.11.0 This release

2 release files

2.10.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page