Professional risk managers monitor dozens of metrics across their portfolios every day. Most individual investors check their brokerage app and hope for the best. This series closes that gap โ€” five automation pipelines that give you institutional-quality portfolio intelligence using mostly free data sources. Daily P&L, volatility alerts, correlation drift, VaR, Sharpe ratio, and rebalancing triggers โ€” all automated, all running while you're not watching.

Data Sources

Source What it provides Cost
yfinance Daily and historical price data Free
FRED API Risk-free rate for Sharpe ratio Free
Alpaca Markets Real-time quotes, paper trading Free tier
Alpha Vantage Historical OHLCV backup Free (25 req/day)
positions.yaml Your portfolio configuration Free โ€” you maintain it

What You'll Build

๐Ÿ“Š Part 1: Portfolio Tracker

Load positions from a YAML file. Fetch daily prices. Calculate P&L, cost basis, unrealized gains, and daily moves. Get automated end-of-day briefs.

๐Ÿ“‰ Part 2: Volatility & Drawdown

Rolling volatility (20-day and 60-day). Current and max drawdown. VIX as a macro risk gauge. Know when your portfolio is under stress.

๐Ÿ”— Part 3: Correlation & Concentration

Correlation matrix between positions. Sector concentration via HHI score. Portfolio beta vs SPY. Identify hidden concentration and correlation drift.

๐Ÿงฎ Part 4: Risk Metrics Dashboard

Historical and parametric Value-at-Risk (95% and 99% confidence). Sharpe ratio and Sortino ratio using FRED's risk-free rate. Portfolio beta.

โš–๏ธ Part 5: Rebalancing & Alerts

Drift detection when allocations exceed target by threshold. Stop-loss monitoring. Tax-loss harvesting candidates with wash-sale warnings.

โ„น๏ธ Not financial advice. Risk metrics are mathematical models, not predictions. Past volatility does not predict future returns. Always consult a qualified financial advisor.

Honest Framing

These are mathematical models. VaR does not predict losses โ€” it estimates probability distributions based on historical data. Sharpe ratio is backward-looking. Correlation breaks down in crises. Use these as systematic inputs to your process, not as certainties. When markets move beyond historical patterns, these metrics can be dangerously misleading.

Frequently Asked Questions

Series FAQs

Do I need a brokerage API?
No. You maintain a positions YAML file manually. Analytics run on public price data from yfinance.
Is yfinance reliable for production?
It's an unofficial Yahoo Finance wrapper. Reliable for daily monitoring but can have outages. Alpha Vantage or Alpaca are more stable alternatives.
Can I track options positions?
This series covers equity positions. Options require greeks data โ€” see the Options Trading series.
How often should I run these monitors?
P&L and drawdown daily. Correlation and VaR weekly. Rebalancing weekly or on >5% moves.