Skip to content

adjustOHLC discrepancy

7 messages · Jim Green, Joshua Ulrich, sean fallon +2 more

#
Dear List:

I expect that use.Adjusted=TRUE or FALSE wouldn't affect the adjusted
close.  But running the following code proved I was wrong.
[1] "C"
C.Open   C.High    C.Low  C.Close C.Volume C.Adjusted
2007-01-03 190.8698 192.9960 187.6464 189.4639  2282100     498.66
2007-01-04 189.4639 192.5502 187.6464 188.8123  1658700     496.94
2007-01-05 188.6066 188.7780 186.7548 187.8179  1317900     494.32
2007-01-08 187.2349 189.1210 186.2061 188.7780  1236900     496.85
2007-01-09 188.6409 189.1210 185.8289 187.1320  1963000     492.52
2007-01-10 186.1032 186.8577 185.0059 185.6232  1744900     488.55
C.Open   C.High    C.Low C.Close C.Volume C.Adjusted
2007-01-03 502.3605 507.9563 493.8765  498.66  2282100     498.66
2007-01-04 498.6548 506.7777 493.8714  496.94  1658700     496.94
2007-01-05 496.3958 496.8471 491.5221  494.32  1317900     494.32
2007-01-08 492.7886 497.7525 490.0809  496.85  1236900     496.85
2007-01-09 496.4912 497.7548 489.0903  492.52  1963000     492.52
2007-01-10 489.8136 491.7992 486.9254  488.55  1744900     488.55

by using adjustOHLC, the C.close value is not the same as C.Adjusted
provided directly by yahoo.
             C.Open   C.High    C.Low  C.Close C.Volume C.Adjusted
2007-01-03 190.8698 192.9960 187.6464 189.4639  2282100     498.66

I think adjustOHLC and adjRatios are theoretically correct and  I
wonder where this discrepancy comes from. Is it possible Yahoo uses a
different method to calculate its adjusted close.

Which adjusted close would everyone recommend? the raw close adjusted
by adjustOHLC or the adjusted close provided by yahoo?

Thanks!
Jim.
#
On Tue, Sep 18, 2012 at 7:25 PM, Jim Green
<student.northwestern at gmail.com> wrote:
The adjusted close values from adjustOHLC will rarely ever be the same
as the adjusted close values provided by Yahoo.  I'm not sure I ever
figured out exactly how Yahoo calculates the adjusted close, but the
method used by adjustOHLC is simple and transparent (i.e. OSS).
It's likely precision and/or an error in Yahoo's data.  A $0.10
dividend was ex-dividend on 2009-01-29 (the first big difference),
when C was trading ~$4.  The simple return of the raw (adjusted) close
prices between the 1/28 and 1/29 is -0.0736342 (-0.07132634).  The
adjusted close should reverse the ~2.5% drop in price due to the
dividend payment, but they're nearly identical (especially given 2
decimal precision).

Keep in mind that adjustOHLC with use.Adjusted=FALSE simply pulls
split and dividend data from Yahoo and re-computes the adjustment
ratios.  So if Yahoo's split and/or dividend data are incorrect, the
results of adjustOHLC will be incorrect too.

That said, something looks very odd with the results of adjustOHLC:
getSymbols('C',from='1900-01-01')
citi <- adjustOHLC(C)
chart_Series(citi)
I hope that helps a bit, though I realize I probably created more
questions for you than I answered.

Best,
--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com
#
On 19 September 2012 03:54, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote:
Thanks Josh. I'll dig a little more with your clues and post back if I
find anything.

Jim.
#
On 19 September 2012 04:00, Jim Green <student.northwestern at gmail.com> wrote:
Checked Bloomberg, many of the cacs from are wrong before 2009... some
even don't make sense..

Nasdaq, on the other hand, seems to have correct historical dividend data

http://www.nasdaq.com/symbol/c/dividend-history

adjusted close provided by yahoo seems reasonable. but need more time to test.


Thanks to Josh again for looking into the issue!  Hope this post
answers some potential questions regarding adjustOHLC.
#
Seconded.
[1] "INFY.BO"
tr atr trueHigh trueLow
2007-01-02    NA  NA       NA      NA
2007-01-03 43.95  NA     2280 2236.05
2007-01-04 43.90  NA     2320 2276.10
2007-01-05 15.00  NA     2290 2275.00
2007-01-08 19.50  NA     2280 2260.50
2007-01-09 16.70  NA     2208 2191.30

HTH
Jeff
On Thu, Sep 20, 2012 at 10:47 AM, Zachary Mayer <zach.mayer at gmail.com> wrote: