Miniqmt Skill logo

Miniqmt Skill

Community
xiaxiaoqian
miniqmt-skill

MiniQMT量化交易开发技能,基于迅投XtQuant库提供行情数据获取(xtdata)和交易执行(xttrader)功能。用于开发股票、期货、期权等量化交易策略,支持历史/实时行情数据下载、K线/分笔数据获取、财务数据查询、自动下单/撤单、持仓查询、资产查询等。适用于需要连接MiniQMT客户端进行量化交易的场景。

Overview

Publisherxiaxiaoqian
Repositoryminiqmt-skill
Skill nameminiqmt-skill
Stars
61
Forks
20
Bundled files
5
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by xiaxiaoqian on GitHub. Read the source before you install it.

Installation

Install the Miniqmt Skill AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/xiaxiaoqian/miniqmt-skill/tree/main/skills
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/xiaxiaoqian/miniqmt-skill.git /tmp/miniqmt-skill
mkdir -p .claude/skills
cp -r /tmp/miniqmt-skill/skills .claude/skills/miniqmt-skill
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Miniqmt Skill in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Miniqmt Skill on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Miniqmt Skill is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

MiniQMT 量化交易开发指南

概述

MiniQMT是基于迅投QMT的极简量化交易终端,通过XtQuant Python库提供行情和交易API。

运行依赖:

  • 已安装MiniQMT客户端并启动
  • Python 3.6-3.12 (64位)
  • 安装xtquant库

核心模块:

  • xtdata - 行情数据模块:K线、分笔、财务数据、合约信息等
  • xttrader - 交易模块:下单、撤单、查询、主推消息

快速开始

1. 行情数据获取

python
from xtquant import xtdata

# 下载历史数据(必须先下载才能获取)
xtdata.download_history_data('600000.SH', period='1d', start_time='20240101')

# 获取行情数据
data = xtdata.get_market_data(
    field_list=['open', 'high', 'low', 'close', 'volume'],
    stock_list=['600000.SH'],
    period='1d',
    start_time='20240101',
    count=-1
)

2. 交易功能

python
from xtquant.xttrader import XtQuantTrader, XtQuantTraderCallback
from xtquant.xttype import StockAccount
from xtquant import xtconstant

# 初始化交易对象
path = 'D:\\迅投极速交易终端 睿智融科版\\userdata_mini'
session_id = 123456
xt_trader = XtQuantTrader(path, session_id)

# 创建账号
acc = StockAccount('1000000365')  # 资金账号

# 注册回调并启动
callback = MyXtQuantTraderCallback()
xt_trader.register_callback(callback)
xt_trader.start()
xt_trader.connect()
xt_trader.subscribe(acc)

# 下单
order_id = xt_trader.order_stock(
    acc, '600000.SH', xtconstant.STOCK_BUY, 
    100, xtconstant.FIX_PRICE, 10.5
)

详细功能参考

行情模块 (xtdata)

详见 references/market_data.md

主要功能:

  • 历史K线数据下载/获取 (download_history_data, get_market_data)
  • 实时行情订阅 (subscribe_quote, subscribe_whole_quote)
  • 分笔数据获取 (get_full_tick)
  • 财务数据下载/获取 (download_financial_data, get_financial_data)
  • 板块/行业数据 (download_sector_data, get_stock_list_in_sector)
  • 合约基础信息 (get_instrument_detail)

交易模块 (xttrader)

详见 references/trading.md

主要功能:

  • 同步/异步下单 (order_stock, order_stock_async)
  • 撤单 (cancel_order_stock)
  • 资产查询 (query_stock_asset)
  • 持仓查询 (query_stock_positions, query_stock_position)
  • 委托查询 (query_stock_orders, query_stock_order)
  • 成交查询 (query_stock_trades)
  • 主推消息回调 (on_stock_order, on_stock_trade等)

常用常量

委托类型 (xtconstant)

python
# 股票
STOCK_BUY = 23      # 买入
STOCK_SELL = 24     # 卖出

# 期货
FUTURE_OPEN_LONG = 0    # 开多
FUTURE_CLOSE_LONG_TODAY = 1   # 平今多
FUTURE_CLOSE_LONG_HISTORY = 2 # 平昨多
FUTURE_OPEN_SHORT = 3     # 开空
FUTURE_CLOSE_SHORT_TODAY = 4  # 平今空
FUTURE_CLOSE_SHORT_HISTORY = 5 # 平昨空

报价类型

python
FIX_PRICE = 11      # 指定价
LATEST_PRICE = 5    # 最新价

委托状态

python
ORDER_UNREPORTED = 48       # 未报
ORDER_REPORTED = 50         # 已报
ORDER_PART_SUCC = 55        # 部成
ORDER_SUCCEEDED = 56        # 已成
ORDER_CANCELED = 54         # 已撤
ORDER_JUNK = 57             # 废单

示例代码

详见 scripts/ 目录:

  • market_data_demo.py - 行情数据获取示例
  • trading_demo.py - 交易功能示例
  • data_download.py - 批量数据下载示例

注意事项

  1. 数据下载:使用get_market_data前必须先调用download_history_data下载数据到本地
  2. 订阅限制:单股订阅数量建议不超过50,更多请使用全推订阅
  3. 路径配置:券商版指向userdata_mini,投研版指向userdata
  4. session_id:不同策略使用不同的会话编号
  5. 回调处理:交易回调中调用同步查询需开启set_relaxed_response_order_enabled

数据字典速查

合约代码格式

  • 股票:000001.SZ, 600000.SH
  • 期货:rb2405.SF, IF2403.IF
  • 期权:510050.SH (ETF期权), sc2403C465.INE (商品期权)

周期类型

  • tick - 分笔数据
  • 1m, 5m, 15m, 30m, 1h - 分钟/小时线
  • 1d, 1w, 1mon, 1q, 1hy, 1y - 日/周/月/季/半年/年线

除权方式

  • none - 不复权
  • front - 前复权
  • back - 后复权
  • front_ratio - 等比前复权
  • back_ratio - 等比后复权

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Miniqmt Skill AI skill do?

MiniQMT量化交易开发技能,基于迅投XtQuant库提供行情数据获取(xtdata)和交易执行(xttrader)功能。用于开发股票、期货、期权等量化交易策略,支持历史/实时行情数据下载、K线/分笔数据获取、财务数据查询、自动下单/撤单、持仓查询、资产查询等。适用于需要连接MiniQMT客户端进行量化交易的场景。

Why use Miniqmt Skill on TypingMind?

Because you install it once and use it with any model. Miniqmt Skill is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Miniqmt Skill in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/xiaxiaoqian/miniqmt-skill/tree/main/skills. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Miniqmt Skill?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Miniqmt Skill?

As many as you like. As long as a model supports skills, you can use Miniqmt Skill with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Miniqmt Skill AI skill free?

It is published on GitHub by xiaxiaoqian. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