MCPInstall
lzwme avatar

qmt-docs

QMT(迅投极速策略交易系统)Python 策略开发完整指南。涵盖策略编写、回测、实盘交易、API参考和代码示例。当用户需要开发 QMT 量化策略、查询 QMT API、从聚宽迁移至 QMT、编写实盘交易程序,或提及 QMT、迅投策略、QMT 回测时使用。

Installs
195
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/lzwme/finance-quant-skills --skill qmt-docs
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads qmt-docs automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

QMT Python 策略开发知识库

为 QMT(迅投极速策略交易系统)提供完整的 Python 开发参考,分为教程指南和 API 参考两层。

📖 文档结构

教程/指南(实践导向)
├── overview.md              系统概述、模式选择、入门路径
├── execution-mechanisms.md  三种运行机制详解(含流程图和代码模板)
├── backtesting-guide.md     回测完整流程(数据准备→参数设置→运行→分析)
├── live-trading-guide.md    实盘交易指南(账号配置→委托管理→风险控制)
├── quick-reference.md       ★ 常用 API 速查卡片
├── best-practices.md        编码规范、性能优化、风险管理、调试技巧
├── joinquant-migration.md   聚宽策略迁移至 QMT 指南
└── examples/                代码示例(backtest / live-trading / subscribe / run-time)

API 参考(官方完整文档)
└── python-innerApi/
    ├── start_now.md          快速开始(回测/实盘概览 + 三种机制示例)
    ├── data_function.md      行情与数据函数(get_market_data_ex 等完整参数)
    ├── trading_function.md   交易函数(passorder、get_trade_detail_data 等)
    ├── system_function.md    系统函数(ContextInfo 方法、定时器等)
    ├── callback_function.md  回调函数(account/order/deal/position 主推)
    ├── quote_function.md     引用函数(扩展数据、因子、VBA调用)
    ├── drawing_function.md   绘图函数
    ├── interface_operation.md 界面操作说明
    ├── data_structure.md     数据结构定义(Bar/Tick/Order/Position 等对象字段)
    ├── enum_constants.md     枚举常量(opType、orderType、委托状态等)
    ├── variable_convention.md 变量约定
    ├── code_examples.md      完整代码示例合集
    ├── user_attention.md     用户注意事项
    └── question_answer.md    常见问题

数据字典
└── dict/                    各品种数据字段(stock / indexes / future / option 等)

🚀 使用引导

按场景选择入口

场景首先阅读然后查阅
新手入门overview.md → execution-mechanisms.mdquick-reference.md
编写回测策略backtesting-guide.mdexamples/backtest.md
编写实盘策略live-trading-guide.mdexamples/live-trading.md
查询 API 用法quick-reference.md(速查)python-innerApi/data_function.md 等(完整参数)
从聚宽迁移joinquant-migration.mdoverview.md
代码质量优化best-practices.mdexamples/
数据结构查询python-innerApi/data_structure.mdpython-innerApi/enum_constants.md

快速查找路径

需要看函数怎么用?
  → quick-reference.md(常用函数精简版)
  → python-innerApi/data_function.md(数据获取类完整文档)
  → python-innerApi/trading_function.md(交易类完整文档)
  → python-innerApi/system_function.md(系统/ContextInfo 方法)

需要看完整代码?
  → python-innerApi/code_examples.md(官方示例合集)
  → examples/(精选示例)

需要查字段含义?
  → python-innerApi/data_structure.md(数据结构定义)
  → dict/(各品种数据字典)

遇到报错/问题?
  → python-innerApi/question_answer.md(官方FAQ)
  → python-innerApi/user_attention.md(注意事项)

🔧 关键速查

编码规范

#coding:gbk  # 必须在文件第一行

核心概念

概念说明
handlebarK线驱动(回测推荐)
subscribe事件驱动(仅实盘,高频)
run_time定时触发(监控场景)
quicktrade=0等待K线完成再下单(逐K线模式)
quicktrade=2立即下单(不需要等待)
最小单位100 股

最常用代码

# 获取历史行情数据(回测用 subscribe=False,实盘用 subscribe=True)
data = C.get_market_data_ex(['close'], [stock], end_time=bar_date,
                              period='1d', count=100, subscribe=False)
close_list = list(data[stock].iloc[:, 0])

# 获取全推实时行情
tick = C.get_full_tick(['600000.SH'])
price = tick['600000.SH']['lastPrice']

# 下单买入(23=买入, 1101=按股数, quicktrade=0 逐K线模式)
passorder(23, 1101, account, stock, 5, -1, 100, C)

# 下单买入(quicktrade=2 立即下单模式)
passorder(23, 1101, account, stock, 5, -1, 100, '策略名', 2, '备注', C)

# 查询持仓
holds = get_trade_detail_data(account, 'stock', 'position')
holds_dict = {f'{p.m_strInstrumentID}.{p.m_strExchangeID}': p.m_nVolume for p in holds}

# 查询账户可用资金(单位:分)
cash = get_trade_detail_data(account, 'stock', 'account')[0].m_dAvailable

