Running IBKR Scripts via TWS/IB Gateway in the Cloud (US Server – EU User)

Discussion in 'Interactive Brokers' started by Maverick2608, Jun 24, 2025 at 2:54 AM.

  1. I’ll reach out to IBKR directly as well, but I’m curious if anyone here has experience with this.

    If you’re based in Europe, is it acceptable to run automated trading scripts through IB Gateway or TWS hosted on a cloud server located in the US? In that case, the connection would originate from a US-based IP address.

    Has anyone run into compliance or security issues with this setup?
     
  2. spy

    spy

    Why do you want to do this? They have a few data centers/farms in different parts of the world.

    You can figure out which ones you connect to from the HELP > DATA CONNECTIONS menu (at least in TWS, might be the same in IBGW, can't remember) and using standard network tools to sniff around. If you're a graybeard and know how to use netstat that's probably easiest and most direct.

    Then, you should determine which one is nearest to you and find a cloud nearby. Placing your server in the US if you're a European customer doesn't make a lot of sense.
     
    Last edited: Jun 24, 2025 at 3:27 AM
  3. It makes more sense for me to host the script on a US-based cloud server, closer to both the exchanges and IBKR’s US infrastructure to minimize round-trip latency on both data and order routing.

    As far as I know, IBKR doesn't let you manually pick which regional gateway you connect to — it's based on your IP and server location. By running the script from a US cloud, I should be automatically routed through IBKR's US data center.
     
  4. spy

    spy

    Can't say I agree with you unless maybe you'll be direct routing all your orders to US exchanges. Even then, it will have to hop to IBKR first and I certainly wouldn't expect to compete w/ big high frequency outfits who colo at the xchange itself.

    But, if you're dead set, you can always FAFO.

    Out of curiosity... why aren't you happy trading EU assets? You trying to arb ADRs or something "wild"?
     
    Last edited: Jun 24, 2025 at 4:00 AM
  5. Businessman

    Businessman

    I haven't used IB in years, but you used to be able to send a request to IB and change which primary server centre you wanted to use for your account, one of US/Europe/Asia.

    And it didn't matter which location you were in. So if you were in the US but traded mainly Asian stuff you could send orders direct to IB's Asian servers, instead of sending to the US server which then routed them to the Asian server.
     
    Maverick2608 likes this.
  6. spy

    spy

    I don't doubt it. IIRC there was a convo about it somewhere here:

    https://groups.io/g/twsapi

    Every now and then they push some breaking changes in the newer versions though (and ofc they retire the older versions, lol).
     
  7. Businessman

    Businessman

    If they still offer that, then OP wants to request his orders are routed directly to IB US servers and not European servers, otherwise it is pretty pointless hosting his scripts on a US server. Would be slower in fact.
     
    spy likes this.
  8. spy

    spy

    You'll find your answer somewhere in groups.io OP. I'd definitely think twice about what you're trying to accomplish though... very well could be a wild goose chase.

    As businessman alludes, these days they could actually choose the server farm you connect to by domicile of your account. IDK
     
    Last edited: Jun 24, 2025 at 4:25 AM
  9. You have to comply with regulations in the region.

    I can imagine that using a VPS in the US is not allowed if you have an European account.

    Either way, the sever in Ireland(the main point in Europe) compared to the US would delay about 25ms. It might not be worth the trouble.
     
  10. Robert Morse

    Robert Morse Sponsor

    Good morning Maverick2608 - QuantVPS is a Sponsor here on Elite Trader that offers access for automated traders in New York and Chicago. I suggest you reach out to them. In addition, for any IBKR customer having issues with their API, the Lightspeed Connect API besides clearing at Wedbush Securities can also offer the API to IBKR customers. Feel free to reach out to me and I can introduce you to our API rep to IBKR at Lightspeed.

     
    Maverick2608 likes this.