Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for Alpha Vantage batch quotes #213

Closed
ethanbsmith opened this Issue Jan 17, 2018 · 8 comments

Comments

Projects
None yet
3 participants
@ethanbsmith
Copy link
Contributor

ethanbsmith commented Jan 17, 2018

Description

Alpha Vantage recently added support for getting current price quotes fro multiple symbols. this is similar to the getQuote functionality form Yahoo. I think it would be good to extend the getQuote function to support this API, since AV provides real-time quotes vs yahoos 15 minutes delay

Full docs: https://www.alphavantage.co/documentation/#batchquotes

There are a few issues worth considering:

  1. I think its best to extend getQuote, not getSymbols. a. the intended use similar. b. the output form getSymbols is an xts object which is based on a matrix, and cannot handle the symbol column of the output
  2. The API only handles up to 100 symbols. I think it would be best for getQuote to internally handle the looping calls to av for input of over 100 symbols.
  3. AV only includes symbol,price,volume,timestamp in the output. this differs significantly from the yahoo version, but I think still fits within the quantmod framework, where different sources return different output

any issues/thoughts before i get started on a PR

@joshuaulrich

This comment has been minimized.

Copy link
Owner

joshuaulrich commented Jan 23, 2018

Great idea! 1) I agree that this should go in getQuote(). 2) Just make it work for 100. Getting more than 100 is just an if statement and some recursive function calls. 3) Maybe check if users try to request more than that and warn if they do.

I don't have any specific thoughts right now. General comments are in the contributing guide. Thanks for contributing!

@ethanbsmith

This comment has been minimized.

Copy link
Contributor Author

ethanbsmith commented Feb 6, 2018

I have this working version of mostly done. Along the way I realized this the AV function only returns current price, without OHL & V. I have reached out to AV asking them to enhance their API. will hold off on submitting this for a bit until I get a response (either way) from them.

@braverock

This comment has been minimized.

Copy link
Collaborator

braverock commented Feb 6, 2018

@ethanbsmith quotes typically will only contain current price.

Trade feeds typically contain only trades. Many/Most exchanges don't report current volume, you typically have to aggregate that number yourself. The exchange only reports (if they report it at all) after the close.

Though I am a little confused that your prior report said 'volume' was one of the included fields.

@ethanbsmith

This comment has been minimized.

Copy link
Contributor Author

ethanbsmith commented Feb 6, 2018

their other single ticker functions all return an OHLCV time series result set
this new multi-ticker only includes latest price for each ticker
I don't think it's too much to ask them to include OHL & V for the day on the multi-ticker function. they certainly have the data

@ethanbsmith

This comment has been minimized.

Copy link
Contributor Author

ethanbsmith commented Feb 6, 2018

I know that for many of my use cases, i still need OHL & V for the day. The only way to get those is to loop through my ticker list, making round trip calls on their single ticker API. So, for me, i would never actually use the multi-ticker API as it stands.

@joshuaulrich

This comment has been minimized.

Copy link
Owner

joshuaulrich commented Apr 1, 2018

@ethanbsmith any update on this? I need to get an update to CRAN in ~2 weeks, and it would be nice if this were included!

@ethanbsmith

This comment has been minimized.

Copy link
Contributor Author

ethanbsmith commented Apr 3, 2018

I still have not heard back from AV on changing their API, so I have put in a PR with the working code based on the existing API. The PR failed CI, but from the logs, I think this may be an issue with getSymbols.google, rather than the new code. Any hints/suggestions welcome

@joshuaulrich

This comment has been minimized.

Copy link
Owner

joshuaulrich commented Apr 6, 2018

@ethanbsmith Thanks for the update. You're correct that the failure is caused by getSymbols.google(). I just fixed that, so I can re-run your build(s?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.