← 返回 Skills 市场
95
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install iwencai-skill-etf
功能描述
同花顺智能选ETF skill。根据行情、跟踪指数基本面、规模、风格类型等条件筛选ETF。返回符合条件的相关ETF数据。当用户询问ETF筛选问题时,必须使用此技能。
使用说明 (SKILL.md)
问财选ETF 使用指南
技能概述
本技能提供ETF智能筛选能力,通过自然语言查询支持:
- 行情指标筛选(价格、涨跌幅、成交量、换手率等)
- 跟踪指数筛选(沪深300、中证500、上证50、创业板指等)
- 基本面筛选(估值、费率、跟踪误差等)
- 规模筛选(资产规模、份额变化等)
- 风格类型筛选(成长、价值、平衡等)
- 多条件组合筛选
核心处理流程
步骤 1: 接收用户 Query
接收用户的自然语言ETF筛选请求,分析用户意图。
步骤 2: Query 改写
将用户问句适当改写为标准的金融查询问句,保持原意不变:
改写规则:
- 保留用户核心意图(如:沪深300ETF、规模大于10亿等)
- 将口语化表达转为标准金融术语(如"给我选一个ETF" → "ETF有哪些")
- 适当简化过于复杂的复合条件
- 改写后需保持原意不变
思维链拆解(如果需要): 根据用户需求自行决定是否拆解思维链:
- 单次查询:如果用户问题可以直接用单个 query 回答,直接进入下一步
- 多次查询:如果用户问题涉及多个独立的问句,需要拆分为多个标准 query 分别调用接口。
步骤 3: API 调用
调用金融查询接口获取数据,支持分页参数:
# 使用 Python 标准库
import urllib.request
import json
import os
url = "https://openapi.iwencai.com/v1/query2data"
headers = {
"Authorization": f"Bearer {os.environ['IWENCAI_API_KEY']}",
"Content-Type": "application/json"
}
payload = {
"query": "改写后的查询语句",
"source": "test",
"page": "1",
"limit": "10",
"is_cache": "1",
"expand_index": "true"
}
data = json.dumps(payload).encode("utf-8")
request = urllib.request.Request(url, data=data, headers=headers, method="POST")
response = urllib.request.urlopen(request, timeout=30)
result = json.loads(response.read().decode("utf-8"))
datas = result.get("datas", [])
步骤 4: 空数据处理
如果 datas 为空或无数据,适当放宽或简化查询条件后重新请求(最多尝试2次):
- 首次重试:去掉过于苛刻的条件,保留核心筛选条件
- 二次重试:进一步放宽条件或使用更通用的表述
每次重试都算作一次改写,最终返回时需说明最终使用的查询问句。
步骤 5: 数据解析
解析返回的 datas 数组,提取相关指标:
for item in datas:
# 根据查询类型提取相应字段
步骤 6: 数据扩展决策
skill 需要自行决策当前数据是否足够回答用户问题:
- 如果数据完整:直接返回格式化后的结果
- 如果需要更多背景信息:可以调用其他金融工具或者搜索工具获取相关资讯
步骤 7: 回答用户
组织语言回答用户问题,确保:
- 结果清晰易懂
- 如果改写了问句,需特别说明最终使用的查询问句
- 必须强调数据来源于同花顺问财
接口地址
IWENCAI_API_URL
认证方式
- 请求头:
Authorization: Bearer {IWENCAI_API_KEY} - 环境变量:
IWENCAI_API_KEY
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| query | STRING | 是 | 用户问句 |
| source | STRING | 否 | 来源,默认值:test |
| page | STRING | 否 | 分页参数,默认值:1 |
| limit | STRING | 否 | 分页参数,默认值:10 |
| is_cache | STRING | 否 | 缓存参数,默认值:1 |
| expand_index | STRING | 否 | 是否展开指数,默认值:true |
响应参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| datas | ARRAY | 金融数据列表,对象数组 |
响应示例:
{
"datas": [
{"ETF代码": "510300.SH", "ETF简称": "华泰柏瑞沪深300ETF", "涨跌幅": 1.25},
{"ETF代码": "159919.SZ", "ETF简称": "嘉实沪深300ETF", "涨跌幅": 1.18}
]
}
CLI 使用方式
命令行参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
--query |
STRING | 是 | 直接传入查询字符串 |
--page |
STRING | 否 | 分页参数,默认值:1 |
--limit |
STRING | 否 | 每页条数,默认值:10 |
--is-cache |
STRING | 否 | 缓存参数,默认值:1 |
--api-key |
STRING | 否 | API密钥(默认从环境变量读取) |
使用示例
# 直接查询(默认分页10条)
python scripts/cli.py --query "沪深300ETF有哪些?"
# 指定分页参数
python scripts/cli.py --query "规模最大的ETF" --page "1" --limit "20"
# 指定API密钥
python scripts/cli.py --query "创业板ETF" --api-key "your-key"
数据来源标注
重要提示:
- 引用同花顺数据时,必须强调数据来源于同花顺问财
- 如果没有查询到数据,提示用户可以到同花顺问财 web端查询:https://www.iwencai.com/unifiedwap/chat
错误处理
- API调用失败:给出友好错误提示
- 无数据返回:引导用户访问同花顺问财(https://www.iwencai.com/unifiedwap/chat)
- 最多重试2次逐步放宽条件
代码结构
hithink-etf-selector/
├── SKILL.md # Skill 配置文件
├── references/
│ ├── api.md # API 接口文档
│ └── requirement.md # 构建要求文档
└── scripts/
└── cli.py # CLI 入口(单一脚本,内含API调用和数据处理)
安全使用建议
This skill appears to be a straightforward client for the 同花顺/问财 (iwencai) API, but exercise caution before installing or enabling it:
- Metadata mismatch: The skill's manifest declares no required environment variables, but the instructions and CLI code require IWENCAI_API_KEY (and refer to IWENCAI_API_URL). Do not provide your API key until you confirm the skill legitimately needs it.
- Verify the endpoint and owner: The CLI uses https://openapi.iwencai.com/v1/query2data. Confirm that this is the official endpoint and that you trust the unknown owner/publisher before supplying credentials.
- Review network behavior: The skill sends your full query text to the external service and may retry with relaxed queries up to 2 times. Avoid sending sensitive or private data in queries because it will be transmitted to an external API and may be logged.
- Confirm credential scope: Use an API key with limited scope/usage and monitor its usage. Prefer creating a dedicated key for this skill rather than reusing high-privilege credentials.
- Test locally first: Inspect and run the provided scripts locally in a safe environment (without exposing production secrets) to validate behavior and ensure IWENCAI_API_URL usage is as expected (the CLI hardcodes DEFAULT_API_URL and does not read an IWENCAI_API_URL env var despite mentioning it in docs).
Given the manifest/instructions inconsistency and unknown publisher, treat this skill as suspicious until you validate the above points.
功能分析
Type: OpenClaw Skill
Name: iwencai-skill-etf
Version: 1.0.0
The skill bundle is a legitimate tool for querying ETF data from the iWencai (Tonghuashun) API. The Python script `scripts/cli.py` and the instructions in `SKILL.md` use standard libraries to perform authorized API calls using a provided API key. There is no evidence of data exfiltration, malicious execution, or prompt injection.
能力评估
Purpose & Capability
The skill's stated purpose (ETF selection via 同花顺/问财) matches the included code and docs which call an iwencai API. Requiring an API key and making POST queries to an external financial API is coherent with the stated purpose.
Instruction Scope
The SKILL.md and scripts/cli.py instruct the agent to send user queries to an external API (openapi.iwencai.com) and to retry with relaxed queries up to 2 times. SKILL.md also allows calling 'other financial tools or search tools' at the agent's discretion (broad). Critically, the runtime instructions reference the environment variable IWENCAI_API_KEY (and mention IWENCAI_API_URL) while the skill metadata declared no required env vars — this mismatch means the agent may attempt network calls that require secrets not declared to the platform.
Install Mechanism
No install spec; there is a single CLI script using only Python standard library. No downloads or third-party packages are installed, which minimizes install-time risk.
Credentials
The code requires an API key (IWENCAI_API_KEY) for authentication and the docs mention IWENCAI_API_URL; however, the registry metadata lists no required env vars. Asking for an API key is proportionate to the task, but the omission from metadata is a mismatch and increases the chance a user would inadvertently supply credentials without realizing the skill needs them. The skill does not request unrelated credentials, but the missing declaration is a red flag.
Persistence & Privilege
always:false and no special persistence or system-wide configuration changes. The skill does not request elevated/always-on privileges in the manifest.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install iwencai-skill-etf - 安装完成后,直接呼叫该 Skill 的名称或使用
/iwencai-skill-etf触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
问财选ETF v1.0.0 发布
- 首次发布同花顺ETF智能筛选技能,支持多维度自然语言筛选ETF(包括行情、指数、基本面、规模、风格等)。
- 内置完整数据API调用流程,支持自动放宽筛选条件重试(最多2次)。
- 结果需注明数据来源于同花顺问财,未命中时引导用户使用官方Web端。
- 提供详细的CLI用法说明及错误处理机制。
- 文档详细描述技能原理、参数说明与目录结构,便于开发者快速上手。
元数据
常见问题
同花顺问财ETF选股 是什么?
同花顺智能选ETF skill。根据行情、跟踪指数基本面、规模、风格类型等条件筛选ETF。返回符合条件的相关ETF数据。当用户询问ETF筛选问题时,必须使用此技能。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 95 次。
如何安装 同花顺问财ETF选股?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install iwencai-skill-etf」即可一键安装,无需额外配置。
同花顺问财ETF选股 是免费的吗?
是的,同花顺问财ETF选股 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
同花顺问财ETF选股 支持哪些平台?
同花顺问财ETF选股 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 同花顺问财ETF选股?
由 bensema(@bensema)开发并维护,当前版本 v1.0.0。
推荐 Skills