I Built a Custom Portfolio Manager Gem — Here's What It Actually Does
I manage accounts across multiple brokerages. Keeping track of where things stand — allocation percentages, unrealized gains, rebalancing needs — requires more mental overhead than it should. I built a Portfolio Manager Gem to handle that overhead so I can focus on the actual decisions.
What makes this Gem different from my Investment Advisor Gem is the integration. This one connects directly to a Google Sheets spreadsheet where I track my actual holdings.
What Is a Portfolio Manager Gem?
It's a Gemini assistant configured to analyze your actual portfolio data, not hypothetical scenarios. Because Gemini can connect to Google Drive, this Gem reads my portfolio spreadsheet when I ask questions — so it's working with real numbers, not examples.
The Investment Advisor Gem helps me think. The Portfolio Manager Gem helps me track and act.
Why I Built This Gem
Three recurring tasks pushed me to build it:
- Calculating current allocation percentages across all accounts manually was tedious and error-prone
- Figuring out which positions were candidates for rebalancing required pulling data from multiple sources
- Understanding my actual exposure to any given sector meant cross-referencing positions across accounts
The Gem handles all three in a single question.
The Prompt I Use
Here's the core of my Gem's instructions:
You are my personal portfolio manager. You have access to my portfolio spreadsheet in Google Drive and can read current holdings, cost basis, and account allocations. When I ask portfolio questions: - Pull data from my spreadsheet to answer with actual numbers - Calculate allocation percentages, sector exposure, and unrealized gains/losses - Identify rebalancing candidates based on my target allocations - Flag positions that have drifted significantly from target weight My target: maintain diversified equity exposure across sectors, take action when any position exceeds 15% of total portfolio value.
The Google Drive integration is what makes this practical. Without it, I'd need to paste in all my data manually every time.
Real Examples — What I Actually Ask It
Some recent questions I've put to this Gem:
- "What's my current allocation by sector across all accounts?"
- "Which positions are above 15% of total portfolio value right now?"
- "If I add $5,000 to the tech sector today, what does my allocation look like?"
For the allocation question, it reads the spreadsheet, calculates current weights, and presents a clean breakdown by sector. That used to take me 20 minutes in a spreadsheet. It now takes 30 seconds.
Setting Up the Google Drive Integration
To connect your Gem to a spreadsheet:
- Create your portfolio spreadsheet in Google Sheets with columns for ticker, shares, cost basis, account name, and sector
- When creating your Gem, go to the "Connect apps" section and enable Google Drive
- In your Gem instructions, reference the spreadsheet by name or tell the Gem to look for it
- When you open a chat, the Gem will request access to the specific file it needs
The first time you use it, Gemini will ask for permission to access the file. After that, it reads automatically when you ask questions that require it.
What It's Good At (and Where It Falls Short)
Good at:
- Calculating portfolio allocations from real spreadsheet data
- Identifying rebalancing candidates based on your target weights
- Running "what if" scenarios on proposed additions
- Tracking sector exposure across multiple accounts in one place
Where it falls short:
- Real-time pricing requires enabling Google Search in the Gem settings
- It reads data but cannot modify your spreadsheet or execute trades
- Complex tax lot analysis is beyond what it handles reliably
Try It Yourself — Starter Prompt
If you want to build a similar Gem, here's a starting point:
You are my personal portfolio manager. You have access to my portfolio spreadsheet in Google Drive. When I ask about my holdings, read the spreadsheet to answer with actual numbers. Calculate allocations, identify imbalances, and flag positions that exceed my target weights. My target: [your allocation rules — max position size, sector limits, rebalancing triggers]
Set up your Google Sheets portfolio tracker first, then paste this into a new Gem at gemini.google.com with Drive integration enabled.
- Series Overview: Gems vs GPTs vs Claude Projects
- Previous: My Personal Investment Advisor Gem
- You are here: My Custom Portfolio Manager Gem
- Next: My Personal Developer Gem (coming soon)
Related Posts
- Gemini Gems vs. ChatGPT GPTs vs. Claude Projects — How these custom AI tools compare, including Google Drive integration
- How to Use Gemini in Gmail and Google Docs — The Google integration that makes this Gem more powerful than any alternative
- My Personal Investment Advisor Gem — The companion Gem for thinking through decisions, not just tracking them
Sources & Further Reading
- Google — Create and use Gems in Gemini — Official setup guide including Google Drive integration
- Google — Connect Gemini to your Google apps — How to enable Drive, Gmail, and Docs access for Gems
- Investopedia — Portfolio Rebalancing — Reference for the rebalancing strategy this Gem helps execute
Do you track your portfolio in a spreadsheet? Have you connected it to any AI tool? I'd like to hear what's working in the comments.
The part about connecting directly to Google Sheets is what really caught my attention — that's the piece that makes this actually useful rather than just another generic finance chatbot. I've been manually calculating allocation percentages in a spreadsheet for years and the idea of having an assistant that can just read that data directly sounds like a huge time saver. Curious how often you find yourself needing to update the sheet before running an analysis, or does it stay current enough on its own?
ReplyDelete