← Back to Skills Marketplace
shouldnotappearcalm

A股数据SKILL

by calm · GitHub ↗ · v1.1.1 · MIT-0
cross-platform ✓ Security Clean
587
Downloads
3
Stars
2
Active Installs
11
Versions
Install in OpenClaw
/install a-share-trading
Description
查询A股实时行情、历史数据、技术指标、事件、资金面与个股行业信息。Use when 用户提到股票代码、板块、技术分析、财务指标、指数成分、交易日历、宏观数据或个股所属行业。
README (SKILL.md)

A股数据综合分析

目标

使用本技能时,优先调用本目录下脚本获取结构化数据,不依赖网页抓取。

支持能力:

  • 实时行情与市场维度
  • 历史数据与财务维度
  • 技术指标
  • 个股事件
  • A+H 双重上市公司列表(支持按 H 股上市日期筛选)
  • A股赴港上市关键事件时间节点(递表/聆讯/备案/招股/定价/配售/上市)
  • 个股行业信息(fetch_sector_info.py,数据源东方财富;不作为支持能力:概念板块,见下)

环境与路径

pip install akshare MyTT pandas numpy requests
SKILL_DIR="\x3C本skill绝对路径>"
python3 "$SKILL_DIR/scripts/fetch_realtime.py" [参数]
python3 "$SKILL_DIR/scripts/fetch_history.py" [参数]
python3 "$SKILL_DIR/scripts/fetch_technical.py" [参数]
python3 "$SKILL_DIR/scripts/fetch_stock_events.py" [参数]
python3 "$SKILL_DIR/scripts/fetch_ah_stocks.py" [参数]
python3 "$SKILL_DIR/scripts/fetch_ah_ipo_timeline.py" [参数]
python3 "$SKILL_DIR/scripts/fetch_sector_info.py" [参数]

说明:脚本虽可能带概念相关参数,但上游概念接口结果不稳定、常为空,本技能不将概念查询列为可用能力;使用时请固定加 --no-concepts,只查行业与证券简称。

代码格式约定

优先使用以下股票代码格式:

  • 纯数字:600519
  • 市场前缀:sh600519 / sz000001
  • JoinQuant:600519.XSHG

脚本路由规则

按问题类型选脚本:

  • fetch_realtime.py:实时价格、分钟线、指数、北向、龙虎榜、涨跌停、板块、资金流、新闻、全市场行情、成交明细
  • fetch_history.py:历史K线、财务、业绩、分红、行业、指数成分、交易日历、宏观
  • fetch_technical.py:MA/MACD/KDJ/RSI/BOLL等技术指标
  • fetch_stock_events.py:业绩、增减持/回购、监管、重大合同、舆情方向
  • fetch_ah_stocks.py:A+H 双重上市公司清单、H 股上市日期区间筛选
  • fetch_ah_ipo_timeline.py:A股赴港上市关键事件节点(递表/聆讯/备案/招股/定价/配售/上市);支持 --code / --name 点查
  • fetch_sector_info.py:单只或多只股票的行业与名称(东方财富);批量时并行,默认 --workers仅文档化行业路径,不加概念

执行流程

  1. 先识别用户意图是实时、历史、技术、事件、A股赴港上市时间节点,还是「个股所属行业」。
  2. 选择对应脚本并优先加 --json
  3. 参数不足时补齐默认值后执行,不先空谈。
  4. 返回时给出关键字段结论,并附可复现命令。

降级与容错规则

  • 历史能力统一走 fetch_history.py(已内置多源逻辑,K线链路为腾讯优先、新浪降级、东财兜底)。
  • 遇到上游限流或临时失败:
    • 同类接口先重试 1-2 次。
    • 可降级就降级,不能降级则明确标注为“上游数据源不可用”。
  • --all-stocks 已支持新浪/腾讯/雪球多源;若单一源失败,继续返回其他源合并结果。

批量数据并行与超时规范(强制)

当任务是“批量拉取”时(实时个股列表 / 多只历史K线),默认并行,不逐只串行。

  • 推荐并发:max_workers=8~12(默认 10)
  • 每只股票独立异常捕获,失败不阻断整批
  • 结果输出必须包含:样本数、成功率、总耗时、失败代码清单

