Learn R Programming

FinancialInstrument (version 1.3.1)

ls_instruments_by: Subset names of instruments

Description

list names of instruments that have an attribute that matches some value

Usage

ls_instruments_by(what, value, in.slot = NULL, pattern = NULL,
  match = TRUE)

Arguments

what

What attribute? (e.g. “currency”, “type”, “strike”, etc.)

value

What value must the attribute have? (e.g. “EUR”, “option”, 100, etc.). If missing or NULL, the names of all instruments that have a what slot will be returned

in.slot

If the attribute you are looking for is stored inside another slot, this is the name of that slot. (usually "IB")

pattern

only return instruments with pattern in the name

match

should pattern match names exactly?

Value

chr vector of instrument names

Details

list instruments that have a given attribute level with a given value.

See Also

buildHierarchy, instrument.table, ls_instruments

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
stock(c("GOOG","INTC"),currency("USD"))
synthetic("SnP","USD",src=list(name='^GSPC',src='yahoo'))
ls_instruments_by('type','stock')
ls_instruments_by("name",NULL,in.slot='src')
ls_instruments_by('src',NULL)
# }

Run the code above in your browser using DataLab