Open joshuaulrich opened 3 weeks ago
Hmm, looks like this may be an issue on Yahoo's end. The returned timestamps are for the day's open, there's no data for yesterday, and today's timestamp is the close. Perfect.
debugonce(quantmod::getSymbols.yahoo)
spy <- getSymbols("SPY", to = Sys.Date()+3, auto.assign = FALSE, src = "yahoo")
## ...
## ...
Browse[1]$
debug: idx <- .POSIXct(y$timestamp[[1]], tz = tz)
Browse[1]$
debug: if (!is.intraday) {
idx <- as.Date(idx)
}
Browse[1]$ tail(xts(OHLCV(do.call(cbind, ohlcv)), .POSIXct(y$timestamp[[1]], tz = tz)))
open high low close volume
2024-06-05 09:30:00 530.77 534.69 528.73 534.67 47610400
2024-06-06 09:30:00 534.98 535.42 532.68 534.66 30808500
2024-06-07 09:30:00 533.66 536.89 532.54 534.01 43224500
2024-06-10 09:30:00 533.18 535.99 532.57 535.66 35729300
2024-06-11 09:30:00 NA NA NA NA NA
2024-06-12 16:00:00 541.63 544.12 540.30 541.36 60222457
yep, yahoo straight up not returning data for 6/11 for any tickers. caveat emptor
I ran this again right now (the following morning) and the data is there, but the timestamps are still the beginning of the day.
Browse[1]$ tail(xts(OHLCV(do.call(cbind, ohlcv)), .POSIXct(y$timestamp[[1]], tz = tz)))
open high low close volume
2024-06-05 09:30:00 530.77 534.69 528.73 534.67 47610400
2024-06-06 09:30:00 534.98 535.42 532.68 534.66 30808500
2024-06-07 09:30:00 533.66 536.89 532.54 534.01 43224500
2024-06-10 09:30:00 533.18 535.99 532.57 535.66 35729300
2024-06-11 09:30:00 534.07 537.01 532.05 536.95 36383400
2024-06-12 09:30:00 541.63 544.12 540.30 541.36 63129800
Likely a timezone issue in the request and/or response.