Interactive Brokers API: Trader Workstation (TWS) vs. IB Gateway

In https://www.interactivebrokers.com/en/index.php?f=5041&ns=T it is written that in order to use IB api you need to connect to it via TWS or IB Gateway.

Our API requires connectivity through Trader Workstation (TWS) or IB Gateway.

What is the advantage of each of them? Which solution (Gateway or TWS) provides the best performance?

+7
java interactive-brokers tws
source share
2 answers

Gateway does not have a TWS GUI, but the same API is provided.

IB writes about performance:

IB Gateway provides an alternative to TWS with a low resource for connecting to the IB trading system through the API. The gateway uses 40% less system resources than TWS. However, the gateway does not have a graphical interface, which means that you cannot view API activity as you can when starting TWS.

It also has the advantage of automatically logging out of TWS:

according to "Frequently Asked Questions about TWS for Dmitry":

You can also use IB Gateway, which is essentially a striped version of TWS. Unlike TWS, IB Gateway will try to keep in touch with IB for much longer than 24 hours. There is no guarantee that IB Gateway will support the connection for more than a week, but it will happen.

If you do not need the full TWS GUI during development or during the deployment of your application, use a gateway. It provides the same API features with much less overhead.

For all kinds of TWS API-related questions, I suggest taking a look at the IB TWS API of Yahoo Group and Frequently Asked Questions about Dmitry TWS Standards .

+9
source share

This is the answer of IB technical support:

From an API point of view, both platforms are identical. The only difference between them is that TWS has a much richer interface, thanks to which you can place orders, view charts, etc. IB Gateway is just a proxy with a simple interface, the purpose of which is to provide the most basic functions for connecting via the API.

More importantly, however, TWS requires a restart at least every 24 hours, while IB Gateway can run indefinitely.

+5
source share

All Articles