Scikit Learn
zLanqing/codex-claude-academic-skills
Machine learning in Python with scikit-learn. An agent skill from zLanqing/codex-claude-academic-skills.
miniQMT 极简量化交易终端 - 支持外接Python获取行情数据和程序化交易,基于xtquant SDK. An agent skill from LeoYeAI/openclaw-master-skills.
$ npx skills add LeoYeAI/openclaw-master-skills --skill miniqmt -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills miniqmt --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/miniqmt .claude/skills/miniqmt && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "miniqmt" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/miniqmt into .claude/skills/miniqmt/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "miniqmt", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/miniqmtType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add LeoYeAI/openclaw-master-skills --skill miniqmt -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills miniqmt --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/miniqmt .agents/skills/miniqmt && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "miniqmt" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/miniqmt into .agents/skills/miniqmt/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "miniqmt", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add LeoYeAI/openclaw-master-skills --skill miniqmt -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills miniqmt --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/miniqmt .cursor/skills/miniqmt && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "miniqmt" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/miniqmt into .cursor/skills/miniqmt/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "miniqmt", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/LeoYeAI/openclaw-master-skills.git --path skills/miniqmt--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add LeoYeAI/openclaw-master-skills --skill miniqmt -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills miniqmt --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/miniqmt .gemini/skills/miniqmt && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "miniqmt" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/miniqmt into .gemini/skills/miniqmt/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "miniqmt", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install LeoYeAI/openclaw-master-skills miniqmtInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add LeoYeAI/openclaw-master-skills --skill miniqmt -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/miniqmt .github/skills/miniqmt && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "miniqmt" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/miniqmt into .github/skills/miniqmt/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "miniqmt", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add LeoYeAI/openclaw-master-skills --skill miniqmt -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills miniqmt --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/miniqmt .opencode/skills/miniqmt && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "miniqmt" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/miniqmt into .opencode/skills/miniqmt/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "miniqmt", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
miniqmtminiQMT 极简量化交易终端 - 支持外接Python获取行情数据和程序化交易,基于xtquant SDK. An agent skill from LeoYeAI/openclaw-master-skills.
Miniqmt is an agent skill from LeoYeAI/openclaw-master-skills. miniQMT 极简量化交易终端 - 支持外接Python获取行情数据和程序化交易,基于xtquant SDK。
Its SKILL.md is about 4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files (for example `QUICK_REFERENCE.md`, `README.md` and `_meta.json`).
It sits in Data & Analytics. It works with Python. The repository describes itself as: 🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai. The licence is MIT.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit e5199b5. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships script files (Python), which the agent can run.
Shell commands in SKILL.md call:
pipFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
dict.thinktrader.netspace.bilibili.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Miniqmt loads about 4k tokens when it runs. Until then it costs about 16 tokens; SKILL.md has 467 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from LeoYeAI/openclaw-master-skills at commit e5199b5, republished under its MIT licence (© LeoYeAI). 467 words, ~4,046 tokens.
.claude/skills/miniqmt/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.miniQMT 是迅投科技开发的轻量级量化交易终端,专为外接Python设计。它作为本地Windows服务运行,通过 XtQuant Python SDK(xtdata + xttrade)提供行情数据和交易功能。
⚠️ 需要券商开通miniQMT权限。联系您的证券公司开通。多家国内券商支持(国金、华鑫、中泰、东方财富、国信、方正等)。
xtquant SDK经本地TCP连接(xtdata获取行情,xttrade执行交易)Python脚本(任意IDE: VS Code, PyCharm, Jupyter等)
↓ xtquant SDK(pip install xtquant)
├── xtdata ──TCP──→ miniQMT(行情数据服务)
└── xttrade ──TCP──→ miniQMT(交易服务)
↓
券商交易系统以极简模式启动QMT客户端并登录。miniQMT界面非常简洁——只有一个登录窗口。
pip install xtquantfrom xtquant import xtdata
# 连接本地miniQMT行情数据服务
xtdata.connect()
# 下载历史数据(首次访问前必须下载)
xtdata.download_history_data('000001.SZ', '1d', start_time='20240101', end_time='20240630')
# 获取K线数据(返回以股票代码为键的DataFrame字典)
data = xtdata.get_market_data_ex(
[], ['000001.SZ'], period='1d',
start_time='20240101', end_time='20240630',
dividend_type='front' # 前复权
)
print(data['000001.SZ'].tail())from xtquant import xtconstant
from xtquant.xttrader import XtQuantTrader, XtQuantTraderCallback
from xtquant.xttype import StockAccount
# path必须指向QMT安装目录下的userdata_mini文件夹
path = r'D:\券商QMT\userdata_mini'
# session_id对每个策略/脚本必须唯一
session_id = 123456
xt_trader = XtQuantTrader(path, session_id)
# 注册回调接收实时推送通知
class MyCallback(XtQuantTraderCallback):
def on_disconnected(self):
print('已断开连接 — 需要重新连接')
def on_stock_order(self, order):
print(f'Order update: {order.stock_code} status={order.order_status} msg={order.status_msg}')
def on_stock_trade(self, trade):
print(f'Trade filled: {trade.stock_code} {trade.traded_volume}@{trade.traded_price}')
def on_order_error(self, order_error):
print(f'Order error: {order_error.error_msg}')
xt_trader.register_callback(MyCallback())
xt_trader.start()
connect_result = xt_trader.connect() # 收益率 0 on success, non-zero on failure
account = StockAccount('your_account')
xt_trader.subscribe(account) # 订阅账户推送通知
# 下买入单
order_id = xt_trader.order_stock(
account, '000001.SZ', xtconstant.STOCK_BUY, 100,
xtconstant.FIX_PRICE, 11.50, 'my_strategy', 'test_order'
)
# order_id > 0 表示成功,-1 表示失败| 特性 | miniQMT | QMT(完整版) |
|---|---|---|
| Python | 外接Python(任意版本) | 内置Python(版本受限) |
| IDE | 任意(VS Code, PyCharm, Jupyter等) | 仅内置编辑器 |
| 第三方库 | 所有pip包(pandas, numpy等) | 仅内置库 |
| 界面 | 极简(仅登录窗口) | 完整交易UI + 图表 |
| 行情数据 | 通过xtdata API | 内置 + xtdata API |
| 交易 | 通过xttrade API | 内置 + xttrade API |
| 资源占用 | 轻量(~50 MB内存) | 较重(完整GUI,~500 MB+) |
| 调试 | 完整IDE调试支持 | 有限 |
| 使用场景 | 自动化策略、外部集成 | 可视化分析 + 手动交易 |
| 连接方式 | 一次性连接,无自动重连 | 持久连接 |
| 类别 | 详情 |
|---|---|
| K-line | tick, 1m, 5m, 15m, 30m, 1h, 1d, 1w, 1mon — supports adjustment (forward / backward / proportional) |
| Tick | Real-time tick data with 5-level bid/ask, volume, turnover, trade count |
| Level 2 | l2quote (real-time snapshot), l2order (order-by-order), l2transaction (trade-by-trade), l2quoteaux (aggregate buy/sell), l2orderqueue (order queue), l2thousand (1000-level order book), fullspeedorderbook (full-speed 20-level) |
| Financials | Balance sheet, income statement, cash flow statement, per-share metrics, share structure, top 10 shareholders / free-float holders, shareholder count |
| Reference | Trading calendar, holidays, sector lists, index constituents & weights, ex-dividend data, contract info |
| Real-time | Single-stock subscription (subscribe_quote), market-wide push (subscribe_whole_quote) |
| Special | Convertible bond info, IPO subscription data, ETF creation/redemption lists, announcements & news, consecutive limit-up tracking, snapshot indicators (volume ratio / price velocity), high-frequency IOPV |
download_history_data() → get_market_data_ex() # Historical data: download to local cache first, then read from cache
subscribe_quote() → callback # Real-time data: subscribe and receive via callback
get_full_tick() # Snapshot data: get latest tick for the entire market| 类别 | 操作 |
|---|---|
| Stocks | Buy/sell (sync and async), limit/market/best price orders |
| ETF | Buy/sell, creation/redemption |
| Convertible bonds | Buy/sell |
| Futures | Open long/close long/open short/close short |
| Options | Buy/sell open/close, covered open/close, exercise, lock/unlock |
| Margin trading | Margin buy, short sell, buy to cover, direct return, sell to repay, direct repayment, special margin/short |
| IPO | New share/bond subscription, query subscription quota |
| Cancel | Cancel by order_id or broker contract number (sync and async) |
| Query | Assets, orders, trades, positions, futures position summary |
| Credit query | Credit assets, liability contracts, margin-eligible securities, available-to-short data, collateral |
| Bank-broker transfer | Bank to securities, securities to bank (sync and async) |
| Smart algorithms | VWAP and other algorithmic execution |
| Securities lending | Query available securities, apply for lending, manage contracts |
StockAccount('id') # 普通股票账户
StockAccount('id', 'CREDIT') # 信用账户(融资融券)
StockAccount('id', 'FUTURE') # 期货账户| 回调函数 | 触发时机 |
|---|---|
on_stock_order(order) | Order status change (submitted, partially filled, fully filled, cancelled, rejected) |
on_stock_trade(trade) | Trade execution report |
on_stock_position(position) | Position change |
on_stock_asset(asset) | Asset/fund change |
on_order_error(error) | Order placement failure |
on_cancel_error(error) | Order cancellation failure |
on_disconnected() | Disconnected from miniQMT |
| 值 | 状态 |
|---|---|
| 48 | 未报 |
| 50 | 已报 |
| 54 | 已撤 |
| 55 | 部分成交 |
| 56 | 已成 |
| 57 | 废单 |
# 国金证券
path = r'D:\国金证券QMT交易端\userdata_mini'
# 华鑫证券
path = r'D:\华鑫证券\userdata_mini'
# 中泰证券
path = r'D:\中泰证券\userdata_mini'
# 东方财富
path = r'D:\东方财富证券QMT交易端\userdata_mini'| 市场 | 示例 |
|---|---|
| 上海A股 | 600000.SH |
| 深圳A股 | 000001.SZ |
| 北交所 | 430047.BJ |
| 指数 | 000001.SH(上证综指), 399001.SZ(深证成指) |
| 中金所期货 | IF2401.IF |
| 上期所期货 | ag2407.SF |
| 期权 | 10004358.SHO |
| ETF | 510300.SH |
| 可转债 | 113050.SH |
from xtquant import xtdata, xtconstant
from xtquant.xttrader import XtQuantTrader, XtQuantTraderCallback
from xtquant.xttype import StockAccount
# === 回调类定义 ===
class MyCallback(XtQuantTraderCallback):
def on_disconnected(self):
print('已断开连接')
def on_stock_trade(self, trade):
print(f'Trade filled: {trade.stock_code} {trade.traded_volume}@{trade.traded_price}')
def on_order_error(self, order_error):
print(f'Error: {order_error.error_msg}')
# === 1. 连接行情数据服务 ===
xtdata.connect()
# === 2. 下载并获取历史数据 ===
stock = '000001.SZ'
xtdata.download_history_data(stock, '1d', start_time='20240101', end_time='20240630')
data = xtdata.get_market_data_ex(
[], [stock], period='1d',
start_time='20240101', end_time='20240630',
dividend_type='front' # 前复权
)
df = data[stock]
# === 3. 计算简单均线交叉信号 ===
df['ma5'] = df['close'].rolling(5).mean() # 5日均线
df['ma20'] = df['close'].rolling(20).mean() # 20日均线
latest = df.iloc[-1] # 最新K线
prev = df.iloc[-2] # 前一根K线
# === 4. 连接交易服务 ===
path = r'D:\券商QMT\userdata_mini'
xt_trader = XtQuantTrader(path, 123456)
xt_trader.register_callback(MyCallback())
xt_trader.start()
if xt_trader.connect() != 0:
print('连接失败!')
exit()
account = StockAccount('your_account')
xt_trader.subscribe(account) # 订阅账户推送通知
# === 5. 执行交易信号 ===
if prev['ma5'] <= prev['ma20'] and latest['ma5'] > latest['ma20']:
# 金叉信号:5日均线上穿20日均线,买入
order_id = xt_trader.order_stock(
account, stock, xtconstant.STOCK_BUY, 100,
xtconstant.LATEST_PRICE, 0, 'ma_cross', 'golden_cross'
)
print(f'Golden cross buy — {stock}, order_id={order_id}')
elif prev['ma5'] >= prev['ma20'] and latest['ma5'] < latest['ma20']:
# 死叉信号:5日均线下穿20日均线,卖出
order_id = xt_trader.order_stock(
account, stock, xtconstant.STOCK_SELL, 100,
xtconstant.LATEST_PRICE, 0, 'ma_cross', 'death_cross'
)
print(f'Death cross sell — {stock}, order_id={order_id}')
# === 6. 查询结果 ===
asset = xt_trader.query_stock_asset(account)
print(f'Available cash: {asset.cash}, Total assets: {asset.total_asset}')
positions = xt_trader.query_stock_positions(account)
for pos in positions:
print(f'{pos.stock_code}: {pos.volume} shares, available={pos.can_use_volume}, cost={pos.open_price}')from xtquant import xtdata
import threading
def on_tick(datas):
"""Tick数据回调函数"""
for code, tick in datas.items():
print(f'{code}: latest={tick["lastPrice"]}, volume={tick["volume"]}')
# 连接行情数据服务
xtdata.connect()
# 在单独线程中运行订阅(xtdata.run()会阻塞当前线程)
def run_data():
xtdata.subscribe_quote('000001.SZ', period='tick', callback=on_tick)
xtdata.subscribe_quote('600000.SH', period='tick', callback=on_tick)
xtdata.run() # 阻塞线程,持续接收数据
t = threading.Thread(target=run_data, daemon=True)
t.start()
# 主线程可以执行交易或其他操作
# ...connect() 是一次性连接 — 断开后不会自动重连,需要自行实现重连逻辑。session_id 对每个策略必须唯一 — 不同Python脚本必须使用不同的session_id。xtdata.run() 会阻塞线程 — 请在单独线程中运行,主线程用于交易。on_stock_order等)中,使用异步查询方法(如 query_stock_orders_async)避免死锁。或启用 set_relaxed_response_order_enabled(True)。from xtquant import xtdata, xtconstant
from xtquant.xttrader import XtQuantTrader, XtQuantTraderCallback
from xtquant.xttype import StockAccount
import threading
class GridCallback(XtQuantTraderCallback):
def on_stock_trade(self, trade):
print(f'Trade filled: {trade.stock_code} {trade.traded_volume}@{trade.traded_price}')
def on_order_error(self, error):
print(f'Error: {error.error_msg}')
# 初始化交易
path = r'D:\券商QMT\userdata_mini'
xt_trader = XtQuantTrader(path, 100001)
xt_trader.register_callback(GridCallback())
xt_trader.start()
xt_trader.connect()
account = StockAccount('your_account')
xt_trader.subscribe(account)
# 网格参数
stock = '000001.SZ'
grid_base = 11.0 # 基准价格
grid_step = 0.2 # 网格间距
grid_shares = 100 # 每格交易股数
grid_levels = 5 # 上下各5档
last_grid = 0 # 当前网格层级
xtdata.connect()
def on_tick(datas):
global last_grid
for code, tick in datas.items():
price = tick['lastPrice']
# 计算价格对应的当前网格层级
current_grid = int((price - grid_base) / grid_step)
if current_grid < last_grid:
# 价格下穿网格线,买入
for _ in range(last_grid - current_grid):
xt_trader.order_stock(
account, code, xtconstant.STOCK_BUY, grid_shares,
xtconstant.LATEST_PRICE, 0, 'grid', f'网格买入_level{current_grid}'
)
last_grid = current_grid
elif current_grid > last_grid:
# 价格上穿网格线,卖出
for _ in range(current_grid - last_grid):
xt_trader.order_stock(
account, code, xtconstant.STOCK_SELL, grid_shares,
xtconstant.LATEST_PRICE, 0, 'grid', f'网格卖出_level{current_grid}'
)
last_grid = current_grid
# 启动行情数据订阅
def run_data():
xtdata.subscribe_quote(stock, period='tick', callback=on_tick)
xtdata.run()
t = threading.Thread(target=run_data, daemon=True)
t.start()
xt_trader.run_forever()from xtquant import xtdata, xtconstant
from xtquant.xttrader import XtQuantTrader, XtQuantTraderCallback
from xtquant.xttype import StockAccount
import threading
class CBCallback(XtQuantTraderCallback):
def on_stock_trade(self, trade):
print(f'Trade filled: {trade.stock_code} {trade.traded_volume}@{trade.traded_price}')
path = r'D:\券商QMT\userdata_mini'
xt_trader = XtQuantTrader(path, 100002)
xt_trader.register_callback(CBCallback())
xt_trader.start()
xt_trader.connect()
account = StockAccount('your_account')
xt_trader.subscribe(account)
# 可转债代码(可转债支持T+0交易)
cb_code = '113050.SH'
buy_threshold = -0.5 # 跌幅超过0.5%买入
sell_threshold = 0.5 # 涨幅超过0.5%卖出
position = 0
xtdata.connect()
def on_tick(datas):
global position
for code, tick in datas.items():
price = tick['lastPrice']
pre_close = tick['lastClose']
if pre_close == 0:
continue
pct_change = (price - pre_close) / pre_close * 100
# 跌幅达到阈值,买入10手
if pct_change <= buy_threshold and position == 0:
xt_trader.order_stock(
account, code, xtconstant.STOCK_BUY, 10,
xtconstant.LATEST_PRICE, 0, 'cb_t0', '可转债T0买入'
)
position = 10
# 涨幅达到阈值,卖出
elif pct_change >= sell_threshold and position > 0:
xt_trader.order_stock(
account, code, xtconstant.STOCK_SELL, position,
xtconstant.LATEST_PRICE, 0, 'cb_t0', '可转债T0卖出'
)
position = 0
def run_data():
xtdata.subscribe_quote(cb_code, period='tick', callback=on_tick)
xtdata.run()
t = threading.Thread(target=run_data, daemon=True)
t.start()
xt_trader.run_forever()from xtquant import xtdata, xtconstant
from xtquant.xttrader import XtQuantTrader, XtQuantTraderCallback
from xtquant.xttype import StockAccount
import datetime
import time
class IPOCallback(XtQuantTraderCallback):
def on_stock_order(self, order):
print(f'IPO subscription: {order.stock_code} status={order.order_status} {order.status_msg}')
path = r'D:\券商QMT\userdata_mini'
xt_trader = XtQuantTrader(path, 100003)
xt_trader.register_callback(IPOCallback())
xt_trader.start()
xt_trader.connect()
account = StockAccount('your_account')
xt_trader.subscribe(account)
# 查询新股申购额度
limits = xt_trader.query_new_purchase_limit(account)
print(f"Subscription quota: {limits}")
# 查询今日新股数据
ipo_data = xt_trader.query_ipo_data()
if ipo_data:
for code, info in ipo_data.items():
print(f"New stock: {code} {info['name']} issue price={info['issuePrice']} max subscription={info['maxPurchaseNum']}")
# 以最大允许量申购
max_vol = info['maxPurchaseNum']
if max_vol > 0:
order_id = xt_trader.order_stock(
account, code, xtconstant.STOCK_BUY, max_vol,
xtconstant.FIX_PRICE, info['issuePrice'], 'ipo', '新股申购'
)
print(f" Subscription submitted: order_id={order_id}")
else:
print("今日无新股可申购")对于 AI Agent,在使用该量化/数据工具时应遵循以下高阶策略和最佳实践,以确保任务的高效完成:
在获取数据或执行操作后,AI 应当主动检查返回的结果格式是否符合预期,以及是否存在缺失值(NaN)或空数据。
if df.empty: 进行校验;捕获 Exception 以防网络或接口错误导致进程崩溃。AI 经常需要进行宏观经济分析或跨市场对比。应善于将当前接口与其他数据源或工具组合使用。
对于交易和策略类任务,AI 可以定期拉取数据并建立监控机制。
由 大佬量化 维护 — 量化交易教学与策略研发团队。
微信客服: bossquant1 · Bilibili · 搜索 大佬量化 — 微信公众号 / Bilibili / 抖音
© LeoYeAI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 9 other files in skills/miniqmt of LeoYeAI/openclaw-master-skills.
Open the folder on GitHubat commit e5199b5
Miniqmt next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Miniqmt this skillLeoYeAI/openclaw-master-skills | 2.2k | — | ~4k | Automated safety check: Pass | MIT | |
| Scikit LearnzLanqing/codex-claude-academic-skills | 4.7k | 16 repos | ~3.9k | Automated safety check: Pass | BSD-3-Clause | |
| TimesFM Forecastinggoogle-research/timesfm | 34k | — | ~4.7k | Automated safety check: Pass | Apache-2.0 | |
| Excel and CSV Data Analysisbytedance/deer-flow | 84k | 4 repos | ~2.2k | Automated safety check: Pass | MIT | |
| StatsmodelszLanqing/codex-claude-academic-skills | 4.7k | 15 repos | ~4.9k | Automated safety check: Pass | BSD-3-Clause | |
| Scientific Figure MakingChenLiu-1996/figures4papers | 8.3k | — | ~557 | Automated safety check: Pass | Custom licence |
zLanqing/codex-claude-academic-skills
Machine learning in Python with scikit-learn. An agent skill from zLanqing/codex-claude-academic-skills.
google-research/timesfm
Forecasts any univariate time series zero-shot with Google's TimesFM model, returning point forecasts and calibrated prediction intervals without training.
bytedance/deer-flow
Analyzes uploaded Excel and CSV files with SQL through DuckDB, producing schema inspections, statistical summaries and exports to CSV, JSON or Markdown.
zLanqing/codex-claude-academic-skills
Statistical models library for Python. An agent skill from zLanqing/codex-claude-academic-skills.
ChenLiu-1996/figures4papers
Covers publication-ready matplotlib figures for academic papers, slides, and reports—bars, trends, scatter, heatmaps, and multi-panel layouts—with this…
Nuitka/Nuitka
Diagnose and fix ModuleNotFoundError in Nuitka standalone binaries caused by missing implicit imports.
LeoYeAI/openclaw-master-skills
Manages pipelines on a DevOps quality and efficiency platform through its OpenAPI: list workspaces and templates, create, update, run and cancel pipelines, and read run records.
LeoYeAI/openclaw-master-skills
Patches OpenClaw's Feishu extension so an edited document triggers an isolated agent session that reads the doc and replies inline, turning it into a live chat space.
LeoYeAI/openclaw-master-skills
Multi-context memory management system for OpenClaw agents with group-isolated storage, global shared memory, workspace organization, and group-specific skills isolation.
LeoYeAI/openclaw-master-skills
Runs a brand's AI-search visibility work end to end: diagnosing how AI platforms represent it, repositioning it, producing AI-optimized content and monitoring ongoing mentions.
LeoYeAI/openclaw-master-skills
Installs and authenticates the gws CLI, then automates Gmail, Drive, Sheets, Calendar, Docs, Chat and Tasks with ready-made recipes, persona bundles and security audits.
LeoYeAI/openclaw-master-skills
Runs four advisor roles, a fitness coach, nutritionist, data analyst and TCM practitioner, to build a health profile and track workouts, diet and wellness over time.
Works with
Categories
miniQMT 极简量化交易终端 - 支持外接Python获取行情数据和程序化交易,基于xtquant SDK. An agent skill from LeoYeAI/openclaw-master-skills. Miniqmt is an agent skill from LeoYeAI/openclaw-master-skills.
Miniqmt fits situations like: data & Analytics work in your project.
Run `npx skills add LeoYeAI/openclaw-master-skills --skill miniqmt -a claude-code`. Or copy the skill folder (skills/miniqmt in LeoYeAI/openclaw-master-skills) into .claude/skills/miniqmt in your project. Claude Code loads it when a task matches its description.
Run `npx skills add LeoYeAI/openclaw-master-skills --skill miniqmt -a codex`. Or copy the skill folder (skills/miniqmt in LeoYeAI/openclaw-master-skills) into .agents/skills/miniqmt in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LeoYeAI/openclaw-master-skills --skill miniqmt -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/miniqmt, .gemini/skills/miniqmt, .github/skills/miniqmt and .opencode/skills/miniqmt in your project.
Going by SKILL.md and its folder, Miniqmt needs Python for the scripts in its folder and the command-line tools its instructions call (pip). Our summary lists: Python 3.
SKILL.md names 2 domains. As links in the text: dict.thinktrader.net and space.bilibili.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Miniqmt is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 4k tokens (SKILL.md is roughly 16k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Miniqmt: Scikit Learn (zLanqing/codex-claude-academic-skills, 4.7k stars), TimesFM Forecasting (google-research/timesfm, 34k stars), Excel and CSV Data Analysis (bytedance/deer-flow, 84k stars) and Statsmodels (zLanqing/codex-claude-academic-skills, 4.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
LeoYeAI (a GitHub user) maintains it in LeoYeAI/openclaw-master-skills, which has 2,161 GitHub stars. The repository holds 1,235 skills in this directory. The repository was last updated on July 20, 2026.
Source: LeoYeAI/openclaw-master-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.