MiniQMT 迅投量化交易接口,基于 XtQuant Python 库,支持 A 股/期货/期权的行情数据获取(K线、分笔、财务数据等)和交易下单(报单、撤单、查询资产/委托/持仓)。当用户提及 miniqmt、xtquant、迅投、获取实时行情、量化交易下单、回测数据获取,或需要连接 MiniQMT 客户端进行程序化交易时使用
npx skills add https://github.com/lzwme/finance-quant-skills --skill miniqmt
pip install xtquantuserdata_mini 路径用于 xttrader 连接QMT安装目录\
├── bin.x64\XtMiniQmt.exe # MiniQMT 主程序
├── userdata_mini\ # 用户数据目录(xttrader 连接路径)
│ ├── xqtrader.ini # 交易配置
│ └── xtdatacenter.ini # 行情配置
600000.SH(上海)、000001.SZ(深圳)rb2405.SF(螺纹钢)510050.SH(上证50ETF期权)| 周期 | 说明 | 周期 | 说明 |
|------|------|------|------|
| tick | 分笔数据 | 1q | 季度线 |
| 1m | 1分钟线 | 1hy | 半年线 |
| 5m | 5分钟线 | 1y | 年线 |
| 15m | 15分钟线 | 1w | 周线 |
| 30m | 30分钟线 | 1d | 日线 |
| 1h | 1小时线 | 1mon | 月线 |
none - 不复权front - 前复权back - 后复权front_ratio - 等比前复权back_ratio - 等比后复权| 市场 | 常量 | 市场 | 常量 |
|------|------|------|------|
| 上海 | xtconstant.SH_MARKET | 中金所 | xtconstant.MARKET_ENUM_INDEX_FUTURE |
| 深圳 | xtconstant.SZ_MARKET | 上期所 | xtconstant.MARKET_ENUM_SHANGHAI_FUTURE |
| 北交所 | xtconstant.MARKET_ENUM_BEIJING | 郑商所 | xtconstant.MARKET_ENUM_ZHENGZHOU_FUTURE |
| 大商所 | xtconstant.MARKET_ENUM_DALIANG_FUTURE | 广期所 | xtconstant.MARKET_ENUM_GUANGZHOU_FUTURE |
| 类型 | 常量 | 类型 | 常量 |
|------|------|------|------|
| 股票 | xtconstant.SECURITY_ACCOUNT | 沪港通 | xtconstant.HUGANGTONG_ACCOUNT |
| 期货 | xtconstant.FUTURE_ACCOUNT | 深港通 | xtconstant.SHENGANGTONG_ACCOUNT |
| 信用 | xtconstant.CREDIT_ACCOUNT | 期货期权 | xtconstant.FUTURE_OPTION_ACCOUNT |
| 股票期权 | xtconstant.STOCK_OPTION_ACCOUNT | - | - |
| 用户提问 | 对应功能 | 调用方式 |
|---------|---------|---------|
| "贵州茅台实时股价" | 实时行情快照 | xtdata.get_full_tick |
| "平安银行K线数据" | K线数据 | xtdata.get_market_data |
| "招商银行财务指标" | 财务报表 | xtdata.get_financial_data |
| "半导体板块成分股" | 板块成分股 | xtdata.get_stock_list_in_sector |
| "今日可转债信息" | ETF/可转债数据 | xtdata.get_cb_info |
| "新股申购" | 新股信息 | xtdata.get_ipo_info |
| "下单买入平安银行" | 交易下单 | xttrader.order_stock |
| "查询持仓" | 持仓查询 | xttrader.query_stock_positions |
| "撤单" | 撤单操作 | xttrader.cancel_order_stock |
import xtdata
# 获取全推行情快照
ticks = xtdata.get_full_tick(['600519.SH', '000001.SZ'])
# 订阅单股实时行情
def on_data(datas):
for code in datas:
print(code, datas[code])
xtdata.subscribe_quote('600519.SH', period='tick', callback=on_data)
xtdata.run()
import xtdata
# 下载历史K线数据
xtdata.download_history_data2(['600519.SH'], period='1d', start_time='')
# 获取K线数据
data = xtdata.get_market_data(
field_list=['open', 'high', 'low', 'close', 'volume'],
stock_list=['600519.SH'],
period='1d',
start_time='20240101',
end_time='',
count=100,
dividend_type='front'
)
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') # 替换为实际账号
# 连接交易
xt_trader.start()
connect_result = xt_trader.connect()
subscribe_result = xt_trader.subscribe(acc)
# 下单买入
order_id = xt_trader.order_stock(
acc,
'600519.SH',
xtconstant.STOCK_BUY,
100, # 100股
xtconstant.FIX_PRICE,
1800.0, # 价格
'strategy1',
'remark'
)
# 查询资产
asset = xt_trader.query_stock_asset(acc)
print(f"可用资金: {asset.cash}")
import xtdata
def on_tick_data(datas):
for code in datas:
tick = datas[code]
print(f"{code}: 现价={tick['lastPrice']}, 成交量={tick['volume']}")
# 订阅多只股票
xtdata.subscribe_whole_quote(['SH', 'SZ'], callback=on_tick_data)
xtdata.run()
python scripts/market_data.py snapshot --code 600519.SHpython scripts/market_data.py kline --code 600519.SH --period 1d --count 100python scripts/market_data.py tick --code 600519.SH --count 100python scripts/market_data.py full_tick --codes 600519.SH,000001.SZpython scripts/sector_data.py sector_listpython scripts/sector_data.py sector_stocks --sector 半导体python scripts/financial_data.py financial --code 600519.SH --tables Balance,Incomepython scripts/trade.py order --code 600519.SH --type buy --volume 100 --price 1800.0python scripts/trade.py cancel --order_id 12345python scripts/trade.py positionspython scripts/trade.py orderspython scripts/trade.py assetpython scripts/trade.py tradesuserdata_mini 路径正确,否则连接会失败download_history_data2 下载'20240101' 或 '20240101000000''FUTURE'get_market_data 批量获取Python library for accessing, analyzing, and extracting data from SEC EDGAR filings. Use when working with SEC filings, financial statements (income statement, balance sheet, cash flow), XBRL financial data, insider trading (Form 4), institutional holdings (13F), company financials, annual/quarterly reports (10-K, 10-Q), proxy statements (DEF 14A), 8-K current events, company screening by ticker/CIK/industry, multi-period financial analysis, or any SEC regulatory filings.
Use this skill when the user asks to list, create, inspect, update, disable, re-enable, or revoke AltLLM Portal API keys for external agents or applications. Do NOT use for wallet login, billing history, or payment links.
Use this skill when the user asks to log in or out with a wallet session, fetch a wallet sign-in challenge, verify an externally signed challenge, or troubleshoot AltLLM Portal wallet login for the local altllm CLI. Do NOT use for API key management, billing history, or payment links.
Use this umbrella skill when the request spans multiple AltLLM Portal CLI domains, or when you need to navigate the local altllm CLI in this repository across auth, API keys, billing history, NOWPayments payment links, and related x402 Portal top-up guidance.
Build with the ChainGPT Web3 AI developer platform. Full API/SDK reference and project scaffolding for: Web3 AI Chatbot & LLM, AI NFT Generator, Smart Contract Generator, Smart Contract Auditor, AI Crypto News, AgenticOS Twitter agents, and Solidity LLM. Use when building blockchain apps, Web3 chatbots, NFT tools, smart contract tools, crypto news feeds, AI agents, or integrating any ChainGPT API. Triggers: chaingpt, web3 ai, nft generator, smart contract audit, crypto news api, agenticos, solidity llm, cgpt, blockchain ai, token analytics.
TypeScript SDK for the Payment HTTP Authentication Scheme. Handles 402 Payment Required flows with Tempo, Stripe, and other payment methods. Use when integrating payments or mppx into a client or server application.
>- Guide for developing with near-api-js v7 - the JavaScript/TypeScript library for NEAR blockchain interaction. (3) calling smart contracts, (4) managing accounts and keys, (5) working with NEAR RPC API, (6) handling FT/NFT tokens on NEAR, (7) using NEAR cryptographic operations (KeyPair, signing), (8) converting between NEAR units (yocto, gas), (9) gasless/meta transactions with relayers, (10) NEP-413 message signing for authentication, (11) storage deposit management for FT contracts. Triggers on any NEAR blockchain development tasks.
TypeScript library for NEAR Protocol blockchain interaction. Use this skill when writing code that interacts with NEAR Protocol, including viewing contract data, calling contract methods, sending NEAR tokens, building transactions, creating type-safe contract wrappers, integrating wallets (Wallet Selector, HOT Connect), React hooks and providers (@near-kit/react), managing keys, testing with sandbox, meta-transactions (NEP-366), and message signing (NEP-413).
Take lzwme/miniqmt from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference pip.
Without those the skill loads but fails at the first command.