addIBslot: Create a twsContract and store it in a slot of an instrument

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

Description

Creates a twsContract object, and slot in the corresponding instrument, and places the object in the slot.

Usage

1
2
3
addIBslot(symbols, sectype = "STK", exch = "SMART", primary = "",
  expiry = "", strike = "0.0", currency = "USD", right = "",
  local = "", multiplier = "", include_expired = "0", conId = 0)

Arguments

symbols

vector of character names of FinancialInstrument instruments

sectype

type of security

exch

exchange

primary

primary exchange of security

expiry

expiry

strike

strike price

currency

requested currency

right

right

local

local security name

multiplier

contract multiplier

include_expired

should expired contracts be included

conId

IB contract ID

Details

This is an old function that is not terribly useful anymore. It should probably be deprecated It is essentially a wrapper for twsContract, but it doesn't check to make sure the twsContract is valid.

The instrument must be defined before calling this function.

adds twsInstrument class to the instrument

Value

Called for it's side effect

Note

TODO: create instrument if it doesn't already exist

Author(s)

Garrett See

See Also

see instead: twsInstrument twsContract, instrument

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
currency('USD')
stock('XOM','USD',1)
addIBslot('XOM')

# This is BETTER:
stock("CVX","USD")
instrument_attr("CVX","IB",getContract("CVX"))
# the above will add the twsInstrument class
# if you have FinancialInstrument version 0.7.2 or greater

# So is this:
twsInstrument(stock("BP","USD")) #will update other details of instrument by default

## End(Not run)

gsee/twsInstrument documentation built on May 17, 2019, 8:55 a.m.