joshuaulrich / IBrokers

R API to Interactive Brokers Trader Workstation
65 stars 54 forks source link

tws <- twsConnect() just hangs often #28

Closed JohannesEmm closed 3 years ago

JohannesEmm commented 4 years ago

Description

I run Ibrokers with the latest verison of TWS and the API on windows. While occasionally it connects, in most cases just hangs after tws <- twsConnect() (Port, host, client id etc. are all default values, and moreover it works every 10th time or so). Even with timeout set or verbose, no output is shown, no log file create in thh TWS folder. Also, is there a rule if you should start TWS before or after R? But in either case, only works randomly for me.

Expected behavior

[Describe the behavior/output you expected]

Minimal, reproducible example

 tws <- twsConnect()

Session Info

[Insert your sessionInfo() output]
RudyMartin commented 3 years ago

How is the timeout set for the connection?

JohannesEmm commented 3 years ago

yeh thought this hsould fix it but timeout doesn change behavior at all tws <- twsConnect(verbose = T, timeout = 1)

also hangs indefinitively.

joshuaulrich commented 3 years ago

I'm not able to replicate this on my machines. I doubt it is something specific to the IBrokers package.

It would help to have your sessionInfo() output. That would give more information about your OS and environment.

One idea to try: turn off any firewalls you have running. And/or see if there's a way to trust all local connections. It might be an issue with your computer's internet settings.

JohannesEmm commented 3 years ago

well this could be it due to an ad blocker! Thanks!