update_instruments.IB: updates instrument metadata with data from IB

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

Description

Adds/updates information in instrument with data downloaded from IB

Usage

1
2
3
4
5
update_instruments.all(Symbols = "all", ...)

update_instruments.IB(Symbols = c("all", "stocks", "futures", "options",
  "currencies"), addIBslot = TRUE, updateInstrument = TRUE,
  include_expired = "1", assign_i = TRUE, assign_c = TRUE)

Arguments

Symbols

can be a vector of instrument names, or, can be ‘all’ or ‘stocks’ or, can also be ‘futures’, ‘options’, ‘currencies’

...

pass through arguments for update_instruments.IB and update_instruments.TTR

addIBslot

Boolean. should an IB slot be added to the instrument, making it a twsInstrument?

updateInstrument

Boolean. Should data outside the IB slot also be updated?

include_expired

Should expired contracts be included in reqContractDetails call? "0" for no, "1" for yes (default).

assign_i

should the instrument be stored in .instrument environment.

assign_c

If a new currency is discovered, should it be created

Details

These are basically wrappers for buildIBcontract. With these functions you can update some or all instruments' information from IB.

if you call update_instruments.IB with one of ‘all’ or ‘stocks’, ‘futures’, ‘options’, ‘currencies’, it is the same as calling it with the relevant ls_ function (e.g. ls_stocks()). Therefore, functionality can be extended by using ls_ functions instead of a descriptive string.

Value

called for side-effect

Author(s)

Garrett See

See Also

FinancialInstrument:::update_instruments.yahoo, twsInstrument, define_stocks www.interactivebrokers.com IB API http://interactivebrokers.com/php/apiUsersGuide/apiguide.htm?

Examples

1
2
3
4
5
6
## Not run: 
	stock('GS',currency('USD'))
	update_instruments.IB('GS')
 getInstrument("GS")

## End(Not run)

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