This is an interactive web app built with Streamlit that simulates Modern Portfolio Theory. The app uses Monte Carlo simulation to generate thousands of portfolios and highlights the optimal one based on the Sharpe Ratio.
- Clone the repository:
git clone https://github.com/yourusername/mpt-portfolio-optimizer.git
cd mpt-portfolio-optimizer- Install dependencies:
pip install -r requirements.txt- Run the app:
streamlit run app.py-
Select:
- Timeframe to analyze expected returns
- Investing period for cumulative return comparison
- Start date (restricted to valid range)
- Tickers to include in the portfolio
- Number of random portfolios to simulate
-
Click Compute to run the simulation:
- Calculates expected returns using CAPM
- Simulates thousands of portfolios
- Finds the one with the highest Sharpe Ratio (Tangent Portfolio)