make_reinvested_return: Compute period returns assuming reinvestment of dividends.

View source: R/adjustment.R

make_reinvested_returnR Documentation

Compute period returns assuming reinvestment of dividends.

Description

Compute period returns assuming reinvestment of dividends.

Usage

make_reinvested_return(price_data, ...)

Arguments

price_data

Price data on which to compute returns

...

Additional arguments to pass to specializations.

Value

Return data calculated as close to close values multiplied by rawshares to account for splits and adding in dividends over the period. Note that a dividend on date t in Yahoo data is only paid to those holding at the close on date t-1. Therefore, there a dividend on date t for which t is also the period start will be recorded in the period ending on date t, not the next period starting on t. In particular, daily returns include a dividend on date t in the return from t-1 to t, recorded as the return on date t.

Note that daily raw returns for one week do not simply convert to weekly returns as prod(1+r). Each day the basis for return is the close, but the return comes from the following close plus dividends. Those dividends are not included in the basis for the following day.


e-mu-pi/adjustr documentation built on Sept. 26, 2024, 9:34 p.m.