← 返回 Skills 市场
投资组合监控
作者
sanduan003
· GitHub ↗
· v1.1.0
549
总下载
1
收藏
3
当前安装
2
版本数
在 OpenClaw 中安装
/install portfolio-monitor
功能描述
投资组合监控系统。管理股票、加密货币持仓,跟踪成本、盈亏,设置价格提醒,生成组合报告。支持港股、美股、加密货币。
使用说明 (SKILL.md)
投资组合监控
管理投资持仓,跟踪盈亏,生成分析报告。
快速开始
pip3 install yfinance --break-system-packages
python3 scripts/portfolio.py
配置持仓
编辑 memory/portfolio.json:
{
"holdings": [
{"symbol": "0700.HK", "name": "腾讯", "shares": 100, "cost": 500, "currency": "HKD"},
{"symbol": "AAPL", "name": "苹果", "shares": 10, "cost": 180, "currency": "USD"},
{"symbol": "BTC-USD", "name": "比特币", "shares": 0.5, "cost": 45000, "currency": "USD"}
]
}
功能
- ✅ 实时市价
- ✅ 持仓盈亏金额/比例
- ✅ 总组合盈亏
- ✅ 涨跌幅提醒(默认5%)
- ✅ 多币种支持
输出示例
💰 总资产: $92,475
💵 总成本: $79,300
📈 总盈亏: +$13,175 (+16.62%)
📈 苹果: +43.03% 🔔涨幅超5%
📉 以太坊: -20.69% 🔔跌幅超5%
提醒阈值
修改 memory/portfolio.json 中的 alert_threshold:
"settings": {"alert_threshold": 0.05}
风险提示
⚠️ 仅供记录参考,不构成投资建议。
安全使用建议
This skill appears to do what it says (fetch prices and calculate portfolio P/L), but review and adjust it before running. Key points: 1) The Python script uses a hard-coded path '/Users/apple/.openclaw/workspace/memory/...' while the README mentions editing 'memory/portfolio.json' — you should either create that exact directory structure or modify the script to use a configurable or relative path (e.g., based on HOME or command-line argument). 2) The script will perform network requests via yfinance (Yahoo Finance); ensure you are comfortable with that network access. 3) It writes a state file (portfolio_state.json) to the hard-coded workspace; confirm you want files written there. 4) Because the code swallows exceptions, errors may be hidden — run it interactively first and inspect outputs. If you lack trust in the origin (owner unknown), run it in an isolated environment (container/VM) or inspect/modify the script to remove the hard-coded path and add safer error handling before use.
功能分析
Type: OpenClaw Skill
Name: portfolio-monitor
Version: 1.1.0
The skill bundle is a legitimate investment portfolio monitor that uses the 'yfinance' library to fetch market data. The code in 'scripts/portfolio.py' performs standard financial calculations and saves the results to a state file. While it contains hardcoded absolute paths (e.g., '/Users/apple/.openclaw/workspace/memory/portfolio.json') which are poor practice and likely to cause functional errors on most systems, there is no evidence of malicious intent, data exfiltration, or unauthorized system access.
能力评估
Purpose & Capability
The script uses yfinance to fetch market data and computes P/L as advertised, so capability matches purpose. However the code hard-codes file paths under /Users/apple/.openclaw/workspace/memory/, while SKILL.md tells the user to edit memory/portfolio.json (relative path). The absolute, user-specific path (username 'apple') is unexpected and inconsistent with the documentation.
Instruction Scope
SKILL.md's runtime instructions are simple (pip install yfinance; edit memory/portfolio.json; run the script). The script, however, reads and writes from hard-coded absolute paths rather than the relative paths the docs show. It also swallows exceptions in price fetches and performs network calls via yfinance (expected for market data) — nothing else is exfiltrated, but the mismatch on where to edit/read files is a scope/instruction coherence issue.
Install Mechanism
No install spec in registry and no downloads in code. SKILL.md recommends 'pip3 install yfinance' — a normal, explainable dependency for this purpose. No high-risk installation behavior was found.
Credentials
The skill requests no credentials or environment variables (which is appropriate). However, it unconditionally reads from and writes to a hard-coded path under /Users/apple/.openclaw/workspace/memory/, which is user-specific and may not exist — this is disproportionate because a portable skill should accept a configurable or relative path rather than assuming a fixed user home.
Persistence & Privilege
The skill is not always-enabled and does not request elevated privileges. It writes state to the user's workspace (portfolio_state.json), which is expected for a monitoring utility and is within its own scope.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install portfolio-monitor - 安装完成后,直接呼叫该 Skill 的名称或使用
/portfolio-monitor触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
Version 1.1.0
- 新增 _meta.json 文件
- 优化配置路径,由 scripts/portfolio.json 改为 memory/portfolio.json
- 简化快速开始说明,并精简安装/启动命令
- 精简并更新配置与功能描述,突出核心特性
- 新增多币种、涨跌幅提醒配置和风险提示
- 输出示例更简明,去除冗余信息
v1.0.0
Initial release of portfolio-monitor:
- 管理多种投资持仓,支持港股、美股及加密货币
- 实时跟踪持仓成本和盈亏,支持盈亏金额及比例计算
- 支持价格提醒功能,可自定义涨跌幅阈值
- 自动生成投资组合报告,包含资产分布与风险分析
- JSON配置文件,便于自定义持仓和提醒
- 提供定时任务示例,方便自动监控
元数据
常见问题
投资组合监控 是什么?
投资组合监控系统。管理股票、加密货币持仓,跟踪成本、盈亏,设置价格提醒,生成组合报告。支持港股、美股、加密货币。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 549 次。
如何安装 投资组合监控?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install portfolio-monitor」即可一键安装,无需额外配置。
投资组合监控 是免费的吗?
是的,投资组合监控 完全免费(开源免费),可自由下载、安装和使用。
投资组合监控 支持哪些平台?
投资组合监控 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 投资组合监控?
由 sanduan003(@sanduan003)开发并维护,当前版本 v1.1.0。
推荐 Skills