ib_connect: Establish a connection to IB trader workstation or to the IB...

ib_connectR Documentation

Establish a connection to IB trader workstation or to the IB Gateway

Description

Establish a connection to IB trader workstation or to the IB Gateway

Usage

ib_connect(clientId = 1L, host = "127.0.0.1", port = 7497,
  timeout = 5, blocking = .Platform$OS.type == "windows")

is_ib_connection(x)

ib_disconnect(ib_con)

is_ib_connected(ib_con)

Arguments

clientId

The client ID used in the API connection. Default value is 1.

host

Default connection is 127.0.0.1 for the trader workstation or the IB Gateway

port

Default connection is to the paper trading account on port 7497. Live connection to TWS is on port 7496. For the IB gateway the live port is 4001 and the paper trading port is 4002.

timeout

Time to establish a connection in seconds. Default is 5.

blocking

Create a blocking connection. Defaults to TRUE on Windows, FALSE otherwise.

Value

Returns an ib_con object.

Examples

## Not run: 
ib_con <- ib_connect()
ib_disconnect(ib_con)

## End(Not run)

pverspeelt/ibapir documentation built on March 29, 2022, 11:57 a.m.