nautechsystems / nautilus_trader

A high-performance algorithmic trading platform and event-driven backtester
https://nautilustrader.io
GNU Lesser General Public License v3.0
1.7k stars 400 forks source link

Refactor InteractiveBrokers client and gateway configuration #1692

Closed rsmb7z closed 3 weeks ago

rsmb7z commented 4 weeks ago

Pull Request

The InteractiveBrokersGateway has been renamed to DockerizedIBGateway to better reflect its purpose. Additionally, the start parameter has been removed. This commit also updates how it manages the connection to TWS or Gateway, which now requires explicit connection parameters unless using DockerizedIBGatewayConfig. The documentation has been updated, and a simplified example has been added.

Type of change

How has this change been tested?

Existing tests pass and tested live.

cjdsellers commented 4 weeks ago

Awesome thanks @rsmb7z and for having a look @benjaminsingleton :pray:

Looks like there might be one test issue here after two runs:

FAILED tests/integration_tests/adapters/interactive_brokers/client/test_client.py::test_start - assert False
 +  where False = <bound method Event.is_set of <asyncio.locks.Event object at 0x7fc8e697e630 [unset, waiters:1]>>()
 +    where <bound method Event.is_set of <asyncio.locks.Event object at 0x7fc8e697e630 [unset, waiters:1]>> = <asyncio.locks.Event object at 0x7fc8e697e630 [unset, waiters:1]>.is_set
 +      where <asyncio.locks.Event object at 0x7fc8e697e630 [unset, waiters:1]> = InteractiveBrokersClient(INTERACTIVE_BROKERS-001)._is_client_ready
rsmb7z commented 4 weeks ago

Looks like there might be one test issue here after two runs:

Yes for some reason failing only on 3.12, working on to diagnose.