"Risk comes from not knowing what you're doing." – Warren Buffett
A Python-powered tool that helps you optimize investment portfolios using Modern Portfolio Theory (MPT) and Monte Carlo simulations. Analyze, simulate, and visualize risk-return trade-offs with confidence. 📊📈
- Features
- Installation
- Usage
- Visuals
- Concepts
- Contributing
- License
- Fetch historical stock data using
yfinance
. - Perform Monte Carlo simulations to explore portfolio risk/return combinations.
- Optimize portfolios for:
- Maximum Sharpe Ratio
- Minimum Volatility
- Plot the Efficient Frontier.
- Export allocation data and visuals for reporting.
-
Clone the repository
git clone https://github.com/your-username/investment-portfolio-optimizer.git cd investment-portfolio-optimizer
-
Install dependencies
pip install -r requirements.txt
python fetch_data.py --ticker AAPL --start 2020-01-01 --end 2021-01-01
python monte_carlo.py --iterations 1000
python optimize.py --objective sharpe_ratio
python plot_efficient_frontier.py
Simulated portfolios, color-coded by Sharpe ratio. Red Star = Max Sharpe 📍 | Green Star = Min Volatility ✅
- A strategy to construct a portfolio that maximizes return for a given level of risk.
- Introduced by Harry Markowitz, focuses on diversification and the Efficient Frontier.
- Generates thousands of portfolio combinations with random weights.
- Helps estimate distribution of returns and identify optimal portfolios.
We welcome contributions! 🛠️
- Fork the repo
- Create a branch:
git checkout -b feature-branch
- Commit your changes:
git commit -am 'Add new feature'
- Push the branch:
git push origin feature-branch
- Create a Pull Request!
This project is licensed under the MIT License. See the LICENSE file for details.