Use this skill to answer MiniQMT / XtQuant development questions and assist in writing or reviewing Python code that uses xtquant.xtdata、xtquant.xttrader .
Documentation priority
By default, prioritize the concise documentation; when the concise version does not cover something, when the user explicitly needs Level2/futures/CTP content, or when the complete official explanation needs to be verified, then read the official original text.
- Market data, historical K-lines, local data, financial data, sectors, contract basic information: prioritize reading references/concise/xtdata-concise.md。
- Trading connection, order placement/cancellation, asset/order/trade/position queries, margin trading, callbacks: prioritize reading references/concise/xttrader-concise.md。
- Information missing from the concise version, deliberately removed Level2 market data, futures/CTP, changelogs, or complete field tables: read references/official/xtdata.md or references/official/xttrader.md。
Quick routing
- Market data subscription and retrieval:
subscribe_quote、subscribe_quote2、subscribe_whole_quote、get_market_data、get_local_data、get_full_tick, readxtdata-concise.md's "Market Data Interfaces". - Historical data download:
download_history_data、download_history_data2, readxtdata-concise.md's "Market Data Interfaces". - Financial data:
get_financial_data、download_financial_data、download_financial_data2, readxtdata-concise.md's "Financial Data Interfaces". - Basic market information: contract details, contract types, trading days, sectors, custom sectors, index constituent weights, read
xtdata-concise.md's "Basic Market Information". - Trading environment and connection:
XtQuantTrader, callback classes,start、connect、stop、run_forever, readxttrader-concise.md's "System Settings Interfaces". - Stock trading:
order_stock、order_stock_async、cancel_order_stock、cancel_order_stock_async, readxttrader-concise.md's "Operation Interfaces". - Account queries: assets, orders, trades, positions, account information, shareholder accounts, read
xttrader-concise.md's "Stock Query Interfaces" and "Other Query Interfaces". - Margin trading queries: credit assets, debt contracts, margin trading and securities lending underlying, securities lending data, collateral, read
xttrader-concise.md's "Credit Query Interfaces". - Callback handling: connection status, assets, orders, trades, positions, order placement/cancellation errors, asynchronous order reports, read
xttrader-concise.md's "Callback Classes".
Usage guidelines
- When answering MiniQMT code questions, prioritize giving a runnable minimal snippet, and remind the user to adjust according to the local MiniQMT installation path, account type, and trading permissions.
- For market data questions, explain whether data needs to be downloaded/subscribed first, and that the return value is usually
dict、DataFrame、ndarrayor a list of objects. - For trading questions, distinguish between synchronous interface return values and asynchronous interface callbacks; do not assume real orders can be placed without understanding the user's account permissions.
- If the question involves Level2 market data, tick-by-tick, thousand-level order book, full-speed order book, futures position statistics, CTP fund internal transfer, or futures/options-specific constants, consult the official original text directly.
- When answering, explain the specific API name, necessary imports, key parameters, return structure, and common failure points.
- Unless the user explicitly states that they already have the relevant permissions, do not assume they have Level2 market data permissions or futures/CTP trading support.
Documentation maintenance principles
references/official/ The files under are copied from the MiniQMT official documentation and must be kept as-is, to facilitate direct replacement and upgrades in the future.
references/concise/ The files under this are one-off simplified documentation, deliberately removing the changelog, less commonly used permission-specific content, and futures-specific content, to make it easier for AI to load the most relevant information first.