CoLab

Personal Tool · In Production · 2026

Investment Assistant

A production dashboard for my multi-market portfolio — built for me, and for my agent.

Use
Personal · in production
Stack
Flask · SQLite · Alpine.js
Hosting
Railway
Data
Private · single user
One Pool · sample data

What It Does

One screen for six markets.

My holdings are scattered across US stocks, A-share ETFs, Hong Kong, mainland funds, the ASX and physical gold — in four currencies. This is the one place they all add up.

  1. Cross-market holdings + FX

    Six market types, four currencies (CNY · AUD · USD · HKD), converted via direct, inverted or cross-via-CNY FX rates — one total that actually means something.

  2. Ledger-driven day P&L

    The transactions ledger is the single source of trade entry: buys update weighted-average cost, sells accrue realized P&L, and day P&L stays correct even when I trade the same day — measured against my fill, not yesterday's close.

  3. P&L calendar

    A cron job computes each day's P&L 15 minutes after the US close and paints it green or red on a calendar — the shape of a month at a glance, with win/loss day counts.

  4. Buckets (资金池)

    Per-currency deposit and withdrawal logs track how much principal actually lives in each market — so returns are measured against real money in, not guesses.

  5. Multi-source quotes that degrade, not die

    Tencent qt for A-shares and HK in one batched call, yfinance for US/ASX/FX, akshare for fund NAVs and Shanghai gold. Every source is wrapped: a dead feed marks its rows 'no price' — it never breaks the refresh.

  6. An API my agent reads every morning

    Every weekday at 09:20 Beijing time — ten minutes before the A-share open — a scheduled Claude agent reads four API endpoints and writes me a pre-market briefing. The dashboard was designed to be consumed by an agent as well as a person.

Investment Assistant poster

Trade-Offs

Honest edges.

  1. Reads are open, writes are gated

    Every mutating route requires a bearer token; GETs stay public so the morning agent can read without credentials. A deliberate trade for a single-user tool — the next step would be a signed agent identity.

  2. I deleted my own equity curve

    An earlier version had a snapshot subsystem and an equity-curve chart. When I simplified the app, the chart ended up with zero callers — so I retired the whole subsystem instead of keeping dead weight. The calendar answers the real question: what kind of month was it.

  3. What I'd do next

    Runtime failover for HK quotes (Tencent → Yahoo is supported but not wired), and surfacing the two-clock model in the UI — the ET trading day vs Sydney display logic is the app's subtlest code and deserves to be visible.