Search

PythonReactSEOPDF
OpenClaw

xtquant

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

coderwpf0 source installs☆ 0 Repository starsv1.0.0

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install coderwpf/xtquant

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

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 information

Source
github
Repository
openclaw/skills
Path
skills/coderwpf/xtquant
Version
1.0.0
Commit
e1e1d5b63c4ad216932a86ef9cd421855608c3a8
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

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

Related skills

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