This project is a Stock Portfolio Optimization tool that helps users optimize their investment portfolios. The backend is built using Flask, and it processes financial data stored in stock_data.csv
, which has been extracted from Yahoo Finance using Python.
├── templates/ # HTML templates for the frontend
├── app.py # Main Flask application
├── optimization.py # Contains the portfolio optimization logic
├── stock_data.csv # Pre-stored stock data extracted from Yahoo Finance
├── requirements.txt # Required dependencies
├── README.md # Project documentation
- Portfolio Optimization: Helps users allocate stocks efficiently on the basis of the historical data extracted from yahoo finance
- Optimization model: Uses two models to increase optimization accuracy and secure against single model failure.
- Flask API: Processes optimization requests and returns optimized values.
- Frontend Dashboard: Displays portfolio analytics and optimization results with interactive visualizations.
The Dashboard provides an analytical view of:
- Stock analysis tab: Provides a comprehensive overview of individual stocks, including historical performance and key metrics.
- Risk-Return Analysis: Offers in-depth insights into the portfolio's composition, displaying risk-return analysis and asset distribution through interactive graphs.
- Historical Performance: Visualizes the improved portfolio after optimization, highlighting allocation adjustments for better performance..
- Clone the repository:
git clone <your-repo-link> cd <your-repo-folder>
- Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On macOS/Linux venv\Scripts\activate # On Windows
- Install dependencies:
pip install -r requirements.txt
- Run the Flask application:
python app.py
- Python (Flask, Pandas, NumPy)
- Yahoo Finance API (for extracting stock data)
- HTML/CSS & JavaScript (for the frontend)
- Plotly (for data visualization on the dashboard)
Feel free to open an issue or pull request if you have suggestions or improvements!
🚀 Happy Investing!