Overview
- Skill Key
- coderwpf/xtquant
- Author
- coderwpf
- Source Repo
- openclaw/skills
- Version
- 1.0.0
- Source Path
- skills/coderwpf/xtquant
- Latest Commit SHA
- e1e1d5b63c4ad216932a86ef9cd421855608c3a8
XtQuant Python SDK for QMT/miniQMT — market data (xtdata) and trading (xttrade) interface for Chinese securities.
Stars
0
Installs
0
Status
ACTIVE
Visibility
PUBLIC
直接复制以下提示词,发送给你的 AI 助手即可完成安装。
请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 xtquant 技能。 若已安装,则直接安装 xtquant 技能。
# XtQuant (迅投QMT Python SDK)
XtQuant is the Python SDK for [QMT/miniQMT](http://www.thinktrader.net) quantitative trading platform by 迅投科技. It consists of two core modules:
- **xtdata** — Market data (行情模块): real-time quotes, historical K-lines, tick data, Level2 data, financial data
- **xttrade** — Trading (交易模块): order placement, position/order queries, account management
> ⚠️ **Requires miniQMT or QMT client running locally**. XtQuant connects to the local QMT process via TCP. You need a broker account with QMT/miniQMT access enabled.
## Install
```bash
pip install xtquant
```
Or download from: http://dict.thinktrader.net/nativeApi/download_xtquant.html
## Architecture
```
Your Python Script
↓ (xtquant SDK)
├── xtdata → miniQMT (market data server)
└── xttrade → miniQMT (trading server)
↓
Broker Trading System
```
## Quick start — Market data
```python
from xtquant import xtdata
# Connect to miniQMT (default localhost)
xtdata.connect()
# Download historical K-line
xtdata.download_history_data('000001.SZ', '1d', start_time='20240101', end_time='20240630')
# Get local K-line data
data = xtdata.get_market_data_ex([], ['000001.SZ'], period='1d', start_time='20240101', end_time='20240630')
print(data['000001.SZ'])
```
## Quick start — Trading
```python
from xtquant import xttrader
from xtquant.xttrader import XtQuantTrader
from xtquant.xttype import StockAccount
# Create trader instance
path = r'D:\国金证券QMT交易端\userdata_mini' # miniQMT userdata path
session_id = 123456
xt_trader = XtQuantTrader(path, session_id)
# Connect and start
xt_trader.start()
# Create account
account = StockAccount('your_account_id')
# Place order: buy 100 shares of 000001.SZ
order_id = xt_trader.order_stock(account, '000001.SZ', xtconstant.STOCK_BUY, 100, xtconstant.FIX_PRICE, 11.5)
# Query positions
positions = xt_trader.query_stock_positions(account)
for pos in positions:
print(pos.stock_code, pos.volume, pos.market_value)...
human-pages-ai
Search and hire real humans for tasks — photography, delivery, research, and more
zseven-w
Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.
blackeight4752
Enhance video resolution using Alibaba Cloud Super Resolution API. Use when the user wants to: (1) upscale low-res videos to higher resolution, (2) improve video quality before publishing, or (3) convert 480p videos to 1080p.
asenwang
Manage Shopify store — products, metafields, metaobjects, blogs & articles via Shopify Admin GraphQL API. Pure official Shopify API wrapper with no third-party plugins required; built on the same API surface as Shopify CLI, giving you full control without extra dependencies.
aurora2035
Xeon ASR
aznikline
深度分析项目的系统边界、核心概念、模块架构、关键算法、技术选型以及错误排查。当用户需要深入理解代码库或定位疑难问题时调用。