⚠️ 使用注意事项

  1. 编码声明:文件首行必须是 #coding:gbk,不可省略
  2. 位置参数:get_market_data_ex 的前两个参数 fields 和 stocks 必须用位置参数,不能用 fields= 或 stocks=
  3. subscribe 参数:回测必须 False,实盘使用 True
  4. 账号类型:get_trade_detail_data 的第二个参数:股票用 'stock',两融用 'credit'
  5. 金额单位:m_dAvailable 等金额字段单位是分,需 /100 转换为元
  6. 数量单位:股票交易必须是 100 的整数倍
  7. 实盘限制:subscribe 和 run_time 仅支持实盘,不支持回测

FAQ

What does the qmt-docs skill do?

QMT(迅投极速策略交易系统)Python 策略开发完整指南。涵盖策略编写、回测、实盘交易、API参考和代码示例。当用户需要开发 QMT 量化策略、查询 QMT API、从聚宽迁移至 QMT、编写实盘交易程序,或提及 QMT、迅投策略、QMT 回测时使用。

How do I install qmt-docs?

Run npx skills add https://github.com/lzwme/finance-quant-skills --skill qmt-docs in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/qmt-docs/ (personal) or .claude/skills/qmt-docs/ (project).

Which AI agents can use qmt-docs?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is qmt-docs safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains qmt-docs?

It is published by lzwme in lzwme/finance-quant-skills. It has 195 recorded installs.

More from lzwme/finance-quant-skills

View all →
lzwme avatar

pywencai

lzwme/finance-quant-skills

同花顺问财数据查询:使用中文自然语言查询A股、指数、基金、港美股、可转债等市场数据;当用户需要通过自然语言从问财获取选股、财务、资金流、技术指标等数据时使用。

Business & Finance300 installs
lzwme avatar

akshare

lzwme/finance-quant-skills

AKShare 开源金融数据接口库,提供股票、期货、期权、基金、外汇、债券、指数、加密货币等全品类金融数据;当用户需要获取各类金融市场数据时使用

Business & Finance280 installs
lzwme avatar

baostock

lzwme/finance-quant-skills

BaoStock 免费开源 A 股数据平台,无需注册、无需 API Key,支持股票行情、K线、财务数据、行业分类、指数成分股查询。当用户提及 baostock、需要获取A股历史行情、财务报表、交易日历,或需要免费、免注册的A股数据时使用。与 tushare(数据更全但需注册)和 jqdatasdk(聚宽数据)不同,baostock 完全免费无限制,适合快速入门和低成本数据需求。

Backend & APIs278 installs
lzwme avatar

tdxquant

lzwme/finance-quant-skills

通达信量化数据获取技能。当用户提及 tdxquant、通达信、TdxQuant、tqcenter,并且需要获取A股数据(行情快照、K线、财务、板块、可转债、新股、交易数据等)、查询交易日历、执行通达信公式、订阅行情、交易下单时使用

Business & Finance238 installs
lzwme avatar

backtrader

lzwme/finance-quant-skills

Backtrader 开源量化回测框架,支持多数据源、多策略、多周期回测与实盘交易,纯Python实现。当用户需要开发量化策略、进行回测分析、编写交易逻辑、回测参数优化,或提及 backtrader、量化回测框架时使用。若用户仅需数据获取而无回测需求,引导使用 baostock/akshare/tushare 等数据 Skill。

Business & Finance229 installs
lzwme avatar

miniqmt

lzwme/finance-quant-skills

MiniQMT 迅投量化交易接口,基于 XtQuant Python 库(xtdata 行情 / xttrader 交易),供外部 Python 程序连接 MiniQMT 客户端,支持 A 股/期货/期权的行情获取(K线、分笔、财务数据等)和交易下单(报单、撤单、查询资产/委托/持仓)。当用户提及 miniqmt、xtquant、获取实时行情、量化交易下单、回测数据获取,或需要用外部 Python 程序连接 MiniQMT 客户端进行程序化交易时使用。若需在 QMT 客户端内编写/回测内置策略(ContextInfo/passorder),请用 qmt-strategy 技能。

Business & Finance226 installs

Popular docs & writing skills

View category →
mattpocock avatar

grill-with-docs

mattpocock/skills

A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

Docs & Writing1.4M installs
open.feishu.cn avatar

lark-markdown

open.feishu.cn

飞书 Markdown:查看、创建、上传、编辑和比较飞书中的原生 Markdown 文件。当用户要操作飞书 Markdown 文件,或比较其远端版本及本地草稿时使用。纯本地 Markdown 文件操作不触发本 skill。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。

Docs & Writing895K installs
mattpocock avatar

writing-for-agents

mattpocock/skills

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

Docs & Writing586.9K installs
heygen-com avatar

slideshow

heygen-com/hyperframes

Build a HyperFrames slideshow to present live - slides, fragment reveals, branching hotspots and presenter mode with speaker notes, served by hyperframes present - or turn an existing page into one. Use when the person wants a deck or presentation rather than a rendered video.

Docs & Writing564.1K installs
mattpocock avatar

writing-beats

mattpocock/skills

Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.

Docs & Writing560.9K installs
mattpocock avatar

writing-shape

mattpocock/skills

Writing, exploit: shape raw material into an article, paragraph by paragraph.

Docs & Writing560.6K installs