Search

PythonReactSEOPDF
OpenClaw

xtdata

XtQuant market data module — real-time quotes, K-lines, tick, Level2, financials for QMT/miniQMT.

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/xtdata

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

XtData (XtQuant 行情模块)

xtdata is the market data module of XtQuant, providing real-time and historical market data via the local miniQMT client.

⚠️ Requires miniQMT running locally. xtdata communicates with miniQMT via TCP to fetch data.

Install

pip install xtquant

Connect

from xtquant import xtdata

xtdata.connect()  # connects to local miniQMT

Optionally specify data directory:

xtdata.data_dir = r'D:\QMT\userdata_mini'

Download historical data

Must download before accessing local data:

# Download daily K-line
xtdata.download_history_data('000001.SZ', '1d', start_time='20240101', end_time='20240630')

# Download 1-minute K-line
xtdata.download_history_data('000001.SZ', '1m', start_time='20240101', end_time='20240630')

# Download tick data
xtdata.download_history_data('000001.SZ', 'tick', start_time='20240601', end_time='20240630')

Get K-line data

# Get market data (returns dict of DataFrames keyed by stock code)
data = xtdata.get_market_data_ex(
    [],                    # field_list, empty = all fields
    ['000001.SZ'],         # stock_list
    period='1d',           # tick, 1m, 5m, 15m, 30m, 1h, 1d, 1w, 1mon
    start_time='20240101',
    end_time='20240630',
    count=-1,              # -1 = all data
    dividend_type='front',  # none, front, back, front_ratio, back_ratio
    fill_data=True
)
df = data['000001.SZ']
# columns: open, high, low, close, volume, amount, settelementPrice, openInterest, preClose, suspendFlag

Get local data (no download needed if already cached)

data = xtdata.get_local_data(
    field_list=[],
    stock_list=['000001.SZ'],
    period='1d',
    start_time='20240101',
    end_time='20240630'
)

Real-time subscription

Subscribe single stock
def on_data(datas):
    for stock_code, data in datas.items():
        print(stock_code, data)...

Source information

Source
github
Repository
openclaw/skills
Path
skills/coderwpf/xtdata
Version
1.0.0
Commit
783d05b9ff6688ac4b7c803c89ff9210efb90e62
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
# XtData (XtQuant 行情模块)

`xtdata` is the market data module of [XtQuant](http://dict.thinktrader.net/nativeApi/start_now.html), providing real-time and historical market data via the local miniQMT client.

> ⚠️ **Requires miniQMT running locally**. xtdata communicates with miniQMT via TCP to fetch data.

## Install

```bash
pip install xtquant
```

## Connect

```python
from xtquant import xtdata

xtdata.connect()  # connects to local miniQMT
```

Optionally specify data directory:

```python
xtdata.data_dir = r'D:\QMT\userdata_mini'
```

---

## Download historical data

Must download before accessing local data:

```python
# Download daily K-line
xtdata.download_history_data('000001.SZ', '1d', start_time='20240101', end_time='20240630')

# Download 1-minute K-line
xtdata.download_history_data('000001.SZ', '1m', start_time='20240101', end_time='20240630')

# Download tick data
xtdata.download_history_data('000001.SZ', 'tick', start_time='20240601', end_time='20240630')
```

## Get K-line data

```python
# Get market data (returns dict of DataFrames keyed by stock code)
data = xtdata.get_market_data_ex(
    [],                    # field_list, empty = all fields
    ['000001.SZ'],         # stock_list
    period='1d',           # tick, 1m, 5m, 15m, 30m, 1h, 1d, 1w, 1mon
    start_time='20240101',
    end_time='20240630',
    count=-1,              # -1 = all data
    dividend_type='front',  # none, front, back, front_ratio, back_ratio
    fill_data=True
)
df = data['000001.SZ']
# columns: open, high, low, close, volume, amount, settelementPrice, openInterest, preClose, suspendFlag
```

## Get local data (no download needed if already cached)

```python
data = xtdata.get_local_data(
    field_list=[],
    stock_list=['000001.SZ'],
    period='1d',
    start_time='20240101',
    end_time='20240630'
)
```

## Real-time subscription

### Subscribe single stock

```python
def on_data(datas):
    for stock_code, data in datas.items():
        print(stock_code, data)...

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