Connect Quantrocket to a TWS or IB Gateway running on another machine

Hi.
I would like to know if is it possible to connect QR to a TWS or IB Gateway running on another machine

Would it work to go in the other direction and connect the other machine to QR's IB Gateway? That can be done by putting something like the following in docker-compose.override.yml:

version: '2.4'
services:
  ibg1:
    ports:
      # map port 4001 on the host machine to 
      # port 4001 inside the ibg1 container
      - '4001:4001'

To connect to IB Gateway from the other machine, you could would connect to <hostname_or_ip_of_machine_running_QR>:4001. If for some reason port 4001 is already taken on the host machine, you can map a different host port, e.g. '4002:4001' , and then connect to <hostname_or_ip_of_machine_running_QR>:4002.

Hi, Brian.

Unfortunately, no. I was aware of this method and have used it in the past, but now I need to connect QR to an external TWS or IB Gateway.

Have you any suggestions about how this could be achieved?

Thanks!

If the remote IB Gateway were running inside another deployment of QuantRocket, it might be possible to connect them by making it all look like one Docker network. But I haven’t tried that and I'm not sure if it's possible. Regardless, the remote IB Gateway would have to be running in another QR deployment because the QR services are designed to query the ibgrouter service to figure out which ibg services are running before connecting to them, so it wouldn’t work to take ibgrouter out of the equation as then the QR services wouldn't know where to look for IB Gateway.