This project is a Streamlit app for visualizing and analyzing stock data from the S&P 500 index. It allows users to select a company, choose different data types to visualize, and compare stock performance against the S&P 500 Index (^GSPC
) as a benchmark.
- Interactive Visualizations: Plot various financial metrics such as OHLC prices, stock returns, and rolling alpha and beta.
- Customizable Time Range: Select custom start and end dates for data analysis.
- Comparison with Benchmark: Optionally compare the selected stock's performance against the S&P 500 index.
- Data Analysis: Includes calculation of stock returns, log returns, and cumulative returns.
- Advanced Metrics: Plot rolling alpha and beta values with customizable lookback windows.
Streamlit
Pandas
Plotly
Scikit-learn
NumPy
yfinance
-
Clone the repository:
git clone https://github.com/Yosri-Ben-Halima/SP500-Investment-Data-Visuals-App cd SP500-Investment-Data-Visuals-App
-
Install the required packages:
pip install -r requirements.txt
-
Run the Streamlit app:
streamlit run app.py
- Select a Company: Choose a company from the dropdown menu in the sidebar.
- Date Range: Set the start and end dates for data analysis. Optionally, use the current date as the end date.
- Data Options: Select the data you want to plot (e.g., Candlestick, OHLC, Stock Returns) using the multiselect box.
- Benchmark Comparison: Check the box to compare the selected stock's performance with the S&P 500 index.
- Rolling Alpha and Beta: Choose a lookback window for calculating rolling alpha and beta values.
Feel free to submit issues or pull requests to enhance the project.
This project is licensed under the MIT License - see the LICENSE file for details.
Thank you for visiting my GitHub profile! Feel free to reach out if you have any questions or opportunities to collaborate. Let's connect and explore new possibilities together!