超时上限(硬限制):

  • 批量实时个股列表:整批任务最多等待 30s
  • 批量历史K线(多只):整批任务最多等待 30s
  • 全市场并发任务:整批任务最多等待 60s

超时/失败处理(强制):

  • 到达超时即停止等待并返回当前结果
  • 失败就标记失败,不做长时间阻塞重试
  • 禁止无上限重试或“卡住一直等”

输出规范

  • 默认返回结构化要点,不堆长表。
  • 需要原始数据时再返回完整 JSON。
  • 明确数据源与时间点(如交易日、更新时间、盘中/休市状态)。

常用命令最小集

# 实时
python3 fetch_realtime.py --quote 600519 --json
python3 fetch_realtime.py --index --json
python3 fetch_realtime.py --boards-summary --boards-limit 20 --json
python3 fetch_realtime.py --all-quote --sort change_pct_desc --top 50 --json
python3 fetch_realtime.py --tick 600519 --json

# 历史
python3 fetch_history.py --kline 600519 --start 2025-01-01 --end 2025-03-31 --freq d --json
python3 fetch_history.py --kline-batch 600519,000001,300750 --start 2025-10-01 --end 2026-03-31 --count 120 --workers 8 --retries 2 --json
python3 fetch_history.py --financials 600519 --start 2023-01-01 --end 2025-01-01 --json
python3 fetch_history.py --industry 300271 --with-boards --json

# 技术
python3 fetch_technical.py 600519 --freq 1d --count 120 --indicators MA,MACD,KDJ,RSI,BOLL --json

# 事件
python3 fetch_stock_events.py --code 300476 --name 胜宏科技 --dates 20250331,20241231 --limit 20 --json

# A+H 列表
python3 fetch_ah_stocks.py --json
python3 fetch_ah_stocks.py --since 2020-01-01 --until 2024-12-31 --json

# A股赴港上市关键节点
python3 fetch_ah_ipo_timeline.py --name 顺丰 --json
python3 fetch_ah_ipo_timeline.py --code 002352 --json
python3 fetch_ah_ipo_timeline.py --since 2020 --workers 4 --json

# 个股行业(不加概念,见上文说明)
python3 fetch_sector_info.py --no-concepts --json 600519
python3 fetch_sector_info.py --workers 8 --no-concepts --timeout 15 --json 600519 000001 300750 600036 601318 002594 688981 300059

不要做的事

  • 不把本技能当成爬虫任务优先方案。
  • 不在无必要时输出超长原始表格。
  • 不使用已移除的旧流程文案。
  • 不承诺或引导用户依赖 fetch_sector_info.py 的概念板块字段;技能侧只用 --no-concepts 的行业与名称结果。

参考

