Track Any Stock Portfolio With a Raspberry Pi No Paid APIs, Just Telegram

๐Ÿ“– Part 3 of 3
๐Ÿ“ˆ Any Market · Zero API Keys · March 2026

Track Any Stock Portfolio
With a Raspberry Pi
No Paid APIs, Just Telegram

A step-by-step guide to setting up OpenClaw on a Raspberry Pi 5 to track any stock portfolio — live P&L, dividend-adjusted returns, SMA signals, and twice-daily Telegram updates. Works with NYSE, LSE, TSX, and any Yahoo Finance supported market.

๐Ÿฅง Raspberry Pi 5 ๐Ÿ“ˆ Yahoo Finance ๐Ÿฆž OpenClaw ✈️ Telegram
Any
Stocks Tracked
Any Market
Yahoo Finance Supported
Capital
P&L Tracked
+Dividends
True Total Return
$0
API Cost
Audience: ๐ŸŸข Beginner Anyone can follow ๐ŸŸก Intermediate Basic Linux helpful ⚠️ Privacy Data stored locally on your Pi

Setting Up Portfolio Tracking

๐Ÿ“ฆ
The entire setup takes under 15 minutes and requires zero paid API keys. OpenClaw uses its built-in web tools to fetch prices from Yahoo Finance — any market, any exchange, any currency. ๐ŸŸข Beginner
โ„น️
Prerequisites

This is Part 3 of the series. You need OpenClaw running on HAOS with tools.profile: full set (covered in Part 2). The portfolio-watcher and memory skills must be installed.

Step 1 — Install the Skill
1
Search and evaluate options ๐ŸŸข Beginner
terminal
root@openclaw:/# npx clawhub search stock
stock-watcher       Stock Watcher  (3.592)
stock-daily-report  A่‚กๆฏๆ—ฅๆŠฅๅ‘Š  (3.490)  # Chinese market only — skip
portfolio-watcher   Portfolio Watcher  (3.575)

Two skills appear viable. stock-daily-report and stock-watcher are Chinese market focused. portfolio-watcher is the right choice — it's prompt-based and uses Claw's own web tools to fetch prices, which means it works with any Yahoo Finance symbol — US stocks, European equities, Asian markets, ETFs, and more.

2
Install portfolio-watcher
terminal
root@openclaw:/# npx clawhub --workdir /config/clawd install portfolio-watcher
✔ OK. Installed portfolio-watcher -> /config/clawd/skills/portfolio-watcher

Restart the add-on from HA → Apps → OpenClaw → Restart before proceeding.

3
Verify your symbols work

Before saving your full portfolio, do a quick test with two of your stocks. Send Claw on Telegram:

Telegram
What's the current price of AAPL (Apple) and SHEL (Shell)?
๐Ÿฆž
Claw
@YourClawBot
What's the current price of AAPL (Apple) and SHEL (Shell)?
Fresh fetch:

AAPL — Apple Inc.$189.50
SHEL — Shell PLC$31.20
10:14 AM

✅ Yahoo Finance symbols work perfectly — any market, any exchange, any currency.

Step 2 — Save Your Portfolio
4
Send holdings to Claw on Telegram ⚠️ Privacy

Send Claw a message listing each stock with ticker, shares, and average cost. Format:

Telegram — example format
Please save my stock portfolio to memory:

- Apple (AAPL) - 50 shares bought at $142.00
- Shell (SHEL) - 200 shares bought at $28.40
- Samsung (005930.KS) - 10 shares bought at ₩71,000
[... all holdings ...]

Save to memory/portfolio-saudi-stocks.json
⚠️
Your data stays on your Pi

The portfolio JSON is saved to /config/clawd/memory/portfolio-stocks.json on your local Pi. However, the actual data is sent to the Anthropic API when Claw processes your message. Don't share this conversation publicly.

5
Fix the MEMORY.md link

The memory skill uses two separate storage mechanisms. After saving your portfolio, manually link it in MEMORY.md so Claw finds it every session:

terminal
root@openclaw:/# cat >> /config/clawd/MEMORY.md << 'EOF'

## Portfolio
- Stock portfolio: ~/memory/portfolio-stocks.json

## Standing Instructions
- Add 2 second delay between each stock price fetch
- Never fetch all stocks simultaneously
- Always include dividend-adjusted total return
EOF
๐Ÿ’ก
Why the 2-second delay?

Yahoo Finance rate limits aggressive fetching. With 21 stocks fetched simultaneously you'll hit the limit within seconds. A 2-second delay between each fetch adds ~42 seconds to the total fetch time but makes it completely reliable.

Live Portfolio P&L — Capital Only

