← Back to library

Keep a holdings workbook current with one refresh command

Nick Nemeth shows non-coders how Claude Code turns a fixed-column trade log into a living portfolio tracker. It writes a Python script that pulls live prices, recalculates positions, and formats an Excel workbook you can refresh with one quick command anytime.

  • OutcomeKeep a formatted portfolio spreadsheet current with one command that loads new trades and fetches latest prices.
  • SetupAn afternoon+
  • LevelIntermediate
  • CreditNick Nemeth
View original
Works with
Claude CodeClaude

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 24, 2026

When should you use it?

  • Your broker's views are not enough
  • Templates break or need manual copy and paste
  • You want your data to stay local

Not for: Order placement; Anyone unwilling to install Python

What do you need, and what do you get?

You need

  • Trade log with ID, date, ticker, action, shares, price, fees and cash balance

You get

  • Excel tracker with positions and performance
  • Script with refresh and trade commands

How does it work, step by step?

  1. Prepare the trade logCreate a sheet with consistent columns for every trade.
  2. Install the basicsInstall Python and add it to your PATH.
  3. Ask for the trackerHave the agent read the log and build the workbook and script.
  4. Refresh routinelyRun the quick refresh to update prices.
  5. Extend by requestAsk for new sheets, such as best and worst performers, and iterate.

The prompt

The original prompt by Nick Nemeth, word for word, with a link to where it was published. Below it is our adapted version with fill-in blanks, if you want it. Works in Claude Code and Claude. Values in lime are placeholders.

Original prompt by Nick Nemeth

Word for wordby Nick Nemeth
I want you to build me a portfolio tracking spreadsheet. Here are my requirements:

**FILE LOCATIONS:**
- Input: [YOUR PATH]/My Portfolio.xlsx (contains Trade_Log sheet with my trades)
- Output: [YOUR PATH]/My Portfolio_BUILT.xlsx (create NEW file, do NOT overwrite my original)

**PORTFOLIO DETAILS:**
- Starting capital: $[YOUR AMOUNT] (e.g., $1,000,000)
- Start date: [YOUR DATE] (e.g., December 31, 2025)
- All initial positions bought at closing prices on the start date

**CRITICAL - FORMULA-BASED ARCHITECTURE:** The Python script should ONLY:
1. Read my Trade_Log
2. Fetch market data via yfinance (prices, volumes, company info)
3. Build the Excel structure with FORMULAS IMPORTANT: Use Excel FORMULAS for ALL calculations. Do NOT hardcode any calculated values. Every P&L, every percentage, every total should be a formula like =D2*F2, not a static number. The spreadsheet must update automatically when I change any price in Market_Data.

**SHEETS TO CREATE:** Data Lakes (Python fills these with raw data):
- Trade_Log: Copy of my trades
- Market_Data: Daily closing prices (rows = dates, columns = tickers)
- Reference_Data: Company name, sector, industry, country, beta for each ticker
- Daily_Units: Number of shares held per ticker per day (calculated from trades)
- Daily_Cash: Cash balance per day

Analytics Sheets (ALL FORMULAS - no hardcoded values):
- Dashboard: KPIs (NAV, Total Return, Sharpe Ratio, Max Drawdown), NAV chart, allocation pie chart
- Positions: Ticker, Company, Sector, Shares, Avg Cost, Current Price, Day Change %, Cost Basis, Market Value, Unrealized P&L, P&L %, Portfolio Weight
- Equity_Curve: Date, Cash, Invested Value, Total NAV, Daily Return, Cumulative Return, Drawdown
- Sector_Exposure: Sector breakdown with dollar amounts and weights
- Geographic_Exposure: Country breakdown with dollar amounts and weights

**STYLING:**
- Professional Bloomberg Terminal look
- Segoe UI font, 85% zoom, hide gridlines
- Dark navy headers (#1C2541) with white text
- Alternating row colors (zebra striping) for readability
- Green (#007A33) for positive values, Red (#B81D13) for negative
- Freeze the header row and first column on each sheet Please start by reading my Trade_Log file, then build the complete system.

Exactly as published by Nick Nemeth in Building an Institutional-Grade Portfolio Tracker with AI.

Our adapted version (optional)

Adapted prompt0 variables
Read the Trade_Log sheet in [file]. Write a Python script that calculates current positions, cost basis and realized and unrealized gains, fetches latest prices from a free source and writes a formatted workbook with a summary sheet and one sheet per holding. Add a quick mode that only refreshes prices and a command to append a trade. Explain how to run each, and never connect to my brokerage.

What can go wrong?

  • Close the workbook before running the script, or it cannot save.
  • Free price feeds can lag or fail; check unusual moves.

Our take

A friendly on-ramp for non-coders, including troubleshooting most guides skip, like Python not being on the PATH. Building a script rather than a one-off chat answer means you can rerun it. The key is the fixed-column trade log: once every trade is recorded the same way, the agent can write a script that rebuilds the workbook from it each time. Nick's guide also covers the setup snags non-coders hit, such as Python not being on the PATH, which is often where people give up. Close the workbook before running the refresh, or the script cannot save. Free price feeds lag or fail, so check unusual moves against your broker before acting. Extending the tracker by request, such as adding best and worst performers, works well once the basics run. Keep the data local and the script in a folder you back up. It should never place orders; it is a view of your positions, not a trading tool.

Where the time goes back: Updating prices and positions by hand each week is replaced by one command.

FAQ

Do I write code?
No; the agent writes and runs the Python.
Can it pull trades automatically?
The author describes broker APIs as an option, but a manual log works.

Source and credit

The original prompt on this page is by Nick Nemeth, shown word for word with a link to where it was published. The summary, notes and adapted version are ours.

Original
Building an Institutional-Grade Portfolio Tracker with AI
Creator
Nick Nemeth
Published on
mispricedassets.substack.com (Substack)
Original date
Jan 25, 2026
License
Not openly licensed; the original prompt is shown word for word with credit and a link to the original
Originally for
Claude Code
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 24, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Money & Admin

All 82 Money & Admin playbooks →

Related playbooks

Money & AdminWorkflow✓ AI dry run

Match apartment defects to the housing code before filing

A documented list of your apartment's problems, each tied to the code section it breaks and the building's public violation history, ready for complaints you file yourself.

Credit: Argona0x (@Argona0x)

An afternoon+
Money & AdminWorkflow✓ AI dry run

Prepare your side of a tax dispute with three Claude tools

Understand an IRS case from the court portal, check your records against the credit's rules, and send the agency's lawyer a settlement letter backed by one merged evidence file.

Credit: Thetangstr

Under an hour
Money & AdminWorkflow✓ AI dry run

Research a purchase down to delivered price and codes

Have agents compare a product across shops with real shipping, tested coupon codes, price history and owner reviews before you buy.

Credit: u/zawaer on r/SideProject

An afternoon+