make_raw_value: Make additive price adjustments without lookforward bias.

View source: R/adjustment.R

make_raw_valueR Documentation

Make additive price adjustments without lookforward bias.

Description

Apply dividend and split data to price series without changing past data. Changes are applied additively, perhaps multiplicative will be added in the future. A dividend paid at time t will increase the value at time t and all future times. A split at time t will apply a factor at time t and all future times. The Rawvalue and RawShares will be added.

Usage

make_raw_value(price_data, splits, dividend, ...)

Arguments

price_data

Price data for which to compute raw value. Currently in a confused state where data.table and xts are both accepted.

splits

Splits as provided by Yahoo, either as data.table or xts.

dividend

Split unadjusted dividends as provided by Yahoo, either as data.table or xts.

...

Not sure yet.

Details

Note that splits and dividends that overlap may not be processed correctly. Splits are processed first, as the price will be reported post-split, so we assume the shares have already split, and the dividend is reported per share. In practice, this may be false, in which case work would need to be done.

TODO: Need to make sure it works when there is a split or dividend on a date with no price.

Value

A data.table unless an xts was passed in containing new columns with dividend, splits, rawshares, rawdividend, and rawvalue.


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