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 |
许可
Metadata
Release files for qmt-bridge-pro 2.11.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qmt_bridge_pro-2.11.2.tar.gz | 126.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qmt_bridge_pro-2.11.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 283.1 kB
Release files / qmt_bridge_pro-2.11.2.tar.gz
| Download URL | qmt_bridge_pro-2.11.2.tar.gz |
|---|---|
| Size | 126.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c895a757dac232821b488cb3057b250ab7a4c6b098cd2b5af8e52803b5d78ed
|
|
BLAKE2b-256 checksum How to use checksums |
66af77f242a64b870bc76955c01e6cf2a86a022b175b3427cb47586ff65e9e67
|
| 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 logRelease files / qmt_bridge_pro-2.11.2-py3-none-any.whl
| Download URL | qmt_bridge_pro-2.11.2-py3-none-any.whl |
|---|---|
| Size | 157.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
279111d8edbe4e938d9e840f38c65332491940a9f56b7aeff00162762034a6a8
|
|
BLAKE2b-256 checksum How to use checksums |
fa93a6c299b5c8e4cf788e4f0ff318983c4c0bbef95882d00589fdda5db12dbd
|
| 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