投资组合监控

v1.1.0

投资组合监控系统。管理股票、加密货币持仓,跟踪成本、盈亏,设置价格提醒,生成组合报告。支持港股、美股、加密货币。

1· 555·3 current·3 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 sanduan003/portfolio-monitor.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "投资组合监控" (sanduan003/portfolio-monitor) from ClawHub.
Skill page: https://clawhub.ai/sanduan003/portfolio-monitor
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 portfolio-monitor

ClawHub CLI

Package manager switcher

npx clawhub@latest install portfolio-monitor
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Suspicious
medium confidence
!
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.
What to consider before installing
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.

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

latestvk97844x425wsjcby064jzarwmh82f3g6
555downloads
1stars
2versions
Updated 1mo ago
v1.1.0
MIT-0

投资组合监控

管理投资持仓,跟踪盈亏,生成分析报告。

快速开始

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}

风险提示

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

Comments

Loading comments...