Reputation: 11
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
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