joshuaulrich / quantmod

Quantitative Financial Modelling Framework
http://www.quantmod.com/
GNU General Public License v3.0
798 stars 219 forks source link

getSymbols.yahoo missing data when passed "to" argument #337

Closed peterccarl closed 2 years ago

peterccarl commented 3 years ago

Description

When given a "to" argument, the data is not inclusive of that date.

Expected behavior

Um, shouldn't it be inclusive? If I want data through Friday, should I ask for data through Saturday? That doesn't seem quite right.

Minimal, reproducible example

> getSymbols("AAPL", to="2021-07-09")
[1] "AAPL"
> tail(AAPL)
           AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted
2021-06-30    136.17    137.41   135.87     136.96    63261400        136.96
2021-07-01    136.60    137.33   135.76     137.27    52485800        137.27
2021-07-02    137.90    140.00   137.75     139.96    78852600        139.96
2021-07-06    140.07    143.15   140.07     142.02   108181800        142.02
2021-07-07    143.54    144.89   142.66     144.57   104911600        144.57
2021-07-08    141.58    144.06   140.67     143.24   105575500        143.24
joshuaulrich commented 3 years ago

This may be related to #258.

peterccarl commented 2 years ago

Yes, it is, thanks.