powered by
Create a twsContract for use in API calls.
twsOption(local, expiry="", strike="", right="", exch="SMART", primary="", currency='USD', symbol='', multiplier="100", include_expired='0', conId=0)
A twsContract object.
twsContract
the IB symbol requested
option expiration CCYYMM [optional]
the strike price [optional]
the requested right - ‘C’,‘CALL’, ‘P’, or ‘PUT’ [optional]
the requested exchange [optional, defaults to SMART]
the primary exchange of the security [optional]
the requested currency [defaults to USD]
the security name [optional]
the contract multiplier
should expired contracts be included [defaults to “0” (false)]
contract ID
Jeffrey A. Ryan
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.
twsOPT
Interactive Brokers: https://www.interactivebrokers.com
reqMktData, twsContract
reqMktData
opt <- twsOption("QQQAS",expiry="200901", strike="45.0", right="C")
Run the code above in your browser using DataLab