Assignment 6 clarification for % return over the last 3 years and for part 3

First, two points:

  1. These two calculations require the same analysis.  The only difference is that for the % return over the last 3 years, the date range is fixed for 3 years and you are to display the percent gain, rather than the gain.
  2. There is no “formula” for the answer.  The answer is a process or method to be followed.

To understand the process for these calculations, look at the detail data from the web page.  Here is the data for VFIAX.  The process is the same for VTSAX and for all of part 3, only different time periods.  To follow along, get out a calculator so you can verify the results.

From the web page …

Dividends for VFIAX: 02/26/2018-02/26/2021
Date      Dividend   Shares    Div Amt  Sh Price Purchased  New Sh Owned
06/27/2018   1.166    38.858     45.31    249.20    0.182      39.039
09/25/2018   1.215    39.039     47.43    269.17    0.176      39.216
12/14/2018   1.281    39.216     50.24    239.87    0.209      39.425
03/20/2019   1.456    39.425     57.40    260.51    0.220      39.645
06/26/2019   1.389    39.645     55.07    268.76    0.205      39.850      <===  Use these numbers as a check
09/25/2019   1.303    39.850     51.92    275.37    0.189      40.039
12/20/2019   1.433    40.039     57.38    297.16    0.193      40.232
03/09/2020   1.179    40.232     47.43    253.19    0.187      40.419
06/26/2020   1.435    40.419     58.00    277.62    0.209      40.628
09/28/2020   1.310    40.628     53.22    309.20    0.172      40.800
12/21/2020   1.386    40.800     56.55    340.80    0.166      40.966

This is the analysis for % return over the last 3 years.
  1. The date range for the last three years is this: 02/26/2018-02/26/2021.  You must determine that with your code (hint: use the newestDate).
  2. Assume you have $10000 to spend for VFIAX.  You will buy shares on 02/26/2018, using the share price for that date, which is $257.35 (your code must look up date number). That enables you to buy 38.858 shares.
  3. Now you must understand the dividend process.  For these two mutual funds, dividends are paid quarterly.  This means that over 3 years you will receive (11 or) 12 dividends (look at your dividend data in VFIAXdiv.txt).  But, there’s another rule to apply.  You must own the fund for at least 30 days in order to receive a dividend.  So, in this example, you will receive 11 dividends (but, that may not always be the case if the starting date changes).  Your code must determine which dividends to apply and you must do it in date sequence order as shown in the example.  So, assuming that you own 38.858 shares and the first dividend that you are eligible for is to be paid on 06/27/18 (your code has to look up all this).  You look up the dividend for this date and see that it is 1.166.  This means that you are paid 1.166 for each share that you own.  That comes out to $45.31.  Now, with that $45.31 you will buy new shares on that date (06/27/2018).  So, you need to know the share price for 06/27/2018.  You look it up and find $249.20.  Divide your dividend amount ($45.31) by the share price ($249.20) and you get 0.182 shares.  Add those shares to the 38.858 that you already own and you get 39.039 shares, that you now own on 06/27/2018.  Repeat this process 10 more times to cover all dividends paid through 12/21/2020.
  4. At the end of the 3-year period you own 40.966 shares.  Now, it’s time to sell them back.  So, you look up the share price for 02/26/2021.  It is $352.54.  You sell your shares for the share price and receive $14,442.15.  Your gain is $4,442.15 ($14442.15 - $10000).  
  5. To turn the gain into a percent, divided the gain by the original investment ($10000) and multiply by 100.  That should get you 44.42%.
For part 3 of the assignment, you will repeat steps 1-4 for 100 random time periods.  You can/should use the dividend detail report to check your calculations.