← 返回 Skills 市场
shinelp100

Cn Stock Volume

作者 shinelp100 · GitHub ↗ · v3.1.0 · MIT-0
cross-platform ⚠ suspicious
140
总下载
0
收藏
0
当前安装
13
版本数
在 OpenClaw 中安装
/install cn-stock-volume
功能描述
获取中国股市四市(沪市、深市、创业板、北交所)指定日期的成交金额、增缩量及比例,并输出四市合计总结。支持查询三市(沪市/深市/北交所)上涨/下跌家数。**首选 Browser 方案**(东方财富网网页版),备用 API 方案(东方财富/新浪/腾讯)。
使用说明 (SKILL.md)

cn-stock-volume v3.0

获取中国 A 股市场核心数据:三大指数点位及涨跌幅成交量变化涨跌家数比

📊 数据指标

指标 获取方式 说明 示例
上证指数 🤖 自动 点位 + 涨跌幅 3957.05 点,-1.24%
深证成指 🤖 自动 点位 + 涨跌幅 13866.20 点,-0.25%
创业板指 🤖 自动 点位 + 涨跌幅 3352.10 点,+1.30%
上涨家数 🤖 自动 A 股上涨数量 1234 家
下跌家数 🤖 自动 A 股下跌数量 3456 家
今日量能 ✍️ 手动 四市总成交金额 待补充
昨日量能 ✍️ 手动 前一交易日成交金额 待补充

🚀 快速开始

步骤 1:获取自动数据

# 查询今日(自动获取指数 + 涨跌家数)
python3 scripts/generate_report.py

# 查询指定日期
python3 scripts/generate_report.py 2026-03-22

# 强制刷新(忽略缓存)
python3 scripts/generate_report.py --force

步骤 2:补充成交量数据

# 补充今日和昨日成交量(单位:万亿)
python3 scripts/补数据.py 2026-03-22 --today 1.23 --previous 1.30

# 查看当前手动数据
python3 scripts/补数据.py 2026-03-22 --show

# 清除手动数据
python3 scripts/补数据.py 2026-03-22 --clear

步骤 3:重新生成报告

# 重新生成(使用补充的成交量数据)
python3 scripts/generate_report.py 2026-03-22

📁 输出文件

Markdown 报告(人类阅读)

  • 位置: ~/Desktop/A 股每日复盘/stock-report-YYYY-MM-DD.md
  • 用途: 直接阅读、分享到群聊

JSON 数据(程序调用)

  • 位置: ~/Desktop/A 股每日复盘/data-YYYY-MM-DD.json
  • 用途: 其他程序/脚本调用

🏗️ 目录结构

cn-stock-volume/
├── SKILL.md              # 本文件
├── DESIGN.md             # 详细设计文档
├── scripts/
│   ├── fetch_data.py     # 数据获取核心
│   ├── generate_report.py # 报告生成
│   └── 补数据.py          # 手动补充数据
├── cache/                # 缓存(TTL=24h)
│   └── YYYY-MM-DD.json
├── manual/               # 手动补充数据
│   └── YYYY-MM-DD.json
└── output/               # 输出文件
    ├── report.md
    └── data.json

📋 数据源

同花顺问财(浏览器自动化)

