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?
- Prepare the trade logCreate a sheet with consistent columns for every trade.
- Install the basicsInstall Python and add it to your PATH.
- Ask for the trackerHave the agent read the log and build the workbook and script.
- Refresh routinelyRun the quick refresh to update prices.
- 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
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)
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?
Can it pull trades automatically?
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.