Saturday, June 17, 2017

get.hist.quote not working and the fix

The get.hist.quote command of tseries package was not working. But it has been fixed, however, the argument has changed slightly.

Here is the quick fix. Install the latest tseries package and load the package in the enviroment.

install.packages("tseries")
library("tseries")

To perform the GARCH model as in my previous blog (here). Instead of using the code (as in that blog)

DJI.data = get.hist.quote(instrument="^DJI", start="2010-01-01", end="2015-07-23", quote="AdjClose", provider="yahoo", compression="d", retclass="zoo")

Use the following.

DJI.data = get.hist.quote(instrument="^DJI", start="2010-01-01", end="2015-07-23", quote="Adjusted", provider="yahoo", compression="d", retclass="zoo")

plot(DJI.data)

Here is the video with explanation.