twsConnect {IBrokers} | R Documentation |
Connect or disconnect to the Trader Workstation (TWS).
twsConnect(clientId = 1, host = 'localhost', port = 7496, verbose = TRUE, timeout = 5, filename) twsDisconnect(con)
clientId |
the unique client id to associate with |
host |
the host server |
port |
the port that the TWS is listening on |
verbose |
should the connection attempt be verbose |
timeout |
length in seconds before aborting attempt |
filename |
file containing recorded TWS data |
con |
a valid twsConnection object |
Returns a twsConnection
object for use in
subsequent TWS API calls. Attempting to create another
connection to the server with the same clientId will
result in an error.
If filename
is set to a file containing
data recorded in the standard TWS format - calls
using this connection will playback the recorded
data.
A twsConnection
object.
While it is not strictly required to disconnect via twsDisconnect
it is probably advisable.
If not set options(digits.secs=6) will be called internally to properly represent on screen the R based timestamps.
Jeffrey A. Ryan
Interactive Brokers: www.interactivebrokers.com
## Not run: tws <- twsConnect() twsDisconnect(tws) ## End(Not run)