| name | portfolio-update |
| description | Fetches live prices for equities and forex for investment portfolio. |
| tools | ["Bash"] |
PORTFOLIO_FILE: Find the equities holdings file (search by name, then ask user):
- Look for files matching
*investment*portfolio* or *equity*portfolio*
- Search common directories: memory/, projects/, current dir
- If none found, prompt user for the path.
Portfolio Update
Refresh your equities holdings table in PORTFOLIO_FILE by fetching the latest Yahoo Finance prices for each ticker plus MYR/USD forex rate.
Workflow
- Check if PORTFOLIO_FILE exists and has a Holdings section with a markdown table
- Parse holdings: symbol, shares, cost basis USD/share from that table
- Batch fetch all tickers + forex in one call (fastest):
PYTHON=./.claude/skills/portfolio-update/equity-price-fetcher.py
python3 $PYTHON "XXX|YYY|ZZZ"
python3 $PYTHON --forex=USDMYR=X
- Calculate Live Value (USD), Live Value (RM), and Unrealized P/L for each holding
- Write back updated snapshot table to PORTFOLIO_FILE
First-Time Setup (portfolio.md missing)
If PORTFOLIO_FILE doesn't exist, create a template with your tickers:
| Symbol | Shares | Cost Price | Live Price | RM Cost Basis | Live Value (USD) | Live Value (RM)* | Unrealized |
|--------|--------|------------|------------|---------------|------------------|------------------|------------|
Fill in your tickers, shares, and cost prices. Then run the update skill to fetch live prices:
PYTHON=./.claude/skills/portfolio-update/equity-price-fetcher.py
python3 $PYTHON "XXX|YYY|ZZZ"
python3 $PYTHON --forex=USDMYR=X
Individual Price Check (no write-back)
PYTHON=./.claude/skills/portfolio-update/equity-price-fetcher.py
python3 $PYTHON XXX --period 5d
python3 $PYTHON YYY --period 6mo
python3 $PYTHON --forex=USDMYR=X
Portfolio.md Format
The holdings table in PORTFOLIO_FILE must be in this table format:
| Symbol | Shares | Cost Price | Live Price | RM Cost Basis | Live Value (USD) | Live Value (RM)* | Unrealized |
|---|
| XXX | 10 | $50.00 | $52.30 | RM 2,615 | $523 | RM 2,040 | RM +230 |
| YYY | 5 | $200.00 | $198.50 | RM 993 | $992.5 | RM 3,871 | RM -7.5 |
| ZZZ | 20 | $15.00 | $16.10 | RM 483 | $322 | RM 1,256 | RM +22 |
| Total | | | | RM 4,091 | $1,837.5 | RM 7,167 | RM +244.5 โ
|
The update script reads this table, fetches live prices for each symbol via the equity-price-fetcher.py in the skill directory, and rewrites the Holdings section with current values (price, RM value, unrealized P/L).