搜索

PythonReactSEOPDF
OpenClaw

xtdata

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

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

安装与使用

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

SkillHub CLI

skillhub install coderwpf/xtdata

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

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

查看来源 ↗使用指南

技能说明

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
github
Repository
openclaw/skills
Path
skills/coderwpf/xtdata
Version
1.0.0
Commit
783d05b9ff6688ac4b7c803c89ff9210efb90e62
分类来源
rules
状态
active
可见性
public

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

来源内容

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

相关技能

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