Rechercher

PythonReactSEOPDF
OpenClaw

xtquant

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

coderwpf0 installations selon la source☆ 0 Étoiles du dépôtv1.0.0

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

SkillHub CLI

skillhub install coderwpf/xtquant

Examinez la source et la compatibilité, puis suivez les étapes d’installation.

Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.

Voir la source ↗Guides

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

Informations sur la source

Source
github
Repository
openclaw/skills
Path
skills/coderwpf/xtquant
Version
1.0.0
Commit
e1e1d5b63c4ad216932a86ef9cd421855608c3a8
Source de classification
rules
Statut
active
Visibilité
public

Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.

Contenu extrait

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

Skills associés

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