joshuaulrich / quantmod

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

Feature: querying of minute-resolution intraday data with yahoo api #381

Closed kapsner closed 11 months ago

kapsner commented 1 year ago

Yahoo API allows to query intraday data for last 7 days. This PR implements querying of intraday data with yahoo API.

Addresses https://github.com/joshuaulrich/quantmod/issues/351

Test with

remotes::install_github("kapsner/quantmod")
quantmod::getSymbols("AAPL", periodicity = "intraday")
quantmod::chartSeries(AAPL)

Rplot

joshuaulrich commented 1 year ago

Sorry it took me so long to reply. This looks really good!

The only potential change I can think of is that Yahoo supports more than 1-minute intraday data. The valid intraday values are: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h

It would be nice to support all of those. It doesn't have to be done in this PR though. I can do it after merging. What do you think? Also, do you know if you can get more history for the lower resolution intraday data?

kapsner commented 1 year ago

Thanks @joshuaulrich for your feedback!

The only potential change I can think of is that Yahoo supports more than 1-minute intraday data. The valid intraday values are: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h

Ah cool, I wasn't aware of this. Yes, I agree with you that supporting all of those would be indeed nice. However, I am not familiar if one can get more history of the lower resolution intraday data. If this is the case, the "history cutoff"-logic would need to be adapted accordingly: https://github.com/joshuaulrich/quantmod/pull/381/files#diff-0d1f6c1913e17876f7f890fdb8db9d0109d6806720090032749c669bdeb27dfcR290

I have no preference regarding including the other intraday-resolution options into this PR or do it after merging - as you like!