amtk-skill

A 股行情数据技能:从 Tushare 抓取数据、查询行情估值、技术分析(均线/RSI/MACD/布林带)

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "amtk-skill" with this command: npx skills add lhkong7/amtk-skill

AMtkSkill — A 股行情数据技能

根据用户意图判断执行哪类操作,调用对应脚本。如果用户意图不明确,先询问。

前置条件

项目根目录:${CLAUDE_SKILL_DIR}

必须在 .env 中配置 TUSHARE_TOKEN

检查依赖:

uv sync

Available scripts

  • scripts/amtk_fetch.py — 从 Tushare 抓取 A 股行情数据存入本地 Parquet/CSV
  • scripts/amtk_query.py — 查询本地数据:搜索股票、查看行情、估值排名、涨跌幅排名
  • scripts/amtk_analyze.py — 技术分析:均线、RSI、MACD、布林带、复权价格、收益统计

每个脚本均支持 --help 查看完整用法。


一、Fetch — 数据抓取

首次初始化(全量抓取 + 中断续跑)

uv run scripts/amtk_fetch.py init

可选参数:

uv run scripts/amtk_fetch.py init --start-date 20250418 --end-date 20260418 --limit 10

每日增量更新

uv run scripts/amtk_fetch.py daily --end-date 20260420

中断续跑

uv run scripts/amtk_fetch.py resume

仅拉取股票列表

uv run scripts/amtk_fetch.py stock-list
uv run scripts/amtk_fetch.py stock-list --list-status L --exchange SSE

验证数据

uv run scripts/amtk_fetch.py overview

fetch.py 参数速查

子命令关键参数说明
init--start-date, --end-date, --limit全量抓取,自动 resume
daily--end-date (必填)增量更新
resume同 init中断续跑
stock-list--list-status, --exchange仅拉取股票列表
overview数据总览

二、Query — 数据查询

数据总览

uv run scripts/amtk_query.py overview

搜索股票

uv run scripts/amtk_query.py stock-info --keyword 银行
uv run scripts/amtk_query.py stock-info --industry 银行 --exchange SSE

单只股票行情

uv run scripts/amtk_query.py daily --ts-code 000001.SZ
uv run scripts/amtk_query.py daily --ts-code 000001.SZ --start-date 20260101 --end-date 20260418 --tail 30

完整数据(行情 + 估值 + 复权因子)

uv run scripts/amtk_query.py full --ts-code 000001.SZ

全市场截面

uv run scripts/amtk_query.py cross-section --date 20260417 --sort-by amount --limit 20

涨跌幅排名

uv run scripts/amtk_query.py top-movers --date 20260417 --direction up --limit 10
uv run scripts/amtk_query.py top-movers --date 20260417 --direction down --limit 10

估值排名

uv run scripts/amtk_query.py valuation --metric pe --limit 10
uv run scripts/amtk_query.py valuation --metric pb --date 20260417
uv run scripts/amtk_query.py valuation --metric total_mv --limit 10
uv run scripts/amtk_query.py valuation --metric turnover_rate

行业平均估值

uv run scripts/amtk_query.py industry
uv run scripts/amtk_query.py industry --date 20260417 --limit 30

query.py 参数速查

子命令关键参数说明
overview各数据集行数/日期范围
stock-info--keyword, --industry, --exchange搜索股票
daily--ts-code (必填)单股 OHLCV
full--ts-code (必填)单股完整数据
cross-section--date (必填)全市场某日截面
top-movers--date (必填), --direction涨跌幅 TOP N
valuation--metric (必填: pe/pb/total_mv/turnover_rate)估值排名
industry--date, --limit行业平均估值

三、Analyze — 技术分析

均线

uv run scripts/amtk_analyze.py ma --ts-code 000001.SZ
uv run scripts/amtk_analyze.py ma --ts-code 000001.SZ --windows 5,20,60 --start-date 20260101

RSI

