Overview
- Skill Key
- coderwpf/xtdata
- Author
- coderwpf
- Source Repo
- openclaw/skills
- Version
- 1.0.0
- Source Path
- skills/coderwpf/xtdata
- Latest Commit SHA
- 783d05b9ff6688ac4b7c803c89ff9210efb90e62
XtQuant market data module — real-time quotes, K-lines, tick, Level2, financials for QMT/miniQMT.
Stars
0
Installs
0
Status
ACTIVE
Visibility
PUBLIC
直接复制以下提示词,发送给你的 AI 助手即可完成安装。
请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 xtdata 技能。 若已安装,则直接安装 xtdata 技能。
# 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)...
human-pages-ai
Search and hire real humans for tasks — photography, delivery, research, and more
zseven-w
Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.
capt-marbles
Attio CRM integration for managing companies, people, deals, notes, tasks, and custom objects. Use when working with Attio CRM data, searching contacts, managing sales pipelines, adding notes to records, creating tasks, or syncing prospect information.
capt-marbles
Web scraping and crawling with Firecrawl API. Fetch webpage content as markdown, take screenshots, extract structured data, search the web, and crawl documentation sites. Use when the user needs to scrape a URL, get current web info, capture a screenshot, extract specific data from pages, or crawl docs for a framework/library.
caqlayan
Tweet Processor Skill
carlosarturoleon
Connect to Windsor.ai MCP for natural language access to 325+ data sources including Facebook Ads, GA4, HubSpot, Shopify, and more.