๐Ÿ“Š
The first real test — fetching live prices and calculating P&L against your cost basis. Sample portfolio below uses mixed global stocks with realistic fictional values. ๐Ÿ”ต All Levels
The Request
๐Ÿฆž
Claw
@YourClawBot
Give me a full portfolio performance update with current prices, value, and P&L for each stock
12:02 AM
Here's your full portfolio performance ๐Ÿ“Š

StockCostPriceP&L%
Shell (SHEL)$28.40$31.20+9.9% ๐ŸŸข
Samsung (005930.KS)₩71,000₩58,400-17.7% ๐Ÿ”ด
Apple (AAPL)$142.00$189.50+33.5% ๐ŸŸข
BP (BP.L)£4.82£3.96-17.8% ๐Ÿ”ด
LVMH (MC.PA)€680€592-12.9% ๐Ÿ”ด
Microsoft (MSFT)$298$415+39.3% ๐ŸŸข
Total Invested$42,800
Current Value$44,100
Capital P&L+3.0% ๐ŸŸข

๐Ÿ† Winners: Microsoft (+39.3%), Apple (+33.5%), Shell (+9.9%)
๐Ÿ’€ Biggest drags: BP (-17.8%), Samsung (-17.7%), LVMH (-12.9%)
12:03 AM
๐Ÿ’ก
But capital P&L alone is misleading

A stock down 25% looks terrible — until you realize it's been paying dividends for years. The capital-only view is the wrong lens for a dividend portfolio. Tab 3 shows what changes when dividends are included.

What Claw Does Behind the Scenes
๐Ÿ“–
Reads portfolio JSON

Loads your holdings from ~/memory/portfolio-saudi-stocks.json at session start.

๐ŸŒ
Fetches Yahoo Finance

Queries each ticker symbol with a 2-second delay between requests to avoid rate limiting.

๐Ÿงฎ
Calculates P&L

Multiplies shares × (current price − avg cost) per holding. Sums to portfolio total.

๐Ÿ†
Ranks & flags

Sorts by performance, identifies winners and losers, formats as a clean table.

The Dividend Revelation

๐Ÿ’ฐ
This is the analysis that changes how you see your portfolio. Adding cumulative dividends to the P&L calculation tells a completely different story. ๐Ÿ”ต All Levels
Save Dividends Then Request Full Analysis

After saving your portfolio, send Claw your total cumulative dividends received per stock, then request the combined analysis:

๐Ÿฆž
Claw
@YourClawBot
Now give me a full total return analysis including dividends — capital P&L + dividends per stock, total dividends received, true total return, best performers on total return basis, and which stocks are still underwater even after dividends
12:05 AM
Full dividend-adjusted analysis ๐Ÿ“Š

StockCap%DivsTotal%
Microsoft (MSFT)+39.3%$412+43.1% ๐ŸŸข
Apple (AAPL)+33.5%$186+35.8% ๐ŸŸข
Shell (SHEL)+9.9%$1,240+19.2% ๐ŸŸข
BP (BP.L)-17.8%$1,890+4.6% ๐ŸŸข
LVMH (MC.PA)-12.9%$680-7.4% ๐Ÿ”ด
Samsung (005930.KS)-17.7%$320-14.2% ๐Ÿ”ด

Total Invested$42,800
Current Value$44,100
Capital P&L+3.0% ๐ŸŸข
Total Dividends+$4,728
True Total Return+14.1% ๐ŸŸข

๐Ÿ’š Rescued by dividends: BP (-17.8% → +4.6% after $1,890 in dividends)

๐Ÿ”ด Still underwater after dividends: LVMH, Samsung
12:06 AM
๐Ÿ”
The insight that matters

BP looked like a clear loser at -17.8% capital loss — but $1,890 in dividends flipped it to +4.6% total return. Shell's dividend income nearly doubled its capital gain. This is the analysis most retail investors never do because calculating it manually for a multi-stock, multi-currency portfolio is genuinely tedious. Claw does it in one message.

Twice-Daily Automated Updates

The cron skill turns Claw from a reactive chatbot into a proactive portfolio monitor. Two automated Telegram messages per trading day — market open and pre-close. ๐ŸŸก Intermediate
The Cron Setup Message

Send this to Claw on Telegram. The key detail is "do not fetch prices now" — this prevents an immediate rate limit hit during setup:

Telegram — send to Claw
Set up two daily portfolio updates using cron.
Do not fetch any prices now — just save the schedule.

Schedule:
- 10:15 AM Riyadh time (GMT+3) every day
- 2:30 PM Riyadh time (GMT+3) every day

