Hey Brenden. New issues.
Ianfinn1994 opened this issue · 3 comments
2021-02-16 06:42:11,675 ib_insync.client INFO Connecting to 127.0.0.1:4002 with clientId 1...
2021-02-16 06:42:11,678 ib_insync.client INFO Disconnecting
2021-02-16 06:42:11,692 ib_insync.client ERROR API connection failed: ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 4002)")
2021-02-16 06:42:11,693 ib_insync.client ERROR Make sure API port on TWS/IBG is open
2021-02-16 06:42:11,694 ib_insync.IBC INFO Terminating
2021-02-16 06:42:14,971 ib_insync.IBC INFO Starting
2021-02-16 06:42:44,996 ib_insync.client INFO Connecting to 127.0.0.1:4002 with clientId 1...
2021-02-16 06:42:44,999 ib_insync.client INFO Disconnecting
2021-02-16 06:42:45,000 ib_insync.client ERROR API connection failed: ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 4002)")
2021-02-16 06:42:45,000 ib_insync.client ERROR Make sure API port on TWS/IBG is open
2021-02-16 06:42:45,001 ib_insync.IBC INFO Terminating
2021-02-16 06:42:47,966 ib_insync.IBC INFO Starting
This really is the only error im getting, boss.
Here are some things to try:
- Verify you can sign in to TWS using the same username and password, without using ThetaGang or IBC.
- Verify your 2FA settings, in particular, make sure you have API access enabled from the TWS settings.
- If you have 2FA enabled, try enabling trading access without requiring 2FA.
Everything is working fine man. Thank you for this awesome tool to add to my trading arsenal.
I had similar issues with docker container, but it turns out the I had to add --net=host
flag to docker run in order to forward TWS workstation from local into the docker container.