As someone who holds a mix of ETFs (VOO, QQQ, SMH), individual stocks, and a small crypto allocation, I got tired of manually checking whether my portfolio was drifting from target weights, guessing when to buy, and reading through endless news. So I built an automated system that does it all for me every morning — zero maintenance, completely free to run.
The Problem
Most retail investors (myself included) struggle with three things:
1. Allocation drift — You set a target (e.g. 20% VOO, 15% QQQ, 10% GLD) but over time, winners grow too large and losers shrink. You end up overweight on whatever ran up last.
2. Entry timing — Even if you know *what* to buy, knowing *when* is harder. Is the P/E reasonable? Is it near a 52-week low or high? Is it technically oversold?
3. Information overload — By the time you've checked prices, read news, and reviewed fundamentals across 15+ tickers, the morning is gone.
The Solution
Every morning at 8am, I receive an email and Telegram message with:
- Allocation gaps (which tickers are underweight vs my targets)
- AI-generated buy/hold/wait recommendations with confidence scores
- Suggested limit order prices based on technical support levels
- Value ratings (A-D) for individual stocks
- Bottom-fishing signals for crypto
- Relevant news headlines
It runs as a scheduled job on GitHub — no server, no dashboard, no subscription, $0/month.
What Data Feeds Into the AI
For every ticker in my portfolio, I pull real-time data from Yahoo Finance across three dimensions:
Valuation & Price Data
- Current price, trailing P/E, forward P/E
- Historical average P/E (computed from quarterly earnings history — not a hardcoded number)
- 52-week high/low position (0% = at yearly low, 100% = at yearly high)
- Dividend yield, beta
Technical Indicators (365-day lookback)
- 50-day and 200-day moving averages (and how far the current price is from each)
- RSI(14) — the classic overbought/oversold oscillator
- Momentum signal (bullish / bearish / neutral)
- Golden cross and death cross detection
- Recent 7-day and 30-day price lows (for identifying support levels)
- Volume change — 7-day average vs 30-day average, catching exhaustion or surges
Fundamental Data (individual stocks only)
- Return on Equity (ROE)
- Debt-to-Equity ratio
- Free Cash Flow / Operating Cash Flow ratio
- Profit margins, revenue growth, earnings growth (YoY)
- Analyst consensus price target and recommendation
News & Portfolio Context
- Top 3 news headlines per ticker
- Total portfolio value and current vs target allocation for each position
- Allocation gap in both percentage and dollar terms
- ETF overlap detection — if you hold AAPL directly AND through VOO/QQQ, the system automatically discounts the ETF's suggested buy amount to avoid double-counting
- Portfolio-wide beta and estimated annual dividend income
What the AI Actually Does
All of this gets structured into a single prompt and sent to Google Gemini 2.5 Flash. The model is instructed to act as a portfolio analyst with these specific rules:
1. Prioritize allocation need + good entry price together — A small gap with excellent valuation (low P/E, near 52w low, oversold RSI) should rank above a large gap at poor valuation (high P/E, near 52w high). This prevents the naive approach of always buying whatever has the biggest gap.
2. Rate every ticker: STRONG BUY, BUY, HOLD, or WAIT — with a 0-100 confidence score and a 1-2 sentence explanation citing actual numbers (not vague statements).
3. Suggest limit order prices based on the nearest technical support — 50-day moving average, recent 7d/30d low, or a round psychological number. No "just buy at market."
4. Value investing framework (stocks only): Rate A through D based on five criteria:
- ROE > 15% (strong profitability)
- Debt/Equity < 50% (conservative leverage)
- FCF/Operating CF > 80% (strong cash conversion)
- Positive earnings growth
- Price below analyst consensus target
An "A" rating (meeting 4-5 criteria) boosts the AI's confidence by ~10 points. A "D" reduces it.
5. Crypto bottom-fishing model (BTC/ETH only): Checks four indicators:
- RSI below 30 (oversold)
- Volume contraction > 20% (selling exhaustion)
- Price below 200-day moving average (deep value territory)
- Death cross present (potentially already priced in — contrarian signal)
If 2+ indicators align, it flags a potential bottom. If 3+ align, it considers upgrading to STRONG BUY with a DCA note.
6. News sentiment — The AI considers whether negative headlines represent a genuine risk or a contrarian buying opportunity.
The response comes back as structured JSON (not free text), so every recommendation has consistent, parseable fields that get formatted into a clean email and Telegram message.
What a Typical Morning Brief Looks Like
> STRONG BUY GLD (87%) — Trading at 48% of 52w range with +2.8% allocation gap. RSI at 42 with bullish momentum. Limit: $282 near 50-day MA support. *Suggested: $1,400*
> BUY SMH (72%) [B] — Forward P/E 18.2 below historical 22.1. Gap +3.1%. Near 30-day low support. *Suggested: $800*
> HOLD AAPL — Over target allocation by 4.2%. P/E above historical average. Wait for pullback.
> WAIT INTC — Earnings declining 15% YoY with rising debt. Value rating D. Wait for fundamental improvement.
Intraday Alerts (No Spam)
A few hours after the morning brief, the system re-runs the full analysis against updated prices. It compares results to the morning baseline, and only sends an alert if something actually changed — a ticker's confidence increased significantly, or it got upgraded from BUY to STRONG BUY. This catches mid-day dips that create better entry points without spamming you on flat days.
Why I Built This
I'm not selling anything — the project is open-source. I built it because:
- Discipline beats emotion — Having a system that objectively scores opportunities based on 15+ data points per ticker removes the "should I buy this dip?" anxiety. Most days, the answer is "do nothing" — and that's a valid, data-backed answer.
- Allocation awareness matters — Most people don't know how far their portfolio has drifted until they manually calculate it. Seeing a daily gap report keeps you honest.
- AI is a great research assistant, not a trading oracle — It doesn't replace your judgment. But it synthesizes valuation, technicals, fundamentals, news, and allocation data into a concise morning briefing faster than you could do manually. Think of it as a very diligent junior analyst.
- Free tools are powerful enough — Yahoo Finance data + Google Gemini free tier + GitHub Actions = a system that rivals paid portfolio services at zero cost.
The system doesn't auto-trade. It gives you information and conviction. Every morning I wake up to a briefing that would take me 2+ hours to compile manually. Most days I do nothing. But when valuation, technicals, allocation need, and AI confidence all align — I act.
Happy investing.
---
#MyInvestingStrategy #PortfolioManagement #USStocks #ETF #ValueInvesting #AIinFinance #TechnicalAnalysis #DividendInvesting #LongTermInvesting #BuyTheDip #StockAnalysis #CryptoTrading #RiskManagement #FinancialFreedom #SmartInvesting #OpenSource #GeminiAI #PassiveIncome #AssetAllocation #MarketAnalysis
Comments