Learn R Programming

FinancialInstrument (version 1.3.1)

ls_by_expiry: list or remove instruments by expiration date

Description

show names of or remove instruments that expire on a given date

Usage

ls_by_expiry(expiry, pattern = NULL, match = TRUE)

rm_by_expiry(x, expiry)

Arguments

expiry

expiration date that should correspond to the ‘expires’ field of an instrument

pattern

an optional regular expression. Only names matching ‘pattern’ are returned.

match

exact match of pattern?

x

what to remove

Value

ls_by_expiry gives a vector of names of instruments that expire on the given expiry. rm_by_expiry is called for its side-effect.

Details

ls_by_expiry will find instruments that have a field named either “expiry” or “expires” with a value that matches expiry.

See Also

ls_instruments, ls_options, ls_calls, ls_puts, ls_futures, ls_derivatives

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
ls_by_expiry('20110917')
ls_by_expiry('20110917',ls_options())
# }

Run the code above in your browser using DataLab