Establish (force) a connection to TWS or IBG
As long as you are logged-in to either IB TWS or IB Gateway, and at least
one of the
clientIds is not in use, a connection will be established.
If the first attempt to connect fails, several more connection attempts will
be made until a connection is established, or the
clientIds are used up.
ConnectIB(clientIds = 1:10)
numeric vector. These will be tried one at a time in order until a connection is established.
This will first try to connect using the first value of
a call to
twsConnect. If that fails because you are
not connected to TWS, it will try to connect using
If it fails because the clientId is already in use, it will continue
trying each of the values in
clientIds until a connection is established
or there are no more to try.
a connected 'twsconn' object
1 2 3 4 5 6 7