A quadratic portfolio optimization project built in Python for a simulated retail bank's portfolio pricing department, developed to minimize daily risk while meeting a target return. The full business write-up is available in Portfolio_Report.pdf.
This project uses Gurobi optimization and an efficient frontier analysis to determine stock allocations across five equities (AAPL, AVGO, GOOG, META, NVDA) using 2025 daily closing prices from Yahoo Finance. Two analyses are presented: a constrained optimization that minimizes risk for a specific return target (≥ 0.18% daily), and an efficient frontier that surfaces alternative portfolios across the full risk-return spectrum for varying risk appetites.
- Data — Daily adjusted closing prices pulled via
yfinancefor Jan–Dec 2025; percent daily returns and a covariance matrix computed for portfolio risk modeling - Constrained optimization — Gurobi quadratic model minimizing portfolio variance subject to a budget constraint (weights sum to 1) and a fixed minimum daily return constraint (≥ 0.18%); produces the lowest-risk portfolio that meets the target return
- Efficient frontier — Parametric sweep across return targets to trace the full risk-return frontier; three key portfolios identified to illustrate options for low, balanced, and high risk appetites
Minimizes daily risk subject to a ≥ 0.18% daily return requirement
| Stock | Allocation |
|---|---|
| GOOG | 69.10% |
| AAPL | 19.66% |
| META | 8.77% |
| AVGO | 2.47% |
| NVDA | 0.00% |
Explores the full risk-return trade-off — no fixed return target
| Portfolio | Daily Risk | Daily Return |
|---|---|---|
| Low Risk (Min Variance) | 1.7% | 0.14% |
| Max Sharpe Ratio | 2.0% | 0.22% |
| High Risk (Max Return) | 3.4% | 0.23% |
stock-portfolio-optimization/
├── Optimization_Code.ipynb
└── Portfolio_Report.pdf
pip install gurobipy yfinance pandas numpy matplotlib
jupyter notebook Optimization_Code.ipynbNote: Gurobi requires a valid license. A free academic license is available at gurobi.com.