Download Historical Finance Data
Download historical financial data from a given data provider over the WWW.
get.hist.quote(instrument = "^gdax", start, end, quote = c("Open", "High", "Low", "Close"), provider = "yahoo", method = "auto")
- a character string giving the name of the quote symbol to download. See the web page of the data provider for information about the available quote symbols.
- an R object specifying the date of the start of the
period to download. This must be in a form which is recognized by
as.POSIXct, which includes R POSIX date/time objects, objects of class <
- an R object specifying the end of the download period, see above. Defaults to yesterday.
- a character string or vector indicating whether to
download opening, high, low, or closing quotes, or volume. For the
default provider, this can be specified as
- a character string with the name of the data
provider. Currently, only
"yahoo"is implemented. See
http://quote.yahoo.com/for more information.
- tool to be used for downloading the data. See
download.filefor the available download methods.
- A time series containing the data in physical time, i.e., weekends,
holidays, and missing days are filled with
NAs. The time scale is given in Julian dates (days since 1970-01-01).
x <- get.hist.quote(instrument = "^spc", start = "1998-01-01", quote = "Close") plot(x) x <- get.hist.quote(instrument = "ibm", quote = c("Cl", "Vol")) plot(x, main = "International Business Machines Corp") spc <- get.hist.quote(instrument = "^spc", start = "1998-01-01") ibm <- get.hist.quote(instrument = "ibm", start = "1998-01-01") x <- na.remove(ts.union(spc, ibm)) plot(x, main = "IBM vs S&P 500")
Looks like there are no examples yet.