How apurvshah007/portfolio-optimizer works
This repository is a Python portfolio-analysis and optimization library centered on Modern Portfolio Theory. A caller supplies assets, weights, and a start date to either optimizer; the optimizer retrieves price history, optionally reports portfolio statistics, computes annualized returns and covariance, and delegates to an optimization method. Results can be reported as weights and performance, converted to a discrete share allocation, and plotted. The README highlights efficient-frontier and asset-weight plots; the CLA module implements a frontier plot as well. The empty Markowitz file has no evidenced runtime role. Wiring reflects sampled source; no runtime behavior is inferred for the empty file.
Main entry points: basic_portfolio_functions.py Portfolio helpers · efficient_frontier_portfolio_optimizer.py Efficient optimizer · critical_line_algorithm_optimizer.py CLA optimizer
Components 12
Optimization APIs
- Efficient optimizer
efficient_frontier_portfolio_optimizer.py - CLA optimizer
critical_line_algorithm_optimizer.py
Portfolio Analysis
- Portfolio helpers
basic_portfolio_functions.py - Portfolio statistics
basic_portfolio_functions.py - Historical VaR
basic_portfolio_functions.py
Results and Plots
- Discrete allocation
basic_portfolio_functions.py - Efficient plots
efficient_frontier_portfolio_optimizer.py - CLA frontier plot
critical_line_algorithm_optimizer.py - Weight plots
efficient_frontier_portfolio_optimizer.py
Other components
- Python caller
- Yahoo price data
- PyPortfolioOpt
Connections 17
- Python caller → Efficient optimizer: calls API
- Python caller → CLA optimizer: calls API
- Efficient optimizer → Portfolio helpers: fetches prices
- CLA optimizer → Portfolio helpers: fetches prices
- Portfolio helpers → Yahoo price data: reads history
- Efficient optimizer → Portfolio helpers: requests stats
- CLA optimizer → Portfolio helpers: requests stats
- Efficient optimizer → PyPortfolioOpt: optimizes portfolio
- CLA optimizer → PyPortfolioOpt: optimizes portfolio
- Efficient optimizer → Portfolio helpers: requests allocation
- CLA optimizer → Portfolio helpers: requests allocation
- Portfolio helpers → Discrete allocation: calculates shares
- Efficient optimizer → Efficient plots: plots weights
- CLA optimizer → CLA frontier plot: plots frontier
- CLA optimizer → Weight plots: plots weights
- Efficient optimizer → Weight plots: plots weights
- Portfolio helpers → Yahoo price data: reads ticker history