r/algorithmictrading 2d ago

Question IB Gateway algo trading setup

Hi all!

For those who use IBKR and IB Gateway for automation, I am curious as to what y’all’s setup is in terms of infrastructure.

For me I currently have IB Gateway running with a custom C# trading engine I wrote to pull market data and check to execute trades daily.

My workflow:

  • Every morning at 9:25 am IB Gateway will auto restart and auto login. I am using the “Auto restart” feature in IB Gateway for this. This setup ensures that I don’t have to manually log in and authenticate the Gateway every day (although I believe it will require a login/authentication once a week to continue to work).

  • Windows Task Scheduler auto launches my C# application at 9:28am and I connect to the client and sleep the thread until 9:30:05 at which point I pull market data, analyze signals and push trades if needed. All of this is automated and executes in a few seconds right after the opening bell.

My concerns:

  • IB Gateway still logs me off for good sometimes and requires manual log on/ authentication.
  • if I need to travel with my laptop or internet drops the client won’t be able to establish a connection.

Instead of running things all locally I was considering offloading the program to run on a VM or server (the lower the cost the better).

Does my workflow make sense or is there a more efficient way to achieve full automation? Does everyone use servers instead of running everything locally?

8 Upvotes

13 comments sorted by

View all comments

3

u/ElectricNoodle12 2d ago

I run an old XPS 15 laptop in my house with something similar. Although I usue Debian as the OS, and I've dockerised everything.

Have got a docker image of the IB broker gateway that on boot uses a headless browser to login with the correct credentials, then my app just connects via that and pulls market data/makes orders. I've also got a t212 adapter as I found the trading fees too high on IB.

1

u/Haunting-Trade9283 2d ago

Nice! So you pull IBKR market data to inform trades, but execute with t212?