Stock Analysis and Portfolio Comparison Tool with 3 functions for the Big Five Dataset
Group ID: 2299
Table of Contents
This Python tool provides comprehensive functionalities for analyzing stock performance, creating, and comparing investment portfolios, and performing descriptive statistics analysis. It focuses on major technology companies and includes functionalities for comparing with the NASDAQ index.
The program consists of four main functions:
Allows users to import stock data from a CSV file. The file can be found in the repo (big_five_stocks). It can be also be downloaded via Kaggle: https://www.kaggle.com/datasets/abdullahmu/big-five-stocks?resource=download
Enables users to compare the stock performance of selected technology companies.
Users can create a virtual portfolio and compare its performance against the NASDAQ index.
Perform statistical analysis on selected stocks, including calculating volatility, correlation with NASDAQ, and annualized returns.
To run this program, ensure you have Python installed along with the following libraries:
- pandas
- matplotlib
- numpy
- os
If necessary, use the following command to install these libraries:
pip install pandas matplotlib numpy os
Run the program with the following command:
python stock_analysis.py
Follow the prompts in the interactive interface to import data and choose the desired analysis function.
- Data Import (
import_csv
): Prompts the user to input the path to the CSV data file, loads the data, and sets up the mapping of company names to ticker symbols.
- Plot Stock Performance (
plot_stock_performance
):
- Users select companies and specify time frames for analysis.
- Offers options to plot data on a logarithmic or relative scale.
- Includes an option to benchmark against the NASDAQ index.
- Create and Compare Portfolio (
create_and_compare_portfolio
):
- Users create a virtual investment portfolio by selecting companies and allocating percentages.
- Compares the portfolio's performance to the NASDAQ index over the specified period.
- Descriptive Statistics Analysis (
descriptive_statistics_analysis
):
- Performs statistical analysis on user-selected stocks.
- Calculates key metrics like highest/lowest prices, volatility, and correlation with NASDAQ.
- The main function serves as the entry point, offering a menu to choose among the different functionalities.
- Users can opt to compare stock performance, create a portfolio, analyze descriptive statistics, or exit the program.
- Python code
- Stock performance
- Portfolio
- Descriptive Statistics
- Readme
Leopold Huberth - [email protected]
Dominik De Marco - [email protected]
Project Link: https://github.com/LH5399/Skills-Programming-with-Advanced-Computer-Languages