搜索

PythonReactSEOPDF
OpenClaw

xtquant

XtQuant Python SDK for QMT/miniQMT — market data (xtdata) and trading (xttrade) interface for Chinese securities.

coderwpf0 来源安装数☆ 0 仓库 Starsv1.0.0

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install coderwpf/xtquant

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

XtQuant (迅投QMT Python SDK)

XtQuant is the Python SDK for QMT/miniQMT 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

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

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

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)...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/coderwpf/xtquant
Version
1.0.0
Commit
e1e1d5b63c4ad216932a86ef9cd421855608c3a8
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

来源内容

SKILL.md
# 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)...

相关技能

OpenClaw

humanpages

human-pages-ai

Search and hire real humans for tasks — photography, delivery, research, and more

OpenClaw

openclaw-skills

zseven-w

Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.

OpenClaw

0xarchive

0xfantommenace

Query historical crypto market data from 0xArchive across Hyperliquid, Lighter.xyz, and HIP-3. Covers orderbooks, trades, candles, funding rates, open interest, liquidations, and data quality. Use when the user...

OpenClaw

1sec-security

cutmob

Install, configure, and manage 1-SEC — an open-source, all-in-one cybersecurity platform (16 modules, single binary) on Linux servers and VPS instances. Use when the user asks to secure a server, install securi...