Stat
Stat

Reputation: 681

R: quantmod - getSymbols to argument

I am using getSymbols in library quantmod in R to load SP500 data. When I set the to argument to "2021-01-28", the data is only downloaded up to and including "2021-01-27" while the help function for getSymbols.yahoo says that data is retrieved through this date. According to this, shouldn't the data be downloaded until the end of "2021-01-28"?

> library(quantmod)
> SP500=getSymbols("^GSPC", src="yahoo",auto.assign=FALSE,to="2021-01-28")
> tail(SP500)
           GSPC.Open GSPC.High GSPC.Low GSPC.Close GSPC.Volume GSPC.Adjusted
2021-01-20   3816.22   3859.75  3816.22    3851.85  4551790000       3851.85
2021-01-21   3857.46   3861.45  3845.05    3853.07  4484460000       3853.07
2021-01-22   3844.24   3852.31  3830.41    3841.47  5080430000       3841.47
2021-01-25   3851.68   3859.23  3797.16    3855.36  6955860000       3855.36
2021-01-26   3862.96   3870.90  3847.78    3849.62  6029090000       3849.62
2021-01-27   3836.83   3836.83  3732.48    3750.77  9878040000       3750.77

Upvotes: 1

Views: 591

Answers (1)

phiver
phiver

Reputation: 23598

It should, but it doesn't. It is an issue with yahoo and also depends from which exchange the data is coming from. See github issue 258 for more information.

Upvotes: 1

Related Questions