数据 查询语句 URL
上证指数 上证指数 问财
深证成指 深证成指 问财
创业板指 创业板指 问财
上涨家数 A 股上涨数量 [问财](https://www.iwencai.com/unifiedwap/result?w=A 股上涨数量&querytype=zhishu)
下跌家数 A 股下跌数量 [问财](https://www.iwencai.com/unifiedwap/result?w=A 股下跌数量&querytype=zhishu)

🔧 特性

缓存机制

  • TTL: 24 小时
  • 位置: cache/YYYY-MM-DD.json
  • 作用: 避免重复调用浏览器,提升速度

非交易日处理

  • 自动检测周末
  • 往前推移直到找到最近交易日
  • 最多往前推 7 天

手动补充

  • 成交量数据需手动补充
  • 支持命令行补充(补数据.py
  • 支持直接编辑 JSON 文件
  • 补充后重新生成报告即可更新

错误处理

  • 单个数据失败 → 使用占位符 待补充
  • 不影响其他数据获取
  • 清晰的错误提示

📝 输出示例

Markdown

# 📊 A 股市场日报 | 2026-03-22

## 三大指数

| 指数 | 点位 | 涨跌幅 |
|------|------|--------|
| 上证指数 | 3957.05 | 📉 -1.24% |
| 深证成指 | 13866.20 | 📉 -0.25% |
| 创业板指 | 3352.10 | 📈 +1.30% |

## 成交量

- **今日量能**:1.23 万亿
- **量能变化**:缩量 0.07 万亿 (-5.69%)
- **市场情绪**:🟢 缩量调整

## 涨跌家数

- **上涨**:1234 家
- **下跌**:3456 家
- **涨跌比**:≈ 1:2.8(下跌显著多于上涨)

JSON

{
  "date": "2026-03-22",
  "indices": {
    "shanghai": { "point": 3957.05, "change": -1.24 },
    "shenzhen": { "point": 13866.20, "change": -0.25 },
    "chinext": { "point": 3352.10, "change": 1.30 }
  },
  "volume": {
    "today": 1.23,
    "previous": 1.30,
    "change": -0.07,
    "changePercent": -5.38,
    "type": "缩量"
  },
  "sentiment": {
    "up": 1234,
    "down": 3456,
    "ratio": "1:2.8",
    "description": "下跌显著多于上涨"
  }
}

⚠️ 注意事项

  1. 浏览器依赖: 需要 OpenClaw browser 工具可用(自动获取数据时)
  2. 网络要求: 需要能访问同花顺问财网站
  3. 成交量手动补充: 目前不支持自动获取,需手动补充
  4. 缓存清理: 手动删除 cache/ 目录可清空缓存
  5. 非交易日: 周末自动往前推,可能不是用户期望的日期

🛠️ 开发状态

  • 目录结构创建
  • 数据获取框架(fetch_data.py)
  • 报告生成脚本(generate_report.py)
  • 手动补充脚本(补数据.py)
  • 缓存逻辑
  • 非交易日处理
  • 浏览器工具集成(调用 OpenClaw browser.snapshot)
  • 数据解析逻辑(解析 snapshot 文本)
  • 完整流程测试(2026-03-22 测试通过)

📖 相关文档

💡 使用技巧

批量补充多日数据

# 连续补充 3 天数据
python3 scripts/补数据.py 2026-03-20 -t 1.20 -p 1.25
python3 scripts/补数据.py 2026-03-21 -t 1.25 -p 1.20
python3 scripts/补数据.py 2026-03-22 -t 1.23 -p 1.25

查看缓存状态

ls -lh cache/

查看手动数据

cat manual/2026-03-22.json
安全使用建议
What to consider before installing/using: - Functionality vs reality: The docs claim EastMoney (东方财富) and a four‑market scope, but the code targets iwencai (同花顺) and implements three indices only (上证/深证/创业板). If you need 北交所 data or EastMoney specifically, this skill may not provide it without code changes. - Incomplete browser integration: fetch_data.py contains TODOs and returns placeholders where browser.snapshot calls should be; the shell helper prints URLs but does not invoke a browser. The skill may not work out of the box in your environment — test it first (run scripts/test_generate.py to see generated outputs using provided test data). - Files written: The scripts will create cache/, manual/, output/ under the skill directory and write Markdown/JSON to ~/Desktop/A 股每日复盘/. If you prefer not to write to your Desktop, inspect and modify generate_report.py before running. - Network & tooling: The automatic path relies on an OpenClaw browser tool (browser.snapshot). This requires the agent/runtime to provide that tool and outbound network access to iwencai.com. If your environment restricts network or you don't want web scraping, do not enable automatic runs. - No secrets requested: The skill does not ask for API keys or other credentials — good. Still, review the code for any changes before granting it autonomy. Recommendations: 1) Inspect fetch_data.py and the browser integration TODOs; implement or confirm browser.snapshot behavior in your runtime before using automation. 2) Run test_generate.py to produce sample outputs and confirm file locations. 3) If you accept automatic network access, run in a controlled environment first. 4) If you want EastMoney/北交所 support, be prepared to modify queries or add data sources.
能力评估
Purpose & Capability
The skill's name/description promise is a report of Chinese markets (indices, up/down counts, volume). The included code and docs largely implement that. However there are inconsistencies: SKILL.md and README mention using 东方财富 (EastMoney) and fallback APIs, while the code and DESIGN.md target 同花顺问财 (iwencai). The description also mentions four markets (including 北交所) but the implemented INDEX_QUERIES only include 上证/深证/创业板 (no explicit 北京交易所 data source). These are mismatches between claims and actual code.
Instruction Scope
Runtime instructions and scripts stay within the stated purpose: they access iwencai URLs (browser snapshot), parse text, and write JSON/Markdown reports. There is no code that attempts to read unrelated system files or request unrelated credentials. The skill does require network access to iwencai and assumes an OpenClaw browser tool available in the environment.
Install Mechanism
No install spec or remote downloads are present — this is instruction/code-only. Files are included in the package; no external installers, package registries, or arbitrary URL downloads are used.
Credentials
The skill requests no environment variables or credentials and does not attempt to access secret/config paths. It will create and write to local directories (cache/, manual/, output/) and write files to the user's Desktop (~/Desktop/A 股每日复盘/), which is proportionate for a report generator but worth noting if you dislike files being placed in your home directory.
Persistence & Privilege
The skill is not marked always:true and does not modify other skills or system-wide settings. Its persistence is limited to creating local cache/manual/output files under the skill repo and the user's Desktop. It can run autonomously per platform defaults, but that is normal and not by itself a red flag.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cn-stock-volume
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cn-stock-volume 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v3.1.0
🎉 Monorepo 重构完成:独立仓库结构,完整的项目文档
v3.0.1
🎉 Monorepo 重构完成:独立仓库结构,完整的项目文档,优化的数据获取流程
v2.1.0
Monorepo 独立版本,支持单独安装
v2.0.0
Monorepo 独立版本,支持单独安装
v1.3.0
Monorepo 结构重构,支持独立安装使用
v1.2.3
Monorepo 结构重构,独立发布版本
v1.0.2
首次独立发布:支持四市成交金额查询、涨跌家数统计、多层降级策略
v1.0.1
首次独立发布:支持四市成交金额查询、涨跌家数统计、多层降级策略
v1.2.2
优化数据获取稳定性测试
v1.2.1
优化数据获取稳定性,改进错误提示
v1.2.0
新增创业板数据,修复合计计算逻辑(创业板已包含在深市中,合计不重复计算)
v1.1.0
新增创业板数据;修复合计计算逻辑,剔除创业板重复计算
v1.0.0
首次发布:获取中国A股三市成交金额、增缩量及比例报告
元数据
Slug cn-stock-volume
版本 3.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 13
常见问题

Cn Stock Volume 是什么?

获取中国股市四市(沪市、深市、创业板、北交所)指定日期的成交金额、增缩量及比例,并输出四市合计总结。支持查询三市(沪市/深市/北交所)上涨/下跌家数。**首选 Browser 方案**(东方财富网网页版),备用 API 方案(东方财富/新浪/腾讯)。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 140 次。

如何安装 Cn Stock Volume?

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

Cn Stock Volume 是免费的吗?

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

Cn Stock Volume 支持哪些平台?

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

谁开发了 Cn Stock Volume?

由 shinelp100(@shinelp100)开发并维护,当前版本 v3.1.0。

💬 留言讨论