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.3

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.3
File Size Uploaded
qmt_bridge_pro-2.11.3.tar.gz 126.3 kB Details

Built distribution (wheel)

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

Total release size: 283.5 kB

Release files / qmt_bridge_pro-2.11.3.tar.gz

Download URL qmt_bridge_pro-2.11.3.tar.gz
Size 126.3 kB
Tags Source
SHA-256 checksum
How to use checksums
158f95f6fe397f1007b80afae7df336328b8f5e8c6a1bde518ff4434c841fe55
BLAKE2b-256 checksum
How to use checksums
d0dfdd1446807c03268f0937c0d1746f3029b9b8775b124f30a62f9c5284fdb9
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.3-py3-none-any.whl

Download URL qmt_bridge_pro-2.11.3-py3-none-any.whl
Size 157.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5670da3390db28e407392b78536240739a286d9a95c165d015d0ea5417a6eac0
BLAKE2b-256 checksum
How to use checksums
ddc2d5ddfe97ce2c77c443b1c99307d291f3f14b7963e570c3aa095cf1c04269
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

This release

2.11.3 This release

2 release files

2.11.2

2 release files

2.11.1

2 release files

2.11.0

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