FinancialInstrument (version 1.3.1)

make_spread_id: Construct a primary_id for a spread instrument from the primary_ids of its members

Description

Construct a primary_id for a spread instrument from the primary_ids of its members

Usage

make_spread_id(x, root = NULL, format = NULL, sep = "_")

Arguments

x

character vector of member primary_ids

root

Optional character string of root_id to use.

format

String indicating how to format the suffix_ids of the spread. If NULL (the default), or FALSE, no formatting will be done. See format_id for other accepted values for format

sep

character string to separate root_id and suffix_id

Value

character string that can be used as a primary_id for a spread instrument

See Also

spread, build_spread_symbols, build_series_symbols

Examples

Run this code
# NOT RUN {
ids <- c('VX_aug1','VX_U11')
make_spread_id(ids, format='CY')
make_spread_id(ids, format=FALSE)
make_spread_id(c("VIX_JAN11","VIX_FEB11"),root='VX',format='CY')
# }

Run the code above in your browser using DataLab