Comprehensive portfolio management, stock analysis, and notification skill for Trading212 users.
Resources
21Install
npx skillscat add fabiopacifici-bot/open-agentic-investor Install via the SkillsCat registry.
Open-Agentic-Investor Skill
๐ /investor โ Main Entry Point
Triggers: /investor, /portfolio, /open_agentic_investor
When any of these commands arrive, immediately:
Run a live snapshot:
cd /home/pacificDev/.openclaw/workspace/repositories/open-agentic-investor python -m scripts.snapshotPull the latest data from SQLite and format a summary (see Live Summary Format below).
Send the summary + inline buttons via the
messagetool:
๐ *Portfolio โ <HH:MM CET>*
๐ฐ Total: โฌX,XXX.XX | P&L: โฌยฑXXX (ยฑX.XX%)
๐ต Cash: โฌXXX | Invested: โฌX,XXX
_Tap a button below:_Buttons (2 rows):
[
[
{"text": "๐ Full Report", "callback_data": "investor_report"},
{"text": "โก Live Summary", "callback_data": "investor_live"}
],
[
{"text": "๐ 15m Alerts", "callback_data": "investor_freq_15"},
{"text": "๐ Pause Alerts", "callback_data": "investor_freq_off"}
],
[
{"text": "๐ Top Movers", "callback_data": "investor_movers"},
{"text": "๐ฆ BUY/SELL Signals","callback_data": "investor_signals"}
]
]Callback Handlers
callback_data |
Action |
|---|---|
investor_report |
Snapshot โ export HTML โ send_report_file() to Telegram |
investor_live |
Snapshot โ send full text summary (all positions, P&L, signals) |
investor_movers |
Sort positions by pnl_pct, show top 3 gainers + top 3 losers |
investor_signals |
Show all BUY/SELL recommendations from latest snapshot |
investor_freq_15 |
Reply: "โ Alerts every 15 minutes" |
investor_freq_off |
Reply: "๐ Alerts paused" |
Live Summary Format
๐ *Portfolio Summary โ 17:00 CET*
๐ฐ Total: โฌ3,380 | P&L: -โฌ767 (-19.27%)
๐ต Cash: โฌ5 | Invested: โฌ3,981
๐ *Top movers:*
๐ข EBAY +0.34% | ๐ด SOUN -16.35% | ๐ด TEAM -18.23%
๐ฆ *Signals:* 2 BUY ยท 0 SELLOverview
Full Trading212 portfolio management: live snapshots, P&L tracking, BUY/SELL signals, HTML reports, and Telegram alerts.
Repo: repositories/open-agentic-investor
DB: ~/Documents/Investments/portfolio.db
Monitor: scripts/investor_monitor.py (background, PID tracked in logs)
Prerequisites
- Python 3.8+ with venv activated
.envin repo root withAPI_KEY,API_BASE_URL- OpenClaw CLI for Telegram delivery (no separate bot token needed)
Dashboard & Reports
Data Directory
All data files (SQLite, HTML exports) are stored at ~/Documents/Investments/ โ never in the repo.
Snapshot Only
cd repositories/open-agentic-investor
python -m scripts.snapshotExport HTML Report
python -m scripts.report_exportStart Web Dashboard
python -m dashboard.app
# Open http://localhost:5001SQLite Schema
snapshotsโ timestamp, total_value, cash, invested, pnl, pnl_pctpositionsโ ticker, quantity, current_price, market_value, pnl, pnl_pctrecommendationsโ ticker, action, reason, current_price
Background Monitor
The investor_monitor.py script runs continuously:
- Off-hours: checks every 30 min
- Market hours (15:30โ22:00 CET): checks every 15 min
- Alerts fire on: BUY/SELL signals, ยฑ3% portfolio move, ยฑ5% position move
- Full summary sent every 30 min during market hours
Start monitor:
cd repositories/open-agentic-investor
python scripts/investor_monitor.py >> logs/monitor.log 2>&1 &Check if running:
pgrep -fa investor_monitor
tail -20 repositories/open-agentic-investor/logs/monitor.log๐ Sub-Agent Health Check
To ensure all sub-agents are working properly during your exam period:
Monitor Status
# Check if investor monitor is running
pgrep -fa investor_monitor
# Check recent snapshots
sqlite3 ~/Documents/Investments/portfolio.db "SELECT timestamp FROM snapshots ORDER BY id DESC LIMIT 3"
# Check for errors in logs
tail -n 50 repositories/open-agentic-investor/logs/monitor.logAutomated Health Check Script
#!/bin/bash
# health_check.sh - Run from repositories/open-agentic-investor/
echo "=== Investor Health Check ==="
# Check monitor status
if pgrep -f investor_monitor > /dev/null; then
echo "โ
Investor monitor: RUNNING"
else
echo "โ Investor monitor: STOPPED - restarting..."
python scripts/investor_monitor.py >> logs/monitor.log 2>&1 &
fi
# Check recent snapshot
last_snap=$(sqlite3 ~/Documents/Investments/portfolio.db "SELECT timestamp FROM snapshots ORDER BY id DESC LIMIT 1")
if [[ -n "$last_snap" ]]; then
echo "โ
Last snapshot: $last_snap"
else
echo "โ No snapshots found"
fi
# Check for errors
error_count=$(grep -i "error\|exception" logs/monitor.log | wc -l)
if [[ $error_count -gt 0 ]]; then
echo "โ ๏ธ Found $error_count potential errors in logs"
else
echo "โ
No errors detected in logs"
fi
echo "=== Health Check Complete ==="Emergency Restart
If the monitor stops during your exam period:
# Kill any existing processes
pkill -f investor_monitor
# Restart with higher priority
cd repositories/open-agentic-investor && nohup python scripts/investor_monitor.py >> logs/monitor.log 2>&1 &Auto-Resume on System Restart
Add to your crontab:
# Restart investor monitor if not running (checks every 5 minutes)
*/5 * * * * pgrep -f investor_monitor || cd /home/pacificDev/.openclaw/workspace/repositories/open-agentic-investor && nohup python scripts/investor_monitor.py >> logs/monitor.log 2>&1 &