Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

has

Check For OHLC Data


Description

A set of functions to check for appropriate OHLC and HLC column names within a data object, as well as the availability and position of those columns.

Usage

is.OHLC(x)
has.OHLC(x, which = FALSE)

is.OHLCV(x)
has.OHLCV(x, which = FALSE)

is.HLC(x)
has.HLC(x, which = FALSE)

has.Op(x, which = FALSE)
has.Hi(x, which = FALSE)
has.Lo(x, which = FALSE)
has.Cl(x, which = FALSE)
has.Vo(x, which = FALSE)
has.Ad(x, which = FALSE)

is.BBO(x)
is.TBBO(x)

has.Ask(x, which = FALSE)
has.Bid(x, which = FALSE)
has.Price(x, which = FALSE)
has.Qty(x, which = FALSE)
has.Trade(x, which = FALSE)

Arguments

x

data object

which

disply position of match

Details

Mostly used internally by quantmod, they can be useful for checking whether an object can be used in OHLC requiring functions like Op, OpCl, etc.

Columns names must contain the full description of data, that is, Open, High, Low, Close, Volume or Adjusted. Abbreviations will return FALSE (or NA when which=TRUE). See quantmod.OHLC for details of quantmod naming conventions.

is.OHLC (and is.HLC, similarly) will only return TRUE is there are columns for Open, High, Low and Close. Additional columns will not affect the value.

Value

A logical value indicating success or failure by default.

If which=TRUE, a numeric value representing the column position will be returned.

is.OHLC and is.HLC return a single value of TRUE or FALSE.

Author(s)

Jeffrey A. Ryan

See Also

Examples

## Not run: 
getSymbols("YHOO")

is.OHLC(YHOO)
has.OHLC(YHOO)

has.Ad(YHOO)


## End(Not run)

quantmod

Quantitative Financial Modelling Framework

v0.4.18
GPL-3
Authors
Jeffrey A. Ryan [aut, cph], Joshua M. Ulrich [cre, aut], Wouter Thielen [ctb], Paul Teetor [ctb], Steve Bronder [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.