Astock Top Gainers

v1.2.2

获取 A 股近 N 日涨幅排名前 N 只股票(排除 ST 股),输出格式化表格。当用户询问"近 N 日涨幅排行"、"A 股涨幅排名"、"涨幅最大的股票"、"哪些股票涨得最多"、"最近涨得好的股票"时使用此技能。数据来源为同花顺问财。

0· 211·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for shinelp100/astock-top-gainers.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Astock Top Gainers" (shinelp100/astock-top-gainers) from ClawHub.
Skill page: https://clawhub.ai/shinelp100/astock-top-gainers
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install astock-top-gainers

ClawHub CLI

Package manager switcher

npx clawhub@latest install astock-top-gainers
Security Scan
VirusTotalVirusTotal
Pending
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description claim: fetch A‑share top N gainers (exclude ST) from 同花顺问财 (iwencai). SKILL.md only uses the agent's browser tool to navigate, snapshot, parse, filter and format results — all coherent and proportional to the stated purpose. No unrelated credentials, binaries, or installs are requested.
Instruction Scope
Instructions remain within the task (navigate to iwencai, snapshot page, parse table, filter ST, format output). Two practical concerns: (1) ST detection is implemented as simple substring checks (e.g., contains 'ST' or '*ST') which can produce false positives/negatives depending on naming/encoding; (2) HTML/JS structure on iwencai may change, so parsing may be brittle. The skill does not direct data to external endpoints beyond the target site.
Install Mechanism
Instruction-only skill with no install spec or downloads; nothing is written to disk by the skill package itself. Low installation risk.
Credentials
No environment variables, credentials, or config paths are requested. The skill relies only on the platform-provided browser tool and public website access, which is proportionate to its function.
Persistence & Privilege
always is false and the skill does not request persistent/system-wide changes. It does instruct browser actions (normal for a web-scraping skill) but does not modify other skills or agent configuration.
Assessment
This skill appears coherent and low-risk: it's instruction-only and uses the agent's browser tool to scrape iwencai for top gainers and filter out ST stocks. Before relying on results: (1) verify output on a few sample queries—parsing can break if the site layout changes; (2) be aware the ST filtering is a simple substring check and may misclassify some tickers/names; (3) consider site terms of service and rate limits for automated requests; (4) do not treat output as financial advice—use it as informational only. If you plan to run it often, confirm the platform's browser tooling is trusted and that scraping iwencai is acceptable under its policies.

Like a lobster shell, security has layers — review code before you run it.

latestvk972kd4hz5k4kbvbkhwza18pn983av36
211downloads
0stars
6versions
Updated 1mo ago
v1.2.2
MIT-0

A 股涨幅排行 Skill

功能

获取 A 股市场近 N 日涨幅排名前列的股票数据,完全排除 ST 股票,输出格式化表格。

使用场景

用户询问以下类型问题时触发:

  • "近 N 日涨幅排行"(N 可为 3、5、10、20、30 等)
  • "A 股涨幅排名"
  • "涨幅最大的股票"
  • "哪些股票涨得最多"
  • "最近涨得好的股票"
  • "近一周/一月涨幅排行"

工作流程

步骤 1:解析用户需求

从用户问题中提取参数:

  • N(天数):默认 10 日,用户可指定
  • 数量:默认展示前 20 只,用户可指定

重要: 用户要求的数量是指最终输出的非 ST 股票数量,因此需要从页面获取更多数据(约 1.5-2 倍),以确保过滤 ST 后仍能满足用户要求的数量。

步骤 2:访问数据源

由于 SSRF 策略限制,需要使用以下方法访问同花顺问财:

方法一(推荐):通过 JavaScript 导航

  1. 使用 browser 工具的 start action 启动浏览器
  2. 使用 tabs action 获取空白标签页的 targetId
  3. 使用 act + evaluate 通过 JavaScript 导航:
    window.location.href = 'https://www.iwencai.com/unifiedwap/result?w=近{N}日涨幅排名&querytype=stock';
    
  4. 等待页面加载后使用 snapshot 获取数据

目标 URL 格式:

https://www.iwencai.com/unifiedwap/result?w=近{N}日涨幅排名&querytype=stock

例如:

  • 近 10 日涨幅:https://www.iwencai.com/unifiedwap/result?w=近10日涨幅排名&querytype=stock
  • 近 5 日涨幅:https://www.iwencai.com/unifiedwap/result?w=近5日涨幅排名&querytype=stock
  • 近 20 日涨幅:https://www.iwencai.com/unifiedwap/result?w=近20日涨幅排名&querytype=stock

步骤 3:获取页面数据

使用 browser 工具的 snapshot action 获取页面内容。

页面数据结构: 页面返回的表格包含以下列:

  • 排名(序号)
  • 股票代码
  • 股票名称
  • 现价(元)
  • 当日涨跌幅(%)
  • 区间涨跌幅排名(如 1/850)
  • 区间涨跌幅(%)

