Skip to content
Prev 14324 / 15274 Next

does quantmod::adjustOHLC adust for dividends?

Thank you. I see that the IBM.Open, IBM.High, IBM.Low, and IBM.Close columnsare adjusted for dividends, and IBM.Adjusted column actually contains the raw close.This is fine as long the user knows this -- the naming of the columns could suggestthe reverse.
Before Yahoo changed its data format, when I used?getYahooData from package TTR to get data, the fields returned wereOpen,High,Low,Close,Volume,Unadj.Close,Div,Split,Adj.Div . I think the label "Unadj.Close" for the raw close
is more descriptive.
Vivek Rao
      From: Joshua Ulrich <josh.m.ulrich at gmail.com>
 To: Ilya Kipnis <ilya.kipnis at gmail.com> 
Cc: Vivek Rao <vivekrao4 at yahoo.com>; "r-sig-finance at r-project.org" <r-sig-finance at r-project.org>
 Sent: Friday, June 2, 2017 10:51 AM
 Subject: Re: [R-SIG-Finance] does quantmod::adjustOHLC adust for dividends?
On Fri, Jun 2, 2017 at 9:47 AM, Ilya Kipnis <ilya.kipnis at gmail.com> wrote:
No, it isn't.
The issue is that you must set the symbol.name argument if the first
argument to adjustOHLC() is not named the same as the symbol being
adjusted.

This works:

xx.a2 <- adjustOHLC(xx, symbol.name = sym)
head(xx.a2)
? ? ? ? ? IBM.Open IBM.High? IBM.Low IBM.Close IBM.Volume IBM.Adjusted
2016-01-04 128.3440 128.6942 127.0568? 128.6753? ? 5229400? ? ? 135.95
2016-01-05 129.4420 129.5650 127.6342? 128.5807? ? 3924800? ? ? 135.85
2016-01-06 127.1893 128.3251 126.4700? 127.9371? ? 4310900? ? ? 135.17
2016-01-07 126.5457 127.7951 125.3437? 125.7507? ? 7025800? ? ? 132.86
2016-01-08 126.0535 126.6593 124.2931? 124.5865? ? 4762700? ? ? 131.63
2016-01-11 124.7568 126.6593 124.7095? 126.1009? ? 4974400? ? ? 133.23