← 返回 Skills 市场
popwho

etf-finance

作者 popwho · GitHub ↗ · v1.1.0
cross-platform ⚠ suspicious
595
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install etf-finance
功能描述
ETF and fund portfolio manager with price alerts, profit/loss tracking, and position management. Track your ETF/fund holdings, calculate gains/losses, set pr...
使用说明 (SKILL.md)

ETF Finance Skill

A comprehensive ETF and fund portfolio management tool with real-time price tracking, profit/loss calculations, and price alert functionality.

功能概述

  • 持仓管理:添加、删除、查看 ETF/基金持仓
  • 盈亏计算:实时计算持仓盈亏和收益率
  • 价格提醒:设置目标价格,达到时自动提醒
  • 行情监控:实时获取 ETF/基金价格数据

使用方法

持仓管理

添加持仓

cd ~/.openclaw/workspace/skills/etf-investor
python3 scripts/add_position.py SPY 150.50 100 "S&P 500 ETF"

参数:代码 | 买入价 | 数量 | 名称

删除持仓

python3 scripts/remove_position.py SPY

查看持仓列表

python3 scripts/list_positions.py

查看持仓详情(含盈亏)

python3 scripts/portfolio_summary.py

价格提醒

设置价格提醒

python3 scripts/add_alert.py SPY 160.00 "price_up"
# 或
python3 scripts/add_alert.py SPY 140.00 "price_down"

查看所有提醒

python3 scripts/list_alerts.py

删除提醒

python3 scripts/remove_alert.py SPY

检查提醒状态

python3 scripts/check_alerts.py

行情查询

查询单个 ETF/基金价格

python3 scripts/get_price.py SPY

批量查询持仓价格

python3 scripts/update_prices.py

持仓数据格式

持仓存储在 ~/.clawdbot/etf_investor/positions.json:

[
  {
    "symbol": "SPY",
    "name": "S&P 500 ETF",
    "buy_price": 150.50,
    "quantity": 100,
    "buy_date": "2026-02-23",
    "current_price": 155.20,
    "last_updated": "2026-02-23T10:30:00Z"
  }
]

价格提醒数据格式

提醒存储在 ~/.clawdbot/etf_investor/alerts.json:

[
  {
    "symbol": "SPY",
    "target_price": 160.00,
    "condition": "price_up",
    "created_at": "2026-02-23T10:00:00Z",
    "triggered": false
  }
]

盈亏计算公式

  • 持仓市值: 当前价 × 数量
  • 成本: 买入价 × 数量
  • 盈亏金额: (当前价 - 买入价) × 数量
  • 盈亏比例: (当前价 - 买入价) / 买入价 × 100%

支持的代码格式

  • 美股 ETF: SPY, QQQ, VOO, VTI, IVV, IWM
  • 国际 ETF: EFA, VEA, VWO, VXUS
  • 行业 ETF: XLF, XLK, XLV, XLE, XLB
  • 基金: 使用 Yahoo Finance 支持的任何基金代码

安装与卸载

安装

cd ~/.openclaw/workspace/skills/etf-investor
bash scripts/install.sh

卸载

bash scripts/uninstall.sh

自动提醒

可以将 check_alerts.py 加入系统定时任务(如 cron)实现自动提醒:

# 每小时检查一次提醒
0 * * * * cd ~/.openclaw/workspace/skills/etf-investor && python3 scripts/check_alerts.py

注意事项

  • 数据来源:Yahoo Finance (免费,无 API Key)
  • 价格可能有 15 分钟延迟(美股)
  • 建议定期备份数据文件
  • 价格提醒仅在本地检查,不会推送通知

脚本说明

  • add_position.py - 添加持仓
  • remove_position.py - 删除持仓
  • list_positions.py - 列出所有持仓
  • portfolio_summary.py - 持仓摘要(含盈亏)
  • add_alert.py - 添加价格提醒
  • remove_alert.py - 删除价格提醒
  • list_alerts.py - 列出所有提醒
  • check_alerts.py - 检查提醒状态
  • get_price.py - 获取单个价格
  • update_prices.py - 批量更新价格
  • install.sh - 安装脚本
  • uninstall.sh - 卸载脚本
安全使用建议
This skill appears to do what it says: local portfolio tracking, alerts, and price lookups via Tencent Finance and Yahoo (yfinance). Before installing: 1) Review and optionally run the scripts in an isolated environment (or container) because install.sh will pip-install yfinance into your user Python environment. 2) Note a documentation mismatch: README mentions creating a virtualenv but install.sh does not — if you prefer isolation, create and activate a venv yourself before installing. 3) Be aware check_alerts.py is intended to be run periodically (cron) and prints alerts to stdout only (no push notifications). 4) There are minor functional bugs (e.g., check_alerts.py reuses load_alerts() for positions and README mentions an update_position script that is missing); these are implementation issues, not covert behavior. 5) If you store real trade or sensitive info, back up ~/.clawdbot/etf_investor and inspect file permissions. If you want higher assurance, run the install in a disposable account or virtual environment and review network traffic to confirm only expected finance endpoints are contacted.
功能分析
Type: OpenClaw Skill Name: etf-finance Version: 1.1.0 The skill is classified as suspicious primarily due to the potential for shell injection vulnerabilities arising from the OpenClaw agent's execution of commands specified in SKILL.md. User-controlled inputs (e.g., stock symbols, names) are directly embedded into `bash` commands, creating a risk if the agent does not sanitize these inputs before execution. Additionally, the `scripts/install.sh` uses `pip3 install --break-system-packages yfinance`, which is an aggressive flag that can modify system-wide Python installations, posing a risk to system integrity. While the skill's core functionality (finance tracking, network calls to Yahoo/Tencent Finance, local file storage, and cron-based alerts) appears legitimate, these risky execution and installation practices elevate its classification.
能力评估
Purpose & Capability
Name/description (ETF portfolio manager, alerts, P/L) match the included scripts: add/remove/list positions and alerts, price lookups (Yahoo + Tencent). No unrelated credentials, binaries, or services are requested.
Instruction Scope
SKILL.md directs the agent/user to run the included local Python scripts and optionally add a cron job to run check_alerts.py. All file reads/writes are confined to the stated data directory (~/.clawdbot/etf_investor). External network calls are only to expected price data sources (Tencent qt.gtimg.cn and Yahoo via yfinance).
Install Mechanism
There is no registry install spec, but an install.sh is included and documented. install.sh runs pip3 install --user yfinance (and a fallback), which pulls from PyPI; no arbitrary URL downloads or extracted archives. Minor inconsistency: README claims a Python virtualenv is created, but install.sh does not create one (it installs into user site-packages).
Credentials
The skill requests no environment variables or credentials. It stores data locally under ~/.clawdbot/etf_investor and modifies only its own files. The config.py attempts to add a venv site-packages path to sys.path if present — this is reasonable given optional venv use.
Persistence & Privilege
always is false and the skill does not request elevated privileges or modify other skills or system-wide config. It creates and deletes its own data directory during install/uninstall and makes its scripts executable.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install etf-finance
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /etf-finance 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
更新为腾讯财经API获取A股价格
v1.0.0
- Initial release of the etf-finance skill: a portfolio manager for ETFs and funds using Yahoo Finance data. - Track ETF and fund positions with real-time price updates and detailed profit/loss calculations. - Set price alerts and receive notifications when target prices are reached (local checks, no push notifications). - Manage positions and alerts with easy-to-use scripts; all data stored locally in JSON format. - Includes installation/uninstallation scripts and support for cron-based automatic alert checks.
元数据
Slug etf-finance
版本 1.1.0
许可证
累计安装 0
当前安装数 0
历史版本数 2
常见问题

etf-finance 是什么?

ETF and fund portfolio manager with price alerts, profit/loss tracking, and position management. Track your ETF/fund holdings, calculate gains/losses, set pr... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 595 次。

如何安装 etf-finance?

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

etf-finance 是免费的吗?

是的,etf-finance 完全免费(开源免费),可自由下载、安装和使用。

etf-finance 支持哪些平台?

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

谁开发了 etf-finance?

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

💬 留言讨论