option_id: make primary_ids for options...

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

make primary_ids for options

Usage

1
option_id(underlying_id, strike, month, year, right = c("C", "P"))

Arguments

underlying_id

chr vector of names of underlyings.

strike

vector of strike prices

month

numeric vector of months (partial matches to month.name will also work)

year

numeric vector of years (can be 1 digit, 2 digit, or 4 digit years)

right

‘C’ or ‘P’ (‘call’ and ‘put’ will also work)

Details

create a primary_id for options. The only difference between the ids this generates, and those of the Option Symbology Initiative (OSI) is that these have an underscore separating the primary_id from the suffix_id. The format for a 125 strike call on SPY expiring in December of 2011 would be ‘SPY_111217C120’. The first 6 digits of the suffix correspond to the expiration YYMMDD where DD is calculated as the Saturday following the 3rd Friday of the month.

Value

chr vector of primary_ids (or suffix_ids if underlying_id is missing, NULL, or “”) for option_series

Note

does not support weekly or EOM options

Author(s)

Garrett See

See Also

future_id, build_series_symbols, build_spread_symbols

Examples

1
2
3
option_id("SPY",125,'Sep',2011,'C')
option_id("SPY",130,1:12,11,'C')
option_id(c("SPY","DIA"),seq(120,130,5))

gsee/twsInstrument documentation built on May 17, 2019, 8:55 a.m.