Usage Guidance
This skill appears to do what it says: it runs local Python scripts that call public finance APIs (新浪、腾讯、东方财富、雪球, akshare) and writes caches into the skill's cache/ folder. Before installing: 1) Be aware the scripts make outbound HTTP(S) calls to multiple third‑party endpoints (including a less‑familiar domain used for news — dang-invest.com). If you have policy concerns, review or block that domain. 2) Run the code in an isolated environment (virtualenv/container) and review or remove cached files if sensitive. 3) Verify you trust the upstream GitHub/project link in SKILL.md before using in production. 4) No credentials are requested, so there's no obvious secret‑exfiltration path in the provided files.
Capability Analysis
Type: OpenClaw Skill Name: a-share-trading Version: 1.1.1 The skill bundle is a comprehensive toolset for fetching Chinese A-share market data, including real-time quotes, historical K-lines, technical indicators, and IPO timelines. It fetches data from legitimate financial sources such as Tencent (gtimg.cn), Sina (sina.com.cn), Eastmoney (eastmoney.com), Xueqiu, and DangInvest (dang-invest.com). The code is well-structured, utilizing standard libraries like pandas and akshare, and implements robust features like thread-based timeouts and multi-source fallbacks. No evidence of data exfiltration, malicious execution, or harmful prompt injection was found across the scripts or documentation.
Capability Assessment
Purpose & Capability
Name/description (A股 数据: 实时、历史、技术、事件、行业) align with the included scripts. The files implement realtime, history, technicals, A+H lists, IPO timelines and sector lookups using akshare and public finance APIs — all expected for this purpose.
Instruction Scope
SKILL.md instructs the agent to run the included scripts and to install akshare/MyTT/pandas/requests. The scripts perform network requests to many public finance endpoints (新浪/腾讯/东方财富/雪球/东财 push2 and EastMoney notice APIs). This is expected for a market data skill, but note that some endpoints (e.g., dang-invest.com used for market news/boards in fetch_realtime.py) are third‑party and not explicitly listed in SKILL.md.
Install Mechanism
There is no automated install spec — the skill is instruction‑only and expects pip packages to be installed manually per SKILL.md. No archives or external installers are fetched by the skill itself, minimizing install risk.
Credentials
The skill requests no environment variables or credentials and only reads/writes cache files under its own directory. No secrets or unrelated system config are requested.
Persistence & Privilege
always is false and the skill does not request elevated or persistent system privileges. It caches data under its own cache/ directory but does not modify other skills or global agent settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install a-share-trading
  3. After installation, invoke the skill by name or use /a-share-trading
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.1
- 补充了项目 GitHub 地址到文档参考部分。 - 其余内容保持不变,无功能和接口变更。
v0.0.10
A+H 股上市数据、上市时间线支持上线: - 新增 fetch_ah_stocks.py 脚本,支持获取 A+H 双重上市公司清单(可按 H 股上市日期筛选)。 - 新增 fetch_ah_ipo_timeline.py 脚本,支持查询 A 股公司赴港上市关键事件时间节点(递表/聆讯/备案/招股/定价/配售/上市),可按公司代码或名称查找。 - SKILL.md 文档补充了相关能力、脚本指引和常用命令示例。
v0.0.9
- 新增 fetch_sector_info.py,支持查询单只或多只A股的行业信息(数据源:东方财富)。 - SKILL.md 增加“个股行业信息”为官方能力,详细说明 fetch_sector_info.py 用法和参数。 - 明确技能默认不支持概念板块查询,建议统一加 --no-concepts 参数,仅查行业和证券简称。 - 丰富并规范批量数据并行与超时处理要求,完善失败处理与输出格式说明。 - 常用命令集新增行业信息相关调用示例,其他命令集同步补充和优化。
v0.0.8
No file changes detected; internal version update only. - No changes to code or documentation. - Functionality and usage remain the same as the previous version.
v0.0.7
- 引入 fetch_history_fallback.py 新脚本,增强历史数据获取的容错能力。 - 历史数据查询在主链路异常时,可自动切换到备用实现,提高稳定性。 - 其他现有功能与脚本不变。
v0.0.6
No file changes detected in this version. - No updates or modifications were made to the code or documentation files. - Functionality, usage, and workflows remain unchanged from the previous version.
v0.0.5
**新增脚本 fetch_stock_events.py,支持个股重大事件信息聚合。** - 新增 fetch_stock_events.py,按股票输出业绩、增减持/回购、监管事项、重大合同、舆情方向等 5 类事件。 - 支持多关键词(代码+名称)聚合新闻,增强事件覆盖度。 - 提供结构化 JSON 输出,便于后续分析。 - SKILL.md 文档同步扩展,列出全部调用参数及返回数据结构。 - fetch_realtime.py 增强行业板块(DangInvest)/市场新闻等功能说明。
v0.0.4
a-share-trading v0.0.4 - 增强脚本稳定性:实时和历史脚本增加多处重试和容错机制,提升接口稳定性 - fetch_realtime.py 统一外部接口为 HTTPS,自动处理网络波动及异常码 - fetch_realtime.py 日线链路增加东方财富接口兜底 - fetch_history.py 登录 Baostock 支持自动重试 - 文档补充“稳定性增强(2026-03)”更新说明及快速验证方法
v0.0.3
## 完整能力清单 1. 实时行情快照(最新价、涨跌幅、今开/最高/最低、昨收、成交量、换手率等) 2. 今日分钟K线(1m/5m/15m/30m/60m,只返回今天的分钟走势) 3. 批量实时行情(一次最多查询 10 只股票,按涨跌幅排序展示) 4. 实时/连续K线查询(支持 1m/5m/15m/30m/60m/1d/1w/1M,配合条数获取历史与实时连续K线) 5. 四大指数实时概览(上证/深证成指/创业板指/科创50) 6. 热点概念板块(概念板块涨幅榜TopN) 7. 北向资金(沪深港通资金流向概览) 8. 龙虎榜(指定日期区间的龙虎榜数据,支持TopN) 9. 涨跌停统计(当天涨停/跌停数量统计) 10. 涨停股池(指定日期的涨停股明细,支持TopN) 11. 连板股统计(连板/连续涨停相关统计展示) 12. 个股资金流向(主力/大单/中单/小单净流入等,支持近 N 日) 13. 市场新闻(DangInvest 开放接口的市场新闻列表,支持分页:limit/offset;可输出 JSON 供继续分析) 14. 行业板块概览(DangInvest 板块聚合:行业板块的涨跌幅、市值/成交额等汇总,可按市值/成交额排序筛选TopN) 15. 行业板块成分明细(选定某个行业板块后,返回该板块成分股票 Top 列表,并带汇总统计,可输出 JSON) 16. 技术指标计算与解读(基于实时/连续K线计算技术指标并输出结果,支持:MA、EMA、MACD、KDJ、RSI、WR、BOLL、BIAS、CCI、ATR、DMI、TAQ 等) 17. 历史K线查询(按日期区间取日/周/月/分钟级历史K线,可选复权方式) 18. 股票基本信息(名称、行业、上市日期等) 19. 财务报表(综合财务指标:盈利/成长/偿债/现金流/杜邦等,支持汇总或单项查询) 20. 业绩快报/业绩预告 21. 分红配送信息 22. 行业分类与行业成分
v0.0.2
- 实时行情脚本不再依赖 Ashare 库,改为直接调用腾讯/新浪API,提升稳定性和数据时效。 - 新增分钟K线聚合的“实时行情快照”,可展示市场当前交易状态(交易中/盘前/盘后/休市)。 - 新增今日分钟K线、批量实时行情查询等功能,满足更灵活的盘中数据需求。 - 技术指标脚本无需依赖 Ashare,全部基于MyTT和直接API,支持盘中快速技术分析。 - 实时数据源覆盖增加腾讯,提升行情稳定性与可用性。 - 龙虎榜功能优化,未发布当日数据时会友好提示。
v0.0.1
## 0.1.0 - 2026-03-18 - 新增 `skills/a-share-skill` Skill: - 能力覆盖:实时行情、分钟/日/周K线、技术指标(MACD/KDJ/RSI/BOLL 等)、财务报表(盈利/成长/偿债/现金流/杜邦)、宏观利率与货币供应量、指数成分股、涨停/连板、龙虎榜、北向资金、资金流向等。 - 数据源:东方财富 / 新浪财经(通过 akshare)、Baostock、本地 Ashare + MyTT 库。 - 添加脚本: - `scripts/fetch_realtime.py`:实时行情 + 指数 + 热点板块 + 涨停/连板 + 资金流向。 - `scripts/fetch_history.py`:历史K线、财务报表、指数成分、宏观经济、交易日历。 - `scripts/fetch_technical.py`:依托 Ashare 实时K线和 MyTT 计算多种技术指标并给出信号解读。 - `scripts/Ashare.py`:内置稳定版 Ashare,实现 A 股双核心实时 K 线接口。 - 目录调整: - 使用 `skills/` 目录统一承载 Skill:`skills/a-share-skill/`。 - 在仓库根目录新增 `README.md`,说明 Skill 包结构与用法。
Metadata
Slug a-share-trading
Version 1.1.1
License MIT-0
All-time Installs 2
Active Installs 2
Total Versions 11
Frequently Asked Questions

What is A股数据SKILL?

查询A股实时行情、历史数据、技术指标、事件、资金面与个股行业信息。Use when 用户提到股票代码、板块、技术分析、财务指标、指数成分、交易日历、宏观数据或个股所属行业。 It is an AI Agent Skill for Claude Code / OpenClaw, with 587 downloads so far.

How do I install A股数据SKILL?

Run "/install a-share-trading" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is A股数据SKILL free?

Yes, A股数据SKILL is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does A股数据SKILL support?

A股数据SKILL is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created A股数据SKILL?

It is built and maintained by calm (@shouldnotappearcalm); the current version is v1.1.1.

💬 Comments