InTouch Hub · Blue Isle Software

Stock Portfolio Tracker (Sheets-logged)

Daily portfolio tracker. Reads holdings from a \"Portfolio\" Sheet, fetches current prices from Yahoo Finance, appends a row per ticker to a \"Prices\" history tab, appends a daily summary to a \"Summary\" tab, computes total value + P&L, and emails a digest to the owner. Persistent history vs ephemeral stock-price-report.

stockportfoliofinanceinvestingsheetsdailytrackeryahoo-finance

stock-portfolio-tracker

Daily portfolio tracker. Reads your stock holdings from a Google Sheet, fetches current prices from Yahoo Finance, appends a row per ticker to a Prices history tab, appends a daily summary to a Summary tab, computes total value and profit/loss, and emails a digest to the owner. Builds a searchable price history over time. Cross-platform — uses the python runtime InTouch auto-creates on every OS.

Use case

The existing stock-price-report workflow emails current prices once and forgets them. The upgrade: keep the data. With every run appending to a Prices Sheet, you build a year-over-year price history searchable inside Sheets (graph it, pivot it, export it). The Summary tab gives you a single row per day with total portfolio value and P&L, perfect for a line chart of net worth over time.

Holdings live in a Sheet you control. Add a row to buy, remove a row to sell, edit the cost basis. The next run picks up the change automatically.

Setup

  1. Credentials (Credentials view): - google-workspace — Google Workspace service-account JSON
  2. Runtime environment (Runtime Environments view): - python — auto-created by InTouch on every OS install
  3. Portfolio Sheet (one-time): - Create a new Sheet with three tabs:
    • Portfolio (3 cols): ticker | qty | cost_basis — your holdings; you maintain this
    • Prices (4 cols): date | ticker | price | currency — the workflow appends here; one row per ticker per run
    • Summary (5 cols): date | total_value | total_cost | profit_loss | pct_change — the workflow appends here; one row per run
    • Row 1 of each tab is the header.
    • Populate Portfolio with your tickers, share counts, and cost bases (e.g. AAPL | 100 | 180.50).
    • Copy the spreadsheet ID from the URL.
  4. Edit workflow.yaml — replace the two placeholders: - <<PORTFOLIO_SHEET_ID>> — spreadsheet ID - <<OWNER_PUBLISHER>> — your contact user name (for the digest)
  5. Schedule the workflow daily, 4:30 PM in your timezone (after US market close).

Pipeline

  1. trackruntimeenv (python). Reads Portfolio!A2:C, fetches each ticker's current price from Yahoo Finance (query1.finance.yahoo.com/v8/finance/chart/<SYM>), appends all Prices rows in one Sheets call, appends the daily summary to Summary, prints a formatted digest to stdout.
  2. notifymessage. Pipes {{track.stdout}} to your owner contact.

Sample digest

PORTFOLIO — 2026-05-10

  Total value:     $   142,587.20
  Total cost:      $   115,800.00
  Profit / loss:   $   +26,787.20   (+23.13%)

BY POSITION
  AAPL    qty=100      @ $   201.45   value=$    20,145.00   day +1.23%
  MSFT    qty=50       @ $   442.10   value=$    22,105.00   day +0.45%
  GOOGL   qty=30       @ $   178.92   value=$     5,367.60   day -0.81%
  NVDA    qty=80       @ $   892.30   value=$    71,384.00   day +2.14%
  ...

Customization

Differences from stock-price-report

stock-price-report stock-portfolio-tracker
Data persistence None — emails once and forgets Two history tabs (Prices, Summary) accumulate every day
Source of holdings YAML-embedded ticker list Portfolio tab in a Sheet (editable, no YAML changes)
P&L calculation None Total value, total cost, day-over-day change, % gain
Charting None Native Sheets charts on the Summary tab
Runtime cost Email send only Email send + N Sheets writes per day (negligible)

Verified

gog sheets get/append, Yahoo Finance v8 chart endpoint, and the variadic pipe-separated cell format for sheets append all verified against the bundled gog v0.19.0 (2026-06-01) for flag/command syntax (re-verify output shapes on first run) and the existing stock-price tool's Yahoo Finance pattern. Cross-platform Python runtime confirmed in Server.kt:265-266.

Source

See workflow.yaml.