Skip to content
Prev 13876 / 15274 Next

adjustOHLC.R issues

After looking into this issue further I wanted to post my 
understandings, which hopefully are correct and will help others with 
similar questions. The equations I had in my original post are in fact 
the ones implemented in adjustOHLC() when use.Adjusted = TRUE is 
selected. The original C prices, when adjusted using the Yahoo adjusted 
C, will always equal each other. But, when use.Adjusted = FALSE is used 
(the default) adjustOHLC() calculates its own adjusted C value (by 
downloading splits and dividends as required by the parameter list) 
rather than using Yahoo's adjusted C. It then uses that adjusted C value 
to modify/adjust the values of O, H, L, and C. The modified/adjusted C 
value in this case may or may not match the calculated adjusted C value 
due to historic splits and dividends, and the adjusted C value from 
adjustOHLC() and Yahoo don't always match (maybe rarely as Brian says 
below ... have not done an exhaustive test).

The difference between the two use.Adjusted settings seems to come from 
how Yahoo is calculating its adjusted C. Depending on whether one should 
use use.Adjusted = TRUE or FALSE seems depend on how one will use the 
adjusted prices.

I trust the adjustOHLC() values because the equations are more 
transparent than Yahoo's and it grabs all splits and dividends back to 
1900 and applies them where pertinent. I've read a number of posts on 
stackoverflow and on this SIG and also looked at the adjustOHLC() code 
to come to these conclusions.

Thanks to Brian and Josh for their input. If I have misunderstood please 
correct this post.

Ernie