histQuote {TShistQuote} | R Documentation |
Get a time series (matrix) from stock quote URL
histQuote() ## S4 method for signature 'character, ## TShistQuoteConnection': TSget(serIDs, con, TSrepresentation = options()$TSrepresentation, tf = NULL, start = tfstart(tf), end = tfend(tf), names=serIDs, quote = "Close", quiet = TRUE, ...) ## ## S4 method for signature 'ANY, character, ## TShistQuoteConnection': TSput(x, serIDs=seriesNames(data), con, ...) ## S4 method for signature 'histQuoteDriver, ## character': TSconnect(drv, dbname, user="", password = "", host="", ...) ## S4 method for signature 'character, ## TShistQuoteConnection': TSdates(serIDs, con, ... ) ## S4 method for signature 'character, ## TShistQuoteConnection': TSdescription(x, con, ... ) ## S4 method for signature 'character, ## TShistQuoteConnection': TSdoc(x, con, ... ) ## S4 method for signature 'character, ## TShistQuoteConnection': TSlabel(x, con, ... ) ## S4 method for signature 'TShistQuoteConnection': dbDisconnect(conn,...)
con |
a database connection object. |
conn |
a database connection object. |
serIDs |
identifiers for series on the database. |
x |
time series data(TSput), or identifiers for series on the database (TSdoc and TSdescription). |
names |
optional character vector to use for series names in the R object. |
drv |
a database driver object. |
dbname |
a character string indicating the name of a database. |
tf |
time frame for trimming data, passed to tfwindow. |
start |
time frame for trimming data, passed to tfwindow. |
end |
time frame for trimming data, passed to tfwindow. |
TSrepresentation |
time representation for returned series.
(See TSget in package TSdbi.) |
quote |
reference time (e.g. ''Close'') passed to get.hist.quote . |
quiet |
logical to suppress progress report, passed to get.hist.quote . |
user |
(unused) a character string indicating a user id. |
password |
(unused) a character string indicating a password. |
host |
(unused) a character string indicating a host computer. |
... |
Arguments passed to get.hist.quote. |
These functions interface to a stock quote URL using get.hist.quote from the
tseries
package. Only URLs ''yahoo'' and ''oanda'' are supported.
TShistQuote is just a wrapper to get.hist.quote
. No
extra functionality is provided, only an interface that is consistent
with TSdbi. The TSdbi function argument
dbname
is mapped to get.hist.quote
argument provider
, and
serId
to instrument
.
Argument quote
(ignored for provider 'oanda') is
set to ''Close'' by default, but can be specified.
get.hist.quote
argument retclass
is replaced by TSdbi
argument TSrepresentation
. (See TSget
in TSdbi for
more details on how this works.)
TShistQuote does not support writing data to the source URL.
The classes histQuoteDriver
and TShistQuoteConnection
extend classes
DBIDriver
and DBIConnection
in the DBI package.
See the package vignette for additional examples.
Depends.
TSdates
,
TSget
,
get.hist.quote
tfwindow
,
if (require("histQuote")){ con <- try(TSconnect("histQuote", dbname="ets")) if(! inherits(con, "try-error")) { x <- TSget("^gdax", con) tfplot(x) } }