Description Usage Arguments Details Value Note Author(s) References See Also Examples
Create a twsContract for use in API calls.
1 2 3 4 5 6 7 8 9 10 11 |
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 |
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.
A twsContract
object.
Option contracts on the TWS have certain rules which are different than standard data requests.
The local
symbol is required. This can be found on the main TWS
screen under contract details, or via the web at www.interactivebrokers.com
Since the local symbol is required, all other values are redundant. It is best to simply specify the local name and let the TWS manage the lookup.
The expiry
needs to be either of class Date
to be coerced to
a string of format ‘CCYYMM’, or provided in that format.
Historical requests cannot be for a barSize=‘1 D’ or less frequent.
barSize
must be "1 min" per Interactive Brokers API.
Jeffrey A. Ryan
Interactive Brokers: www.interactivebrokers.com
1 | opt <- twsOption("QQQAS",expiry="200901", strike="45.0", right="C")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.