user3481555
user3481555

Reputation: 11

R function for adjusting for stock splits and dividend

I am trying to write a function in R that adjusts for stock splits and dividend. I have about 150 stocks downloaded independently(not from yahoo). I have the close price and dividends data but want to calculate the adjusted price.

Regards

Upvotes: 0

Views: 1074

Answers (1)

Joshua Ulrich
Joshua Ulrich

Reputation: 176648

TTR::adjRatios will calculate the adjustment ratios for you. quantmod::adjustOHLC is an example of how to use it. Just substitute your data in place of the calls to getDividends and getSplits.

Upvotes: 2

Related Questions