contract: Create a contract

Description Usage Arguments Value Examples

Description

Create a contract

Usage

1
2
3
4
5
6
7
contract(conId = 0L, symbol = "", secType = "",
  lastTradeDateOrContractMonth = "", strike = 0, right = "",
  multiplier = "", exchange = "", primaryExchange = "",
  currency = "", localSymbol = "", tradingClass = "",
  includeExpired = FALSE, secIdType = "", secId = "",
  comboLegsDescrip = "", comboLegs = NULL,
  deltaNeutralContract = NULL)

Arguments

conId

The unique IB contract identifier

symbol

The contract (or its underlying) symbol.

secType

The security type:

lastTradeDateOrContractMonth

The contract's last trading day or contract month (for Options and Futures). Strings with format YYYYMM will be interpreted as the Contract Month whereas YYYYMMDD will be interpreted as Last Trading Day.

strike

The option's strike price.

right

Put or Call. Valid values are 'P', 'PUT', 'C', 'CALL', or ” for non-options.

multiplier

The instrument's multiplier (i.e. options, futures).

exchange

The destination exchange.

primaryExchange

The contract's primary exchange. For smart routed contracts, used to define contract in case of ambiguity. Should be defined as native exchange of contract, e.g. ISLAND for MSFT. For exchanges which contain a period in name, will only be part of exchange name prior to period, i.e. ENEXT for ENEXT.BE.

currency

The underlying's currency.

localSymbol

The contract's symbol within its primary exchange. For options, this will be the OCC symbol.

tradingClass

The trading class name for this contract. Available in TWS contract description window as well.

includeExpired

If set to true, contract details requests and historical data queries can be performed pertaining to expired futures contracts. Expired options or other instrument types are not available.

secIdType

Security identifier type

secId

Security identifier.

comboLegsDescrip

Description of the combo legs.

comboLegs

The legs of a combined contract definition.

deltaNeutralContract

Delta and underlying price for Delta-Neutral combo orders.

Value

returns an object of class "contract"

Examples

1
2
3
4
ibm <- contract(symbol = "IBM", 
                secType = "STK", 
                currency = "USD", 
                exchange = "SMART")

pverspeelt/Ibrokers2 documentation built on May 23, 2019, 8:05 p.m.