Turn trade logs into a living Excel portfolio workbook

Claude Code can read a broker export, pull market data, and assemble a formula-driven Excel portfolio file.

Done with Claude Code· Intermediate

What they did
The user gave Claude Code the path to a trade export, plus the portfolio’s starting cash and launch date, and asked it to rely on spreadsheet formulas rather than fixed entries. Claude scanned the trades, used yfinance for prices and company details, and generated Python that assembled the workbook tabs. Afterward, the user checked that recalculations worked in Excel. Later prompts added broker imports, including Robinhood through robin_stocks, and a script for updating the file each day.
How it went
The workbook described in the guide included a main dashboard, holdings, an equity line, risk stats, and stress tests. It did not report any measured gains or losses. The process was not fully hands-off, because Claude could still hardcode values or misread instructions, which meant the user sometimes had to ask for corrections.
Tips
Keep the source export untouched and save the finished workbook under a new name. After the file is built, edit one quoted price and make sure the linked formulas respond. Claude Pro costs $20/month, and larger projects may run into usage limits on Max at $100.

Try it yourself with Claude Code

I have a broker export at [file path]. Use Python to read it and create a new Excel workbook called [filename].xlsx that tracks my portfolio with formulas rather than fixed numbers. Include current price data and company information from Yahoo Finance, and add sections for holdings, cost basis, current value, gain or loss, allocation, an equity curve, risk metrics, and stress tests. Use [starting capital] as the opening cash amount and [start date] as the first date in the history. Save the finished workbook as a separate file in this folder. Before you do anything that would connect to an account, submit information, send files, delete data, or make another irreversible change, pause and ask me to approve that step. When you’re done, explain how I can refresh the workbook and how to verify that the formulas update when a price changes.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.