Skip to content
heshimingPublic

About

IB Gateway in a headless docker container.

Topics

Resources

Stars

59 stars

Watchers

7 watching

Forks

Latest commit

 

History

49 Commits

Folders and files

Repository files navigation

IB Gateway Automation (IBGA)

IB Gateway in headless docker container.

Docker Pulls Image size ~140 MB Platforms Docs License: Apache 2.0


IBGA is IB Gateway in headless mode. It is a container image preloaded with scripts for automating user interactions with IBG, including TOTP (IBKR Mobile Authenticator App) automation and second factor support.

IBGA in action

Lightweight by design

  • Near-zero memory footprint — the automation layer is plain bash scripts plus a small JVMTI agent and a few C utilities
  • ~140 MB image — built on debian:bookworm-slim, multi-arch (linux/amd64, linux/arm64)

Benefits

  • A "docker compose" flavored configuration
  • Store username, password, time zone and other options in one place
  • Automatic installation and easy upgrade of IBG
  • Automatic handling of daily restarts beyond the one week limit, upon exit or crash
  • Automatic handling of paper trading confirmation and options dialog
  • Automatic daily export of logs
  • Retaining of settings after an upgrade
  • A disposable container design
  • Support Mobile Authenticator App automation (as of Nov 3, 2024)
  • Support two-factor authentication (as of Nov 11, 2022)

Quick start

# docker-compose.yml
services:
  my-ibga:
    image: heshiming/ibga
    restart: unless-stopped
    environment:
      - TERM=xterm
      - IB_USERNAME=username
      - IB_PASSWORD=password
      - IB_REGION=America
      - IB_TIMEZONE=America/New York
      - IB_LOGINTAB=IB API
      - IB_LOGINTYPE=Live Trading
      - IB_LOGOFF=11:55 PM
      - IB_APILOG=data
      - IB_LOGLEVEL=Error
    volumes:
      - ./run/program:/home/ibg
      - ./run/settings:/home/ibg_settings
    ports:
      - "15800:5800"   # noVNC web viewer
      - "4000:4000"    # IB Gateway API
docker compose up -d

Documentation: https://heshiming.github.io/ibga/

Under the hood

  • IBGA runs in a set of bash scripts
  • JAuto, a JVMTI agent determines screen locations of windows, text boxes, and buttons
  • xdotool simulates keyboard and mouse input
  • Xvfb, x11vnc, and noVNC provide a VNC-capable X11 environment for IBG
  • oathtool generates TOTP passcodes

Contributing

Bug reports and pull requests are welcome.

License

Apache-2.0 — see LICENSE.

About

IB Gateway in a headless docker container.

Topics

Resources

Stars

59 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages