In the first part of the assignment, you will write a Python script (in Jupyter Notebook) to calculate the relative volatility for the three given stocks: enb, baba, and aapl. Files to download: Please download the following files from D2L: "baba.csv", "aapl.csv", "enb.csv". These CSV files contain the historical trading data for the corresponding stocks trading at NYSE/Nasdaq stock exchange, and each of them has the following information: Date, Open Price, High Price, Low Price, Close Price, Adj Close, Volume. Your task is to write a Python Jupyter Notebook script that will calculate the coefficient of variation for each of the stocks to calculate the volatility for the year 2019 using the closing price of the stocks. A higher value of the coefficient of variation means the stock is more volatile.
How to calculate the coefficient of variation? To calculate the coefficient of variation, we need to know the mean and the standard deviation (SD). Then, using the mean and the standard deviation, we can calculate the coefficient of variation (CV) using the following formula: CV = SD/mean.
Your Python script should deliver the following:
1. The script should save the coefficient of variation for each of the three stocks to a data frame, and then the data frame should be saved to a CSV file named "coefficient_of_variance.csv" (3 Points).
2. All the covariances of the three stocks should be plotted on a single plot (2 Points).
3. Your program should save the stock tickers for the most and the least volatile stocks to a data frame, and then the data frame should be saved to another CSV file named "maxMin.csv" (2 Points).
4. Make sure the script is well-documented. I mean, each line of code should be documented (1 Point).