📈 Stock Performance Comparison is a Streamlit application that allows users to compare the historical performance of two stock tickers, including stocks, ETFs, or index funds. The app visualizes key metrics such as yearly returns, cumulative returns, and stock price history over the last 10 years (or since the latest existence of either stock). It also provides general information about the selected stocks, including market cap, sector, and more.
- Yearly Performance Comparison: Compare the yearly percentage returns of two stock tickers. The app highlights the better-performing stock each year and displays the results in a color-coded grid.
- Cumulative Returns: Visualize the cumulative returns of both tickers over the selected period.
- Stock Price History: View a line chart of the closing prices of both stocks over time.
- General Information: Access key details about each stock, such as market cap, sector, P/E ratio, and dividend yield.
- Recent News: Stay informed with the latest news related to the selected stock tickers.
To run this app locally, you'll need to have Python installed. Follow these steps:
-
Clone the repository:
git clone https://github.com/Roialfassi/Stock_Comparator.git cd stock-performance-comparison
-
Install the required packages:
pip install -r requirements.txt
-
Run the Streamlit app:
streamlit run main.py
- Enter Stock Tickers: Use the sidebar to input the ticker symbols of the two stocks you want to compare (e.g.,
AAPL
for Apple andMSFT
for Microsoft). - Select Start Date: Choose the starting date for the comparison.
- View Results: Click the "Compare Tickers" button to view the comparison results, including:
- Yearly performance
- Cumulative returns
- Stock price history
- General information about each stock
- Recent news
This app is deployed on Streamlit Community Cloud. You can access it directly via this link:
https://stock-comparator.streamlit.app/
Contributions are welcome! If you have suggestions for new features or improvements, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
- Streamlit - For providing an amazing platform to build and share data apps.
- yFinance - For making it easy to retrieve stock data.
For any inquiries or feedback, feel free to reach out at [email protected].