StockTracker is a Python application that help analyse and visualise stock performance data for a list of companies. It provides a user-friendly GUI for comparing stock prices, viewing historical trends, and staying updated with the latest news.
StockTracker is designed to simplify stock analysis and decision-making. It fetches stock data for multiple companies, plots interactive graphs, and offers real-time news updates. Key features include:
- Graphical representation of historical stock prices.
- Live stock price tracking and display.
- Integration with Alpha Vantage, providing the latest available closing price.
- Integrate with News API for up-to-date news related to selected companies.
- Python 3.10
- PyQt5
- Bokeh
- Matplotlib
- Numpy
- Pandas
- Unittest
- Clone the project repository using Git.
- Ensure that your pip package manager is up to date by running the command
pip install --upgrade pip
. - Install the required modules by executing the command
pip install -r ./requirements.txt
- Download the stock data from the following source: https://www.kaggle.com/datasets/camnugent/sandp500.
- Extract the downloaded file and navigate to the extracted folder.
- Locate the directory named individual_stocks_5yr within the first individual_stocks_5yr directory and copy it.
- Paste the individual_stocks_5yr directory into the StockTracker repository.
- Within the src directory of the project, create a new Python file named parameter.py.
- Inside parameter.py, create two variables: NEWS_API_KEY and ALPHA_VANTAGE_API_KEY.
- Assign your News API and Alpha Vantage API keys to the respective variables in parameter.py.
- Run the main.py file to start the StockTracker application.
Note:
- This project relies on external data sources and requires valid API keys to access the necessary information. Make sure to provide your own API keys to ensure proper functionality.
- The demonstration of the GUI functionality utilises older data. To ensure you have the most recent graph representation, replace the provided data with updated information.
The image showcases the GUI, featuring elements such as the company selection dropdown menu, latest closing price, current news, and historical performance.
StockTracker incorporates various tests to ensure its stability and reliability. To execute these tests, follow these steps:
- Go to the tests directory.
- Replace the sample_data files with a subset of files you intend to test, maintaining a similar naming convention.
- Adjust the test scripts as necessary.
Contributions to StockTracker are welcome! If you'd like to contribute, please follow these guidelines:
- Fork the project.
- Create your feature branch (git checkout -b feature/your-feature-name).
- Commit your changes (git commit -m 'Add some feature').
- Push to the branch (git push origin feature/your-feature-name).
- Open a pull request.
This project is licensed under the MIT License.