So, I'm not sure the adjustOHLC function is working correctly.

MRE:

[image: image.png]
That is, after using adjustOHLC, the adjusted close price for AAPL
(4.56e-08) very much does NOT match the actual adjusted closing price
column (.261).

I'm not sure if this function is a completely kosher fix because it simply
works off of the ratio between close and adjusted columns, but I'd think
the most important thing is to make sure that the adjusted closing price
matches, and that the same ratio should be used daily, no?

So, here's my function:

adjust <- function(x){
  ratio <- Ad(x)/Cl(x)
  x[,1] <- Op(x) * ratio
  x[,2] <- Hi(x) * ratio
  x[,3] <- Lo(x) * ratio
  x[,4] <- Cl(x) * ratio
  return(x)
}

Thanks.

-Ilya
_______________________________________________
R-SIG-Finance@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should 
go.

Reply via email to