← 返回 Skills 市场
lhkong7

AMtkSkill

作者 LHKong7 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
66
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install amtk-skill
功能描述
A 股行情数据技能:从 Tushare 抓取数据、查询行情估值、技术分析(均线/RSI/MACD/布林带)
使用说明 (SKILL.md)

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, --period RSI (默认 14)
macd --ts-code, --fast, --slow, --signal MACD
bollinger --ts-code, --window, --num-std 布林带
adjusted --ts-code, --method 前/后复权价格
stats --ts-code 收益率/波动率/回撤/夏普
corporate-actions --ts-code 分红拆股检测
compare --ts-codes (逗号分隔) 多股票对比

数据表结构

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

指标解读参考

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

通用规则

  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
安全使用建议
This skill appears to do what it says (fetch A‑share data from Tushare and analyze it), but the package requires a TUSHARE_TOKEN stored in a .env file — the registry metadata does not advertise this secret requirement. Before installing: - Be aware you must provide a TUSHARE_TOKEN (put in .env or environment). Treat that token as a secret and only use a token/account with limited permissions if possible. - `uv sync` (per SKILL.md) will install Python packages (pandas, pyarrow, tushare, etc.) from PyPI; review and approve those installs and consider using an isolated virtual environment. - The code will make network requests to Tushare when running fetch commands and will write data into a local data/ directory; confirm you are comfortable with that traffic and local storage location. - The main incoherence is metadata omission of the required environment variable. Ask the publisher (or inspect the code yourself) to confirm required env vars and dependency installation steps before proceeding. If you want to proceed safely: run the skill in an isolated environment (container/VM/virtualenv), provide a limited-scope Tushare token, and review/scan installed Python packages.
功能分析
Type: OpenClaw Skill Name: amtk-skill Version: 1.0.0 The amtk-skill bundle is a legitimate financial data tool designed to fetch, query, and analyze Chinese A-share market data using the Tushare API. The code follows standard data science practices, utilizing pandas and pyarrow for local data management in Parquet and CSV formats. Security hygiene is present in scripts/storage.py, which includes a path sanitization function (safe_partition_value) to prevent path traversal when saving stock data. No evidence of data exfiltration, malicious command execution, or harmful prompt injection was found; the requirement for a TUSHARE_TOKEN in the .env file is consistent with the stated purpose of the tool.
能力评估
Purpose & Capability
Name and description match the included code: the package fetches A‑share data from Tushare, stores local Parquet/CSV, and computes technical indicators. The scripts and CLI commands are coherent with that purpose.
Instruction Scope
SKILL.md instructs the agent to run local scripts (uv run ...) and to read .env for TUSHARE_TOKEN; runtime actions are limited to fetching data from Tushare, reading/writing the local data/ directory, and computing indicators. I found no instructions that read unrelated system files or transmit data to unknown endpoints beyond Tushare.
Install Mechanism
There is no registry install spec (instruction-only), but script headers declare Python dependencies and SKILL.md tells the user to run `uv sync`. That implies the environment will install Python packages (pandas, pyarrow, python-dotenv, tushare, etc.). No downloads from unknown/personal URLs were found, but installing packages will execute third-party code from PyPI.
Credentials
The SKILL.md and the code require a TUSHARE_TOKEN (it reads .env and uses Tushare via create_tushare_pro), but the registry metadata lists no required environment variables or primary credential. The token is a secret used to access a third‑party API; the skill legitimately needs it, but the metadata omission is misleading and could cause users to expose a secret unknowingly or install the skill without understanding the need for credentials.
Persistence & Privilege
The skill does not request always:true, does not modify other skills or system-wide agent settings, and only reads/writes its own data/ directory. Autonomous invocation is allowed (default) but not combined with other high-risk privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install amtk-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /amtk-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
amtk-skill 1.0.0 - Initial release providing A股行情数据工具集。 - 支持 Tushare 抓取数据、本地查询行情估值、技术分析(均线/RSI/MACD/布林带/复权/收益统计)。 - 包含完善参数说明与脚本用法,涵盖数据抓取、查询、分析场景。 - 提供常见故障排查与数据表结构/指标解读说明。 - 可通过 Bash(uv run *) 等工具调用,适合自动化或命令行场景。
元数据
Slug amtk-skill
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

AMtkSkill 是什么?

A 股行情数据技能:从 Tushare 抓取数据、查询行情估值、技术分析(均线/RSI/MACD/布林带). 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 66 次。

如何安装 AMtkSkill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install amtk-skill」即可一键安装,无需额外配置。

AMtkSkill 是免费的吗?

是的,AMtkSkill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

AMtkSkill 支持哪些平台?

AMtkSkill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 AMtkSkill?

由 LHKong7(@lhkong7)开发并维护,当前版本 v1.0.0。

💬 留言讨论