When each job runs:
1. Read portfolio from ~/memory/portfolio-saudi-stocks.json
2. Fetch prices with 2 second delay between each stock
3. Calculate value, capital P&L, dividend-adjusted total return
4. For stocks moving more than 3%: fetch SMA20, SMA50, SMA200
5. Send summary to Telegram
What the Daily Update Looks Like

On a quiet day with no big movers:

๐Ÿฆž
Claw
@YourClawBot · automated
๐Ÿ“Š Portfolio Update — 10:15 AM · March 6

๐Ÿ’ผ Current Value: $44,800
๐Ÿ“‰ True Total Return: +13.8% (capital + dividends)
๐Ÿ“ˆ Today's Move: +$180

21 stocks within normal range
10:15 AM · automated

On a volatile day with big movers — SMA context is automatically included:

๐Ÿฆž
Claw
@YourClawBot · automated
๐Ÿ“Š Portfolio Update — 2:30 PM · March 6

๐Ÿ’ผ Current Value: $43,900
๐Ÿ“‰ True Total Return: +12.2% (capital + dividends)
๐Ÿ“‰ Today's Move: -$900

๐Ÿšจ Big Movers (+/- 3%):
2:30 PM · automated
SMA Signal — Big Movers Only
BP (BP.L) -4.2%
↓ SMA20 ↓ SMA50 ↓ SMA200
๐Ÿ”ด Bearish
MSFT +3.8%
↑ SMA20 ↑ SMA50 ↑ SMA200
๐Ÿ’ช Strong
๐Ÿ’ก
Why SMA only on 3%+ movers?

Showing SMA for every stock every day creates noise you'll stop reading. A 3% move is significant enough to warrant context — is the stock breaking down through its SMA200 for the first time, or just a normal pullback? That distinction is actionable. Quiet days stay clean.

Lessons Learned

๐Ÿ““
Everything we hit during this specific setup — so you don't have to. ๐Ÿ”ต All Levels
Lesson 01

Any Yahoo Finance symbol works via Claw's web tools. No paid API key needed. US stocks (AAPL, MSFT), European equities (BP.L, MC.PA), Asian markets (005930.KS), ETFs — if Yahoo Finance covers it, Claw can fetch it.

Lesson 02

Fetching 21 stocks simultaneously hits Yahoo Finance rate limits immediately. The fix is a 2-second delay between fetches — add it as a standing instruction in MEMORY.md so it applies to every session including cron jobs. Adds ~42 seconds to fetch time but eliminates rate limit errors entirely.

Lesson 03

MEMORY.md must be created manually from the template. The memory skill installs but does not create /config/clawd/MEMORY.md automatically. Copy it from the template: cp /config/clawd/skills/memory/memory-template.md /config/clawd/MEMORY.md. Without this, every memory read fails silently.

Lesson 04

Portfolio JSON is saved to /config/clawd/memory/ not linked in MEMORY.md. Claw saves the file correctly but won't find it in future sessions unless you manually add a reference in MEMORY.md. One append command fixes this permanently.

Lesson 05

Claw automatically fetches prices when it sees ticker symbols. Even a simple "read my portfolio from memory" triggers price fetches if Claw sees ticker symbols in the data. Be explicit: "do not fetch prices — just read the file." This prevents unexpected rate limit hits.

Lesson 06

Capital P&L alone is the wrong lens for a dividend portfolio. Stocks that look like losers at -3% to -4% capital loss can be profitable once dividends are included. The dividend-adjusted analysis took 10 minutes to set up and changed the entire picture — half the apparent loss was recovered by dividends already received.

Lesson 07

The cron setup message must say "do not fetch prices now." Without this explicit instruction Claw immediately fetches all 21 prices when setting up the cron schedule, hitting the rate limit before the schedule is even saved. Always separate the schedule setup from the first run.

Lesson 08

SMA on all stocks every day is too much information. The right threshold is 3%+ movers only — significant enough to be actionable, rare enough to stay meaningful. On quiet days the update is 5 lines. On volatile days it shows exactly the context you need for the stocks that moved.

The Full Picture — All Three Parts
๐Ÿ 
Part 1 — Foundation

OpenClaw installed on HAOS, Telegram secured, skills set up, identity files configured.

๐Ÿ’ก
Part 2 — Smart Home

Home Assistant skill connected. Vacuum, AC, sensors, automations — all controlled via Telegram in plain English.

๐Ÿ“ˆ
Part 3 — Portfolio

Any stock portfolio tracked. Live P&L, dividend-adjusted returns, SMA signals, twice-daily automated updates.

๐Ÿฆž
Total cost of this setup

Hardware: ~$80 (Raspberry Pi 5). Anthropic API: ~$3–8/month depending on usage. Paid stock data APIs: $0. The intelligence is cloud, the execution is local, the data is yours.

Comments