getIBEquities: requests historical data for stocks from IB

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

Description

A wrapper to request historical data for several symbols at once

Usage

1
2
getIBEquities(symbols, tws, barSize = "1 min", duration = "5 D",
  env = .GlobalEnv)

Arguments

symbols

character vector

tws

twsConnection object

barSize

see details for valid values

duration

timespan request covers

env

environment to put data in; also the environment to look for twsConnection object if not supplied

Details

gets Open, High, Low, Close, Volume, etc. for TRADES

The below is taken from reqHistoricalData help page, see that help for more.

Legal barSize settings are ‘1 secs’,‘5 secs’,‘15 secs’, ‘30 mins’,‘1 min’,‘2 mins’, ‘3 mins’,‘5 mins’,‘15 mins’, ‘30 mins’,‘1 hour’,‘1 day’, ‘1 week’,‘1 month’,‘3 months’, and ‘1 year’.

The duration string must be of the form ‘n S’ where the last character may be any one of ‘S’ (seconds), ‘D’ (days), ‘W’ (weeks), ‘M’ (months), and ‘Y’ (year). At present the limit for years is 1.

Value

called for its side effect

Author(s)

Garrett See

See Also

reqHistoricalData, reqHistory, getBAT, getBAThistory

Examples

1
2
3
4
## Not run: 
getIBEquities(c('SPY','DIA'))

## End(Not run)

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