[R-SIG-Finance] Change getSymbols to get most recent data
Vivek Rao
vivekrao4 at yahoo.com
Fri Jul 14 04:46:25 CEST 2017
In the R package quantmod, using getSymbols in the evening used to get prices up to the latestclose, but since Yahoo Finance changed their data service, it only gets data through yesterday.I suggest that getSymbols make a call to getQuote to see if more recent data can be appendedto the end of the data returned. The script below explains what the problem is. Yahoo Finance"knows" the OHLCV data of today, but getSymbols does not return it.
At 10:30 PM EST 2017-07-13 the output of
options(warn=-1)suppressMessages(library("quantmod"))options("getSymbols.yahoo.warning"=FALSE)options("getSymbols.warning4.0"=FALSE)sym <- "SPY"xx <- getSymbols(sym,auto.assign=FALSE,from="1990-01-01")print(tail(xx))last <- getQuote(sym)print(last)
is
SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.Adjusted2017-07-05 242.63 243.01 241.70 242.77 54427600 242.772017-07-06 241.89 242.03 240.34 240.55 65400800 240.552017-07-07 241.21 242.28 240.56 242.11 57972300 242.112017-07-10 242.11 242.80 241.76 242.37 36663300 242.372017-07-11 242.37 242.55 240.85 242.19 50354600 242.192017-07-12 243.30 244.20 243.30 244.01 59610400 244.01 Trade Time Last Change % Change Open High Low VolumeSPY 2017-07-13 04:00:00 244.42 0.41 +0.17% 244.02 244.55 243.76 39471637
Vivek RaoBoston, MA
[[alternative HTML version deleted]]
More information about the R-SIG-Finance
mailing list