步骤 4:解析并过滤数据(核心步骤)

从页面快照中提取股票数据,必须完全排除所有 ST 股票

ST 股票识别规则(需完全过滤)

股票名称包含以下任一关键词的,必须排除

关键词说明
ST特别处理股票(如 ST京蓝)
*ST退市风险警示股票(如 *ST景峰)
S*ST未完成股改的退市风险警示股票
SST未完成股改的特别处理股票

过滤逻辑

1. 从页面获取前 N*2 条数据(确保足够数据用于过滤)
2. 遍历每条数据,检查股票名称
3. 如果名称包含 "ST" 或 "*ST",跳过该条记录
4. 保留非 ST 股票,直到达到用户要求的数量
5. 输出时重新编号排名(1, 2, 3...)

代码示例(逻辑参考)

# 伪代码示例
def filter_st_stocks(stocks, required_count):
    result = []
    for stock in stocks:
        name = stock['name']
        # 检查是否为 ST 股票
        if 'ST' in name or '*ST' in name:
            continue  # 跳过 ST 股票
        result.append(stock)
        if len(result) >= required_count:
            break
    return result

步骤 5:格式化输出

按照标准格式输出结果,输出数量 = 实际展示的非 ST 股票数量

输出格式

## 📈 A 股近 N 日涨幅排名(前 X 只,已排除 ST 股)

**统计区间:YYYY.MM.DD - YYYY.MM.DD**

| 排名 | 代码 | 名称 | 现价(元) | 当日涨跌(%) | 区间涨幅排名 | 区间涨幅(%) |
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| 1 | 920028 | 新恒泰 | 22.70 | +141.49 | 1/1128 | +141.49 |
| 2 | 000890 | 法尔胜 | 13.13 | -6.21 | 2/1128 | +139.60 |
| ... | ... | ... | ... | ... | ... | ... |

---

**数据来源:** 同花顺问财 (iwencai.com)  
**查询时间:** YYYY-MM-DD HH:MM GMT+8  
**总选出:** XXX 只股票(近N日涨跌幅大于0)

> ⚠️ **风险提示:** ST 股票已从排名中完全排除。部分股票当日涨幅异常,请谨慎关注。

示例对话

用户: 近 20 日涨幅排行前 20

AI 执行步骤:

  1. 解析参数:N=20,数量=20
  2. 启动浏览器:browser action=start
  3. 获取标签页:browser action=tabs → 获取 targetId
  4. JavaScript 导航:browser action=act kind=evaluate fn="() => { window.location.href = 'https://www.iwencai.com/unifiedwap/result?w=近20日涨幅排名&querytype=stock'; }"
  5. 获取快照:browser action=snapshot
  6. 解析数据:提取表格(获取约 40-50 条以备过滤)
  7. 过滤 ST 股票:排除名称含 ST、*ST 的股票
  8. 重新编号排名,保留前 20 只非 ST 股票
  9. 输出格式化结果

注意事项

必须遵守

  1. ST 股票完全排除:这是必须步骤,ST 股票风险较高,绝对不能出现在最终结果中
  2. 输出数量准确:如果用户要求前 20 只,输出必须正好是 20 只非 ST 股票
  3. 排名重新编号:过滤 ST 后,排名需要重新从 1 开始编号
  4. 区间涨幅排名保留原值:如 "1/1128" 保持不变,这是原始排名

其他注意

  1. SSRF 策略:直接使用 browser action=open/navigate 会被 SSRF 策略阻止,必须使用 JavaScript evaluate 方式导航
  2. 页面加载:确保页面完全加载后再获取 snapshot
  3. 数据时效:数据为实时/准实时数据,取决于同花顺问财的更新频率
  4. 区间统计:页面会显示具体统计区间(如 2026.02.13-2026.03.20),需要在输出中注明
  5. 异常涨幅:当日涨幅异常的股票(如 +100% 以上)应在风险提示中提醒

数据字段说明

字段说明
排名过滤 ST 后重新编号的排名
代码6 位股票代码(北交所为 6 位数字)
名称股票简称(不含 ST 股票)
现价当前股价(元)
当日涨跌今日涨跌幅(%)
区间涨幅排名原始排名(如 "1/1128",不重新编号)
区间涨幅N 日累计涨跌幅(%)

错误处理

如果遇到以下情况:

  • 浏览器启动失败:提示用户检查浏览器是否可用
  • 页面加载超时:重试或提示用户稍后再试
  • 数据解析失败:检查页面结构是否变化,或使用 screenshot 辅助分析
  • ST 股票过多导致数量不足:说明情况,获取更多数据进行过滤

更新日志

v1.2.0 (2026-03-21)

  • 明确 ST 股票完全排除规则
  • 输出数量以非 ST 股票为准
  • 过滤后排名重新编号
  • 增加获取更多数据以备过滤的说明

Comments

Loading comments...