define_options.IB: define option_series with IB...

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

View source: R/define_options.R

Description

define option_series with IB

Usage

1
2
define_options.IB(underlying_id, strike, expires, right = c("C", "P"),
  currency = "USD", multiplier = 100, include_expired = "1", ...)

Arguments

underlying_id

vector of underlying_ids

strike

vector of strike prices

expires

vector of expiration dates of format YYYYMM

right

"C", "P", or c("C","P")

currency

name of currency

multiplier

contract multiplier (usually 100 for equity options)

include_expired

“0” if you do not want to define expired contracts

...

other arguments to pass through to twsInstrument

Details

define option_series instruments using IBrokers

a wrapper for twsInstrument to define multiple options contracts.

Value

called for side-effect

Note

the date in the primary_id will correspond to Expiration Saturday, however, the Date in the $expires slot (and in $IB$expiry) will correspond to the Friday prior, which is the last day trading occurs.

Author(s)

Garrett See

See Also

define_options, option_series.yahoo

Examples

1
2
3
4
5
6
## Not run: 
define_options.IB('SPY',stike=125)
define_options.IB(c("SPY","DIA"),strike=seq(120,130,5))
define_options('GOOG',600,c('201109','201112'),'C',src='IB')

## End(Not run)

twsInstrument documentation built on May 2, 2019, 5:24 p.m.