The quantmod package added support for queries to Alpha Vantage in the summer. According to their website www.alphavantage.co: "Composed of a tight-knit community of researchers, engineers, and business professionals, Alpha Vantage Inc. is a leading provider of free APIs for realtime and historical data on stocks, physical currencies, and digital/crypto currencies." Has anyone had any interaction with Alpha Vantage other than the one comment on the quantmod github site https://github.com/joshuaulrich/quantmod/issues/176 on Aug 17? They offer support by email on their web site. I wrote them a while ago, but haven't had a reply. My question was about support for the TSX. By trial and error, requests like TSX:POT will get intraday quotes for regular stocks. I haven't found how to get current quotes for ETFs or REITs. Duncan Murdoch
Interaction with Alpha Vantage?
13 messages · Dirk Eddelbuettel, Joshua Ulrich, Sal Abbasi +4 more
Credit where credit is due---the 'tidyquant' folks first mentioned it, but it in the fullest and most glorious tradition of the tibbliesverse require half a dozen or more other packages for not apparent reason. So I followed up with a quick tweet on Sep 5 about a one-liner not needing anything else besides data.table: https://twitter.com/eddelbuettel/status/905066349294219264 and cooked up a helper function in a so-far-unreleased package of personal functions (this one is below) which I shared with at least Josh. The larger function added to quantmod is AFAIK contributed by Paul. Now, as for interchaning with them: Nope. I too need ETFs, Canadian stocks and whatnot for the little personal finance app I have had as a daily cronjob since the 1990s (and been meaning to rewrite in R since then too as it is, gasp, Perl -- see eg https://github.com/eddelbuettel/beancounter and other online resources). It may now be time to rewrite this as the underlying (Perl) data grabber Finance::YahooQuote is now dead due to Yahoo! walking away from that API. I have an unpublished R-based drop-in replacement for just the data gathering ... Anyway, alphavantage looks good. We should test it some more. Dirk ##' Fetch a real-time market data series from AlphaVantage ##' ##' Several optional parameters could be set, but are not currently. ##' @title Retrieve real-time data from AlphaVantage ##' @param sym Character string value for the ticker ##' @param datatype Character string value for the supported type of data, currently one of ##' \dQuote{intraday}, \dQuote{daily}, \dQuote{adjdaily}, \dQuote{weekly}, \dQuote{monthly}. ##' @param outputsize Character string value, one of \dQuote{compact} or \dQuote{full}. Applies ##' only daily or intraday data. ##' @return A data.table object ##' @author Dirk Eddelbuettel alphavantage <- function(sym, datatype=c("intraday", "daily", "adjdaily", "weekly", "monthly"), outputsize=c("compact", "full")) { datatype <- match.arg(datatype) outputsize <- match.arg(outputsize) datatypeArg <- switch(datatype, intraday = "TIME_SERIES_INTRADAY", daily = "TIME_SERIES_DAILY", adjdaily = "TIME_SERIES_DAILY_ADJUSTED", weekly = "TIME_SERIES_WEEKLY", monthly = "TIME_SERIES_MONTHLY") cmd <- paste0("https://www.alphavantage.co/query?", "function=", datatypeArg, "&", "symbol=", sym, "&", "interval=1min&", "apikey=", getOption("alphavantageKey", "demo"), "&", "datatype=csv&") if (datatype %in% c("intraday", "daily", "adjdaily")) { cmd <- paste0(cmd, "outputsize=", outputsize) } #print(cmd) data <- data.table::fread(cmd, showProgress=FALSE) }
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
On Mon, Nov 6, 2017 at 9:41 AM, Dirk Eddelbuettel <edd at debian.org> wrote:
Credit where credit is due---the 'tidyquant' folks first mentioned it, but it
FWIW, I'm not sure when 'tidyquant' folks first mentioned it, but Paul wrote his first implementation in early July--it just didn't make it into quantmod until months later. The first commit of the 'alphavantager' package was in early September.
in the fullest and most glorious tradition of the tibbliesverse require half a dozen or more other packages for not apparent reason. So I followed up with a quick tweet on Sep 5 about a one-liner not needing anything else besides data.table: https://twitter.com/eddelbuettel/status/905066349294219264 and cooked up a helper function in a so-far-unreleased package of personal functions (this one is below) which I shared with at least Josh. The larger function added to quantmod is AFAIK contributed by Paul. Now, as for interchaning with them: Nope. I too need ETFs, Canadian stocks and whatnot for the little personal finance app I have had as a daily cronjob since the 1990s (and been meaning to rewrite in R since then too as it is, gasp, Perl -- see eg https://github.com/eddelbuettel/beancounter and other online resources). It may now be time to rewrite this as the underlying (Perl) data grabber Finance::YahooQuote is now dead due to Yahoo! walking away from that API. I have an unpublished R-based drop-in replacement for just the data gathering ... Anyway, alphavantage looks good. We should test it some more. Dirk ##' Fetch a real-time market data series from AlphaVantage ##' ##' Several optional parameters could be set, but are not currently. ##' @title Retrieve real-time data from AlphaVantage ##' @param sym Character string value for the ticker ##' @param datatype Character string value for the supported type of data, currently one of ##' \dQuote{intraday}, \dQuote{daily}, \dQuote{adjdaily}, \dQuote{weekly}, \dQuote{monthly}. ##' @param outputsize Character string value, one of \dQuote{compact} or \dQuote{full}. Applies ##' only daily or intraday data. ##' @return A data.table object ##' @author Dirk Eddelbuettel alphavantage <- function(sym, datatype=c("intraday", "daily", "adjdaily", "weekly", "monthly"), outputsize=c("compact", "full")) { datatype <- match.arg(datatype) outputsize <- match.arg(outputsize) datatypeArg <- switch(datatype, intraday = "TIME_SERIES_INTRADAY", daily = "TIME_SERIES_DAILY", adjdaily = "TIME_SERIES_DAILY_ADJUSTED", weekly = "TIME_SERIES_WEEKLY", monthly = "TIME_SERIES_MONTHLY") cmd <- paste0("https://www.alphavantage.co/query?", "function=", datatypeArg, "&", "symbol=", sym, "&", "interval=1min&", "apikey=", getOption("alphavantageKey", "demo"), "&", "datatype=csv&") if (datatype %in% c("intraday", "daily", "adjdaily")) { cmd <- paste0(cmd, "outputsize=", outputsize) } #print(cmd) data <- data.table::fread(cmd, showProgress=FALSE) } -- http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2017 | www.rinfinance.com
And my implementation. Not finished, but works well for me... Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20171106/414c6a93/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: src.av.R Type: application/octet-stream Size: 2271 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20171106/414c6a93/attachment.obj>
On 06/11/2017 10:41 AM, Dirk Eddelbuettel wrote:
Credit where credit is due---the 'tidyquant' folks first mentioned it, but it in the fullest and most glorious tradition of the tibbliesverse require half a dozen or more other packages for not apparent reason. So I followed up with a quick tweet on Sep 5 about a one-liner not needing anything else besides data.table: > https://twitter.com/eddelbuettel/status/905066349294219264 and cooked up a helper function in a so-far-unreleased package of personal functions (this one is below) which I shared with at least Josh. The larger function added to quantmod is AFAIK contributed by Paul. Now, as for interchaning with them: Nope. I too need ETFs, Canadian stocks and whatnot for the little personal finance app I have had as a daily cronjob since the 1990s (and been meaning to rewrite in R since then too as it is, gasp, Perl -- see eg https://github.com/eddelbuettel/beancounter and other online resources). It may now be time to rewrite this as the underlying (Perl) data grabber Finance::YahooQuote is now dead due to Yahoo! walking away from that API. I have an unpublished R-based drop-in replacement for just the data gathering ... Anyway, alphavantage looks good. We should test it some more.
I'm not so sure. I haven't noticed any problems in their data (though I haven't done extensive testing), but in my opinion it is a bad sign if there's no way to contact them. Duncan
Dirk
##' Fetch a real-time market data series from AlphaVantage
##'
##' Several optional parameters could be set, but are not currently.
##' @title Retrieve real-time data from AlphaVantage
##' @param sym Character string value for the ticker
##' @param datatype Character string value for the supported type of data, currently one of
##' \dQuote{intraday}, \dQuote{daily}, \dQuote{adjdaily}, \dQuote{weekly}, \dQuote{monthly}.
##' @param outputsize Character string value, one of \dQuote{compact} or \dQuote{full}. Applies
##' only daily or intraday data.
##' @return A data.table object
##' @author Dirk Eddelbuettel
alphavantage <- function(sym,
datatype=c("intraday", "daily", "adjdaily", "weekly", "monthly"),
outputsize=c("compact", "full")) {
datatype <- match.arg(datatype)
outputsize <- match.arg(outputsize)
datatypeArg <- switch(datatype,
intraday = "TIME_SERIES_INTRADAY",
daily = "TIME_SERIES_DAILY",
adjdaily = "TIME_SERIES_DAILY_ADJUSTED",
weekly = "TIME_SERIES_WEEKLY",
monthly = "TIME_SERIES_MONTHLY")
cmd <- paste0("https://www.alphavantage.co/query?",
"function=", datatypeArg, "&",
"symbol=", sym, "&",
"interval=1min&",
"apikey=", getOption("alphavantageKey", "demo"), "&",
"datatype=csv&")
if (datatype %in% c("intraday", "daily", "adjdaily")) {
cmd <- paste0(cmd, "outputsize=", outputsize)
}
#print(cmd)
data <- data.table::fread(cmd, showProgress=FALSE)
}
I?ve been using them for EOD prices for several months for US and European equities. In a few cases, I?ve noticed some EOD prices for T-1, T-2 that change on T. Apart from this, I have not found a better alternative that is free and also adjusted for dividends and splits. Best, Sal
On Nov 6, 2017, at 12:37 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: On 06/11/2017 10:41 AM, Dirk Eddelbuettel wrote:
Credit where credit is due---the 'tidyquant' folks first mentioned it, but it in the fullest and most glorious tradition of the tibbliesverse require half a dozen or more other packages for not apparent reason. So I followed up with a quick tweet on Sep 5 about a one-liner not needing anything else besides data.table: > https://twitter.com/eddelbuettel/status/905066349294219264 and cooked up a helper function in a so-far-unreleased package of personal functions (this one is below) which I shared with at least Josh. The larger function added to quantmod is AFAIK contributed by Paul. Now, as for interchaning with them: Nope. I too need ETFs, Canadian stocks and whatnot for the little personal finance app I have had as a daily cronjob since the 1990s (and been meaning to rewrite in R since then too as it is, gasp, Perl -- see eg https://github.com/eddelbuettel/beancounter and other online resources). It may now be time to rewrite this as the underlying (Perl) data grabber Finance::YahooQuote is now dead due to Yahoo! walking away from that API. I have an unpublished R-based drop-in replacement for just the data gathering ... Anyway, alphavantage looks good. We should test it some more.
I'm not so sure. I haven't noticed any problems in their data (though I haven't done extensive testing), but in my opinion it is a bad sign if there's no way to contact them. Duncan
Dirk
##' Fetch a real-time market data series from AlphaVantage
##'
##' Several optional parameters could be set, but are not currently.
##' @title Retrieve real-time data from AlphaVantage
##' @param sym Character string value for the ticker
##' @param datatype Character string value for the supported type of data, currently one of
##' \dQuote{intraday}, \dQuote{daily}, \dQuote{adjdaily}, \dQuote{weekly}, \dQuote{monthly}.
##' @param outputsize Character string value, one of \dQuote{compact} or \dQuote{full}. Applies
##' only daily or intraday data.
##' @return A data.table object
##' @author Dirk Eddelbuettel
alphavantage <- function(sym,
datatype=c("intraday", "daily", "adjdaily", "weekly", "monthly"),
outputsize=c("compact", "full")) {
datatype <- match.arg(datatype)
outputsize <- match.arg(outputsize)
datatypeArg <- switch(datatype,
intraday = "TIME_SERIES_INTRADAY",
daily = "TIME_SERIES_DAILY",
adjdaily = "TIME_SERIES_DAILY_ADJUSTED",
weekly = "TIME_SERIES_WEEKLY",
monthly = "TIME_SERIES_MONTHLY")
cmd <- paste0("https://www.alphavantage.co/query?",
"function=", datatypeArg, "&",
"symbol=", sym, "&",
"interval=1min&",
"apikey=", getOption("alphavantageKey", "demo"), "&",
"datatype=csv&")
if (datatype %in% c("intraday", "daily", "adjdaily")) {
cmd <- paste0(cmd, "outputsize=", outputsize)
}
#print(cmd)
data <- data.table::fread(cmd, showProgress=FALSE)
}
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
On 6 November 2017 at 13:37, Duncan Murdoch wrote:
| I'm not so sure. I haven't noticed any problems in their data (though I | haven't done extensive testing), but in my opinion it is a bad sign if | there's no way to contact them. Let's call this "Duncan's Law" but let's also remember that it didn't stop Google / Alphabet from becoming a 700 billion dollar market cap company. Dirk
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
On 06/11/2017 1:54 PM, Dirk Eddelbuettel wrote:
On 6 November 2017 at 13:37, Duncan Murdoch wrote: | I'm not so sure. I haven't noticed any problems in their data (though I | haven't done extensive testing), but in my opinion it is a bad sign if | there's no way to contact them. Let's call this "Duncan's Law" but let's also remember that it didn't stop Google / Alphabet from becoming a 700 billion dollar market cap company.
But I know how to contact Google and get a response. Duncan
2017-11-06 19:37 GMT+01:00 Duncan Murdoch <murdoch.duncan at gmail.com>:
I'm not so sure. I haven't noticed any problems in their data (though I haven't done extensive testing), but in my opinion it is a bad sign if there's no way to contact them.
e.g. 2004-11-01
GS['2004-10-28/2004-11-03','Low']
Low 2004-10-28 95.80 2004-10-29 97.43 2004-11-01 9.12 2004-11-02 98.50 2004-11-03 98.68
2017-11-06 20:20 GMT+01:00 Daniel Cegie?ka <daniel.cegielka at gmail.com>:
2017-11-06 19:37 GMT+01:00 Duncan Murdoch <murdoch.duncan at gmail.com>:
I'm not so sure. I haven't noticed any problems in their data (though I haven't done extensive testing), but in my opinion it is a bad sign if there's no way to contact them.
e.g. 2004-11-01
GS['2004-10-28/2004-11-03','Low']
Low 2004-10-28 95.80 2004-10-29 97.43 2004-11-01 9.12 2004-11-02 98.50 2004-11-03 98.68
btw. data from Alpha Vantage (not from Google).
On 06/11/2017 2:20 PM, Daniel Cegie?ka wrote:
2017-11-06 19:37 GMT+01:00 Duncan Murdoch <murdoch.duncan at gmail.com>:
I'm not so sure. I haven't noticed any problems in their data (though I haven't done extensive testing), but in my opinion it is a bad sign if there's no way to contact them.
e.g. 2004-11-01
GS['2004-10-28/2004-11-03','Low']
Low 2004-10-28 95.80 2004-10-29 97.43 2004-11-01 9.12 2004-11-02 98.50 2004-11-03 98.68
Did you try reporting that to Alpha Vantage? That's the kind of thing they did respond to on Aug 17 (see https://github.com/joshuaulrich/quantmod/issues/176). Now that I read those messages more closely, it does appear they were in touch with anozari sometime in July. So perhaps it's just me they don't respond to. I was asking how to do things (and suggesting documentation and metadata additions), I wasn't reporting on data errors. Duncan Murdoch
To be fair, as long as we're not being spammed and the data works, (and it's free), ... and relatively accurate, I think we're okay. (May or may not be speaking from experience). I can visualize a scenario where a few busy people are putting this together. On Mon, Nov 6, 2017 at 3:34 PM Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
On 06/11/2017 2:20 PM, Daniel Cegie?ka wrote:
2017-11-06 19:37 GMT+01:00 Duncan Murdoch <murdoch.duncan at gmail.com>:
I'm not so sure. I haven't noticed any problems in their data (though
I haven't done extensive testing), but in my opinion it is a bad sign if there's no way to contact them.
e.g. 2004-11-01
GS['2004-10-28/2004-11-03','Low']
Low 2004-10-28 95.80 2004-10-29 97.43 2004-11-01 9.12 2004-11-02 98.50 2004-11-03 98.68
Did you try reporting that to Alpha Vantage? That's the kind of thing they did respond to on Aug 17 (see https://github.com/joshuaulrich/quantmod/issues/176). Now that I read those messages more closely, it does appear they were in touch with anozari sometime in July. So perhaps it's just me they don't respond to. I was asking how to do things (and suggesting documentation and metadata additions), I wasn't reporting on data errors. Duncan Murdoch
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Erol Biceroglu *LinkedIn <http://ca.linkedin.com/in/erolbiceroglu> | Wordpress <https://propfoliomanagement.wordpress.com/>* [[alternative HTML version deleted]]
2 days later
Early in the development of the AlphaVantage code for quantmod, I contacted support at alphavantage.co with a bug report. They replied quickly and fixed the problem. Later, I found another problem, which I reported, too. On one hand, they never replied to that e-mail. On the other hand, the problem disappeared. It left me with the impression that someone was monitoring that address but without time to spare. I do occasionally get HTTP 503 errors (Service Unavailable) when I run my downloader late at night. Have not noticed problems beyond that since they fixed the first two. Paul Teetor, Elgin, IL USA http://quantdevel.com/public
On Monday, November 6, 2017 4:17 PM, Erol Biceroglu <erol.biceroglu at alumni.utoronto.ca> wrote:
To be fair, as long as we're not being spammed and the data works, (and it's free), ... and relatively accurate, I think we're okay. (May or may not be speaking from experience). I can visualize a scenario where a few busy people are putting this together. On Mon, Nov 6, 2017 at 3:34 PM Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
On 06/11/2017 2:20 PM, Daniel Cegie?ka wrote:
2017-11-06 19:37 GMT+01:00 Duncan Murdoch <murdoch.duncan at gmail.com>:
I'm not so sure. I haven't noticed any problems in their data (though
I haven't done extensive testing), but in my opinion it is a bad sign if there's no way to contact them.
e.g. 2004-11-01
GS['2004-10-28/2004-11-03','Low']
Low 2004-10-28 95.80 2004-10-29 97.43 2004-11-01 9.12 2004-11-02 98.50 2004-11-03 98.68
Did you try reporting that to Alpha Vantage? That's the kind of thing they did respond to on Aug 17 (see https://github.com/joshuaulrich/quantmod/issues/176). Now that I read those messages more closely, it does appear they were in touch with anozari sometime in July. So perhaps it's just me they don't respond to. I was asking how to do things (and suggesting documentation and metadata additions), I wasn't reporting on data errors. Duncan Murdoch
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Erol Biceroglu *LinkedIn <http://ca.linkedin.com/in/erolbiceroglu> | Wordpress <https://propfoliomanagement.wordpress.com/>* [[alternative HTML version deleted]] _______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.