uv run scripts/amtk_analyze.py rsi --ts-code 000001.SZ --period 14

MACD

uv run scripts/amtk_analyze.py macd --ts-code 000001.SZ

布林带

uv run scripts/amtk_analyze.py bollinger --ts-code 000001.SZ

复权价格

uv run scripts/amtk_analyze.py adjusted --ts-code 000001.SZ --method forward
uv run scripts/amtk_analyze.py adjusted --ts-code 000001.SZ --method backward

收益统计

uv run scripts/amtk_analyze.py stats --ts-code 000001.SZ --start-date 20250418

输出:total_return_pct, annualized_return_pct, annualized_volatility_pct, max_drawdown_pct, sharpe_ratio

检测分红拆股

uv run scripts/amtk_analyze.py corporate-actions --ts-code 000001.SZ

多股票对比

uv run scripts/amtk_analyze.py compare --ts-codes 000001.SZ,600519.SH,000858.SZ --start-date 20250418

analyze.py 参数速查

子命令关键参数说明
ma--ts-code, --windows均线 (默认 5,10,20,60)
rsi--ts-code, --periodRSI (默认 14)
macd--ts-code, --fast, --slow, --signalMACD
bollinger--ts-code, --window, --num-std布林带
adjusted--ts-code, --method前/后复权价格
stats--ts-code收益率/波动率/回撤/夏普
corporate-actions--ts-code分红拆股检测
compare--ts-codes (逗号分隔)多股票对比

数据表结构

数据集字段
market_dailyts_code, trade_date, open, high, low, close, vol(手), amount(千元), vwap
daily_basicts_code, trade_date, turnover_rate(%), pe, pe_ttm, pb, total_mv(万元), circ_mv(万元)
adj_factorts_code, trade_date, adj_factor
stock_basicts_code, symbol, name, area, industry, market, exchange, list_status, list_date

指标解读参考

指标多头/超买空头/超卖
RSI> 70 超买< 30 超卖
MACDmacd > signal(金叉)macd < signal(死叉)
布林带价格触及上轨价格触及下轨
均线短期 > 长期(多头排列)短期 < 长期(空头排列)

通用规则

  1. 如果用户未指定日期:query 和 analyze 默认使用最新交易日
  2. 如果没有数据:提示用户先执行 uv run scripts/amtk_fetch.py init
  3. 默认使用前复权价格(analyze)
  4. 对结果做简要解读 — 帮用户理解数据含义

故障排查

  • token 错误 — 检查 .envTUSHARE_TOKEN
  • 缺少 pyarrow — 运行 uv sync
  • 中断后续跑uv run scripts/amtk_fetch.py resume
  • 只想抓少量测试uv run scripts/amtk_fetch.py init --limit 5

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Gigo Lobster Resume

🦞 GIGO · gigo-lobster-resume: 续跑入口:v2 stable 当前会清理旧 checkpoint 并从头重跑;保留此 slug 作为旧 checkpoint 兼容入口。 Triggers: 继续试吃 / 恢复评测 / resume tasting / continue lobster...

Registry SourceRecently Updated
General

YiHui CONTEXT MODE

context-mode is an MCP server that saves 98% of your context window by sandboxing tool outputs. It routes large file reads, shell outputs, and web fetches th...

Registry SourceRecently Updated
General

xinyi-drink

Use when users ask about 新一好喝/新一咖啡 drinks, stores, menu, activities, Skill用户大礼包, today drink recommendations, afternoon tea, feeling sleepy, or personalized...

Registry SourceRecently Updated
General

vedic-destiny

吠陀命盘分析中文入口。用于完整命盘研判、命主盘 Rashi chart 与九分盘 Navamsha chart 联读、既往事件回看、出生时间稳定度判断、事业主题、婚姻主题、时空盘专题,以及基于 Jagannatha Hora PDF、星盘截图或文本命盘数据的系统拆盘。当用户提到完整星盘、事业方向、婚姻问题、关系窗...

Registry SourceRecently Updated