用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/dvcrn/openclaw-skills-marketplace --skill xtdata命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your agent a soul.
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
基于 SOC 职业分类
正在显示 SKILL.md
| name | xtdata |
| description | XtQuant market data module — real-time quotes, K-lines, tick, Level2, financials for QMT/miniQMT. |
| homepage | http://dict.thinktrader.net/nativeApi/xtdata.html |
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.
pip install xtquant
from xtquant import xtdata
xtdata.connect() # connects to local miniQMT
Optionally specify data directory:
xtdata.data_dir = r'D:\QMT\userdata_mini'
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 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
data = xtdata.get_local_data(
field_list=[],
stock_list=['000001.SZ'],
period='1d',
start_time='20240101',
end_time='20240630'
)
def on_data(datas):
for stock_code, data in datas.items():
print(stock_code, data)
xtdata.subscribe_quote('000001.SZ', period='tick', callback=on_data)
xtdata.run() # block and receive callbacks
xtdata.subscribe_whole_quote(['SH', 'SZ'], callback=on_data)
# Markets: 'SH' (Shanghai), 'SZ' (Shenzhen), 'BJ' (Beijing)
xtdata.run()
data = xtdata.get_full_tick(['SH', 'SZ'])
# Returns dict: {stock_code: tick_data, ...}
# Download financial data first
xtdata.download_financial_data(['000001.SZ'])
# Get financial data
data = xtdata.get_financial_data(['000001.SZ'])
Available tables: Balance (资产负债表), Income (利润表), CashFlow (现金流量表), PershareIndex (主要指标), Capital (股本表), Top10holder, Top10flowholder, Holdernum
data = xtdata.get_divid_factors('000001.SZ')
# Get contract info
info = xtdata.get_instrument_detail('000001.SZ')
# Returns: InstrumentName, ExchangeID, ProductID, UpStopPrice, DownStopPrice, ...
# Get instrument type
itype = xtdata.get_instrument_type('000001.SZ') # 'stock', 'index', 'fund', 'bond', etc.
# Trading days
days = xtdata.get_trading_dates('SH', start_time='20240101', end_time='20240630')
# Sector/block lists
blocks = xtdata.get_stock_list_in_sector('沪深A股')
# Download first
xtdata.download_index_weight()
# Get weights
weights = xtdata.get_index_weight('000300.SH')
# Returns: {stock_code: weight, ...}
xtdata.download_cb_data()
data = xtdata.get_cb_data()
tick, 1m, 5m, 15m, 30m, 1h, 1d, 1w, 1mon
If your broker supports Level2:
xtdata.download_history_data() before get_market_data_ex() for first-time data access.xtdata.run() blocks the thread — use in a separate thread if combining with trading.