Question: Please in R Data Preparation Use the 6 stocks ['IBM', 'MSFT', 'GOOG', 'AAPL', 'AMZN', 'FB'] historical data from homework assignment 2. Data Preparation Download the
Please in R
Data Preparation
Use the 6 stocks ['IBM', 'MSFT', 'GOOG', 'AAPL', 'AMZN', 'FB'] historical data from homework assignment 2.
Data Preparation
Download the historial daily data of the entire 2018 for the 6 stocks
tks = ['IBM', 'MSFT', 'GOOG', 'AAPL', 'AMZN', 'FB']
For example, to download IBM data, use the following link to go to yahoo finance page. Find the "Download Data" link to download the csv file to you local disk. https://finance.yahoo.com/quote/IBM/history?period1=1514782800&period2=1546232400&interval=1d&filter=history&frequency=1d. <-- Link
There are two columns in each csv file, "Close" and "Adj Close". If we compute the ratio of previous day's "Close" price and today's "Close" price, then compare with the ratio of previous day's "Adj Close" price and today's "Adj Close" price, on most of days, the two ratios should be equal. On dividend day, the two ratios will have a difference. The difference times today's "Close" price, you will get the dividend. As the example below, you should be able to use the method to reproduce the $1.5 dividend on 2/8/2018.
The result
You result will have 6 dataframes, each of them have two columns, Date and Dividend. The dataframe should only have the rows that represent the divident day and amount.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
