← Back to Skills Marketplace
sanduan003

投资组合监控

by sanduan003 · GitHub ↗ · v1.1.0
cross-platform ⚠ suspicious
549
Downloads
1
Stars
3
Active Installs
2
Versions
Install in OpenClaw
/install portfolio-monitor
Description
投资组合监控系统。管理股票、加密货币持仓,跟踪成本、盈亏,设置价格提醒,生成组合报告。支持港股、美股、加密货币。
README (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}

风险提示

⚠️ 仅供记录参考,不构成投资建议。

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install portfolio-monitor
  3. After installation, invoke the skill by name or use /portfolio-monitor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.0
Version 1.1.0 - 新增 _meta.json 文件 - 优化配置路径,由 scripts/portfolio.json 改为 memory/portfolio.json - 简化快速开始说明,并精简安装/启动命令 - 精简并更新配置与功能描述,突出核心特性 - 新增多币种、涨跌幅提醒配置和风险提示 - 输出示例更简明,去除冗余信息
v1.0.0
Initial release of portfolio-monitor: - 管理多种投资持仓,支持港股、美股及加密货币 - 实时跟踪持仓成本和盈亏,支持盈亏金额及比例计算 - 支持价格提醒功能,可自定义涨跌幅阈值 - 自动生成投资组合报告,包含资产分布与风险分析 - JSON配置文件,便于自定义持仓和提醒 - 提供定时任务示例,方便自动监控
Metadata
Slug portfolio-monitor
Version 1.1.0
License
All-time Installs 3
Active Installs 3
Total Versions 2
Frequently Asked Questions

What is 投资组合监控?

投资组合监控系统。管理股票、加密货币持仓,跟踪成本、盈亏,设置价格提醒,生成组合报告。支持港股、美股、加密货币。 It is an AI Agent Skill for Claude Code / OpenClaw, with 549 downloads so far.

How do I install 投资组合监控?

Run "/install portfolio-monitor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 投资组合监控 free?

Yes, 投资组合监控 is completely free (open-source). You can download, install and use it at no cost.

Which platforms does 投资组合监控 support?

投资组合监控 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 投资组合监控?

It is built and maintained by sanduan003 (@sanduan003); the current version is v1.1.0.

💬 Comments