Is it possible to run an IB (Interactive Brokers) Gateway as a Windows service? I would like to operate a 7/24 solution without the need to log on the OS.
IB gateway will/ should reboot 1x per week, TWS each day. in the weekends you will loose your connection to Interactive Brokers as the take the servers offline for servicing.
You will need to kill the process at end of trading and restart it Sunday (depending on your time zone) before markets open.
There are some scripts that seem to work like for a while depending on the method of authentication with Interactive Brokers.
We have solved it by looking at the window handles belonging to the IBGATEWAYY process and if it's the login window then we basically send keys to the login dialogbox.
Have a look at UI automated testing tools like Selenium, I use C# so for me it's easy, have a look at this for Inspiration if the above script and selenium doesn't work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With