Portfolio Management with Monte Carlo Simulation is a comprehensive Python application designed to assist investors and financial analysts in managing and optimizing investment portfolios. By leveraging Monte Carlo simulations and interactive visualizations, the application provides probabilistic forecasts of portfolio performance under various market conditions, aiding in risk assessment and strategic planning.
Main Interface with Ticker Selection
Description: The main interface showing the ticker selection with autocomplete suggestions.
Investment Preferences
Description: Users can choose between entering weights with initial investment or specifying dollar amounts per stock.
Editable Weights Table
Description: An interactive table where users can input and adjust weights for each stock. The default weights are equal.
Simulation Parameters
Description: Set the number of simulations, time horizon, and risk-free rate.
Simulation Results
Description: The application displays simulation insights and interactive plots after running the Monte Carlo simulation.
Interactive Plots
Description: Interactive charts showing cumulative returns and distribution of final portfolio values.
portfolio_management/
├── README.md
├── requirements.txt
├── setup.py
├── .gitignore
├── LICENSE
├── app.py # Streamlit application
├── portfolio_management/
│ ├── __init__.py
│ ├── data/
│ │ ├── __init__.py
│ │ └── data_loader.py
│ ├── monte_carlo/
│ │ ├── __init__.py
│ │ └── simulation.py
│ ├── portfolio/
│ │ ├── __init__.py
│ │ ├── portfolio.py
│ │ └── optimizer.py
│ └── utils/
│ ├── __init__.py
│ └── helpers.py
└── tests/
├── __init__.py
├── test_data_loader.py
├── test_portfolio.py
├── test_simulation.py
└── test_optimizer.py
Clone the Repository
git clone https://github.com/yourusername/portfolio_management.git
Navigate to the Project Directory
cd portfolio_management
Create a Virtual Environment (Recommended)
python -m venv venv
Activate the virtual environment:
venv\Scripts\activate
source venv/bin/activate
Install Dependencies
pip install -r requirements.txt
Run the Streamlit app from the terminal:
streamlit run app.py
This will launch the application in your default web browser.
Select Stocks and Date Range:
Investment Preferences:
Simulation Parameters:
Run Simulation:
View Results:
Run the unit tests to verify the integrity of each module:
python -m unittest discover -s tests
Contributions are highly appreciated! Please follow these guidelines:
Fork the Repository: Click on the 'Fork' button at the top right corner of the repository page.
Create a New Branch:
git checkout -b feature/YourFeature
Commit Your Changes:
git commit -am 'Add a feature'
Push to the Branch:
git push origin feature/YourFeature
Open a Pull Request: Navigate to your forked repository and click on 'New Pull Request'.
This project is licensed under the terms of the MIT License.
Feel free to reach out for any inquiries or collaboration opportunities.
Disclaimer: This application is intended for educational purposes only. Investment involves risk, and past performance is not indicative of future results. Consult with a qualified financial advisor before making investment decisions.