TSdbiMethods: Methods to wrap get.hist.quote for TSdbi Generics

Description Usage Arguments Details Value See Also Examples

Description

Get a time series (matrix) from stock quote URL

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
    histQuote(...) 
    ## S4 method for signature 'histQuoteConnection,missing'
TSconnect(q, dbname, ...)
    ## 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, repeat.try=3, ...)
    ## S4 method for signature 'character,TShistQuoteConnection'
TSdates(
	serIDs, con, vintage=NULL, panel=NULL, ... )  
    ## 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 'character,TShistQuoteConnection'
TSsource(x, con, ... )  

Arguments

q

a string indicating a query interface to use, or a database connection object.

dbname

a string indicating a database or omitted if q ia a connection object.

con

a database connection object.

serIDs

identifiers for series on the database.

vintage

character string indicating vintage of the series on the database (not supported by this database).

panel

character string indicating panel of the series on the database (not supported by this 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.

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.

repeat.try

integer number of times to attempt retrieval before giving up.

...

Arguments passed to get.hist.quote.

Details

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.

Value

Depends.

See Also

TSconnect, TSdates, TSget, get.hist.quote tfwindow,

Examples

1
2
3
4
     con <- TSconnect("histQuote", dbname="yahoo") 
    x <- TSget("^ftse", con)
    require("tfplot")
    tfplot(x)

TShistQuote documentation built on Sept. 23, 2019, 3 a.m.