extrange / ibkr-docker

Run IBKR Gateway/TWS in a Docker container
159 stars 34 forks source link

Cannot connect to TWS/ IB Gateway on GCP #52

Closed MarioMZhang closed 9 months ago

MarioMZhang commented 9 months ago

Hi there,

I'm working on google cloud and got this error when connecting image image I had the global configuration set on localhost:6080 image

from the docker's log, i feel like I can connect to the API port image there is no connection refused log as in #16

Could anyone help? Thanks in advance!

extrange commented 9 months ago

Have you forwarded the ports in docker-compose.yml?

MarioMZhang commented 9 months ago

Have you forwarded the ports in docker-compose.yml?

Thanks for the reply! do you mean forwarding port 4002 or 7497? do we have a pointer to forward ports? And I had put 127.0.0.1 into trusted IP in the setting here is my compose.yml

image
MarioMZhang commented 9 months ago

Have you forwarded the ports in docker-compose.yml?

are we supposed to use app.connect('127.0.0.1',8888,xxx). I feel like I misunderstood the readme

MarioMZhang commented 9 months ago

Hi @extrange , after changing the port to 8888, I was able to connect, but not sure if it's the right way to do so. if so, how do I know if I'm on live or paper mode? Thanks!

extrange commented 9 months ago

That's correct, port 8888 is where the TWS API is being exposed.

You can set the mode with the variable IBC_TradingMode (default live).