Interactive Brokers API:交易者工作站 (TWS) 与 IB 网关
Interactive Brokers API: Trader Workstation (TWS) vs IB Gateway
在 https://www.interactivebrokers.com/en/index.php?f=5041&ns=T 中写道,为了使用 IB api 您必须通过 TWS 或 IB 网关连接到它。
Our API requires connectivity via Trader Workstation (TWS) or IB Gateway.
各自的优势是什么?哪种解决方案(网关或 TWS)提供更好的性能?
网关缺少TWS的GUI,但提供相同的API。
IB writes about the performance:
The IB Gateway provides a low-resource alternative to TWS for connecting to the IB trading system via the API. The gateway uses approximately 40% fewer system resources than TWS. However, the gateway is GUI-less, which means that you cannot view the API activity as you can when running TWS.
关于TWS的自动注销还有一个好处:
according to "Dmitry’s TWS API FAQ":
You can also use IB Gateway which is essentially a striped down version of TWS. Unlike TWS, IB Gateway will try to maintain a connection to IB for much longer than 24 hours. There is no guarantee that IB Gateway will keep the connection up for more than a week but this does happen.
如果您在开发或部署应用程序时不需要交易平台的完整 GUI,请使用网关。它以更少的开销提供相同的 API 功能。
对于各种 TWS API 相关问题,我建议查看 IB TWS API Yahoo Group, and "Dmitry’s TWS API FAQ"。
这是IB技术支持的回复:
From the API point of view both platforms are identical. The only difference between them is that the TWS has a much richer interface through which you can place orders, view charts, etc. The IB Gateway is just a proxy with a simple interface aimed at providing the most basic features in order to connect via the API.
More important though, the TWS requires to be restarted at least every
24 hours whereas the IB Gateway can run indefinitely.
在 https://www.interactivebrokers.com/en/index.php?f=5041&ns=T 中写道,为了使用 IB api 您必须通过 TWS 或 IB 网关连接到它。
Our API requires connectivity via Trader Workstation (TWS) or IB Gateway.
各自的优势是什么?哪种解决方案(网关或 TWS)提供更好的性能?
网关缺少TWS的GUI,但提供相同的API。
IB writes about the performance:
The IB Gateway provides a low-resource alternative to TWS for connecting to the IB trading system via the API. The gateway uses approximately 40% fewer system resources than TWS. However, the gateway is GUI-less, which means that you cannot view the API activity as you can when running TWS.
关于TWS的自动注销还有一个好处:
according to "Dmitry’s TWS API FAQ":
You can also use IB Gateway which is essentially a striped down version of TWS. Unlike TWS, IB Gateway will try to maintain a connection to IB for much longer than 24 hours. There is no guarantee that IB Gateway will keep the connection up for more than a week but this does happen.
如果您在开发或部署应用程序时不需要交易平台的完整 GUI,请使用网关。它以更少的开销提供相同的 API 功能。
对于各种 TWS API 相关问题,我建议查看 IB TWS API Yahoo Group, and "Dmitry’s TWS API FAQ"。
这是IB技术支持的回复:
From the API point of view both platforms are identical. The only difference between them is that the TWS has a much richer interface through which you can place orders, view charts, etc. The IB Gateway is just a proxy with a simple interface aimed at providing the most basic features in order to connect via the API.
More important though, the TWS requires to be restarted at least every 24 hours whereas the IB Gateway can run indefinitely.