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

仅客户端(零依赖 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.10.1

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.10.1
File Size Uploaded
qmt_bridge_pro-2.10.1.tar.gz 103.0 kB Details

Built distribution (wheel)

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

Total release size: 240.2 kB

Release files / qmt_bridge_pro-2.10.1.tar.gz

Download URL qmt_bridge_pro-2.10.1.tar.gz
Size 103.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3160a03aad15d733725af7b3800b7c5da3a8a26f7b1ed2b33bd6073e628fa13c
BLAKE2b-256 checksum
How to use checksums
02a2df9d85d1249129221b2f1e26cc4130abd5030db5b1256f9135dd5f743116
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 Aug 14, 2026.

Transparency log

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

Download URL qmt_bridge_pro-2.10.1-py3-none-any.whl
Size 137.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0d620321b9a8c7bd45258b5ff269cde45930c63cc2b5d12b082824bfc2f8aff
BLAKE2b-256 checksum
How to use checksums
d366f7a5a2ed2bf146c3e3222aa9220f7232f9ea4b8abc09abb0ff94a20e88bf
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 Aug 14, 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

2.11.0

2 release files

This release

2.10.1 This release

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