Learn R Programming

IBrokers (version 0.10-2)

twsOption: Create a twsContract for Options

Description

Create a twsContract for use in API calls.

Usage

twsOption(local,
          expiry="",
          strike="",
          right="",
          exch="SMART",
          primary="",
          currency='USD',
          symbol='',
          multiplier="100",
          include_expired='0',
          conId=0)

Value

A twsContract object.

Arguments

local

the IB symbol requested

expiry

option expiration CCYYMM [optional]

strike

the strike price [optional]

right

the requested right - ‘C’,‘CALL’, ‘P’, or ‘PUT’ [optional]

exch

the requested exchange [optional, defaults to SMART]

primary

the primary exchange of the security [optional]

currency

the requested currency [defaults to USD]

symbol

the security name [optional]

multiplier

the contract multiplier

include_expired

should expired contracts be included [defaults to “0” (false)]

conId

contract ID

Author

Jeffrey A. Ryan

Details

A wrapper to twsContract to make ‘option’ contracts easier to specify.

Some of the optionable parameters are contingent on the request being made. Refer to the TWS documentation for details.

twsOPT is an alias.

References

Interactive Brokers: https://www.interactivebrokers.com

See Also

reqMktData, twsContract

Examples

Run this code
opt <- twsOption("QQQAS",expiry="200901", strike="45.0", right="C")

Run the code above in your browser using DataLab