lightweight interactive brokers gateway docker
It's just pure IB Gateway
and don't include any VNC service (for security reason, I don't like expose extra port)
This docker image just installed:
-
IB Gateway (10.19)
-
IBC (3.14.0)
-
ib_insync (0.9.71)
-
google-cloud-secret-manager (2.11.1)
docker pull manhinhang/ib-gateway-docker
docker run -d \
--env IB_ACCOUNT= \ #YOUR_USER_ID
--env IB_PASSWORD= \ #YOUR_PASSWORD
--env TRADE_MODE= \ #paper or live
--p 4002:4002 \ #brige IB gateway port to your local port 4002
manhinhang/ib-gateway-docker tail -f /dev/null
git clone git@github.com:manhinhang/ib-gateway-docker.git
cd ib-gateway-docker
docker build --no-cache -t ib-gateway-docker .
docker run -d \
--env IB_ACCOUNT= \ #YOUR_USER_ID
--env IB_PASSWORD= \ #YOUR_PASSWORD
--env TRADE_MODE= \ #paper or live
-p 4002:4002 \ #brige IB gateway port to your local port 4002
ib-gateway-docker \
tail -f /dev/null
Example | Link | Description |
---|---|---|
ib_insync | examples/ib_insync | This example demonstrated how to connect IB Gateway |
google cloud secret manager | examples/google_cloud_secret_manager | retreive your interactive brokers account from google cloud secret manager |
The test cases written with testinfra.
Run the tests
pytest
After forking IB Gateway docker
repository, you need config your interactive brokers paper account & password in github secret
Key | Description |
---|---|
IB_ACCOUNT | your paper account name |
IB_PASSWORD | your paper account password |
Variable Name | Description | Default value |
---|---|---|
IB_GATEWAY_PING_CLIENT_ID | ib gateway client id for pinging client status | 1 |
IBGW_WATCHDOG_CONNECT_TIMEOUT | Ref to ib_insync.ibcontroller.Watchdog.connectTimeout | 30 |
IBGW_WATCHDOG_APP_STARTUP_TIME | ib_insync.ibcontroller.Watchdog.appStartupTime | 30 |
IBGW_WATCHDOG_APP_TIMEOUT | Ref to ib_insync.ibcontroller.Watchdog.appTimeout | 30 |
IBGW_WATCHDOG_RETRY_DELAY | Ref to ib_insync.ibcontroller.Watchdog.retryDelay | 2 |
IBGW_WATCHDOG_PROBE_TIMEOUT | Ref to ib_insync.ibcontroller.Watchdog.probeTimeout | 4 |
This project is not affiliated with Interactive Brokers Group, Inc.'s.
Good luck and enjoy.