Skip to main content

OptraBot

OptraBot is a Options Trading Bot which can be used to run fully automated options trading strategies using your Interactive Brokers or Tastytrade trading account.

System requirements

Microsoft Windows, MacOS or Linux operating system

Python 3.13

For Interactive Brokers (native installation): Trader Workstation (TWS), IB Gateway or IB Client Portal Gateway

Installation

OptraBot uses the Python Package Manager UV from Astral (https://docs.astral.sh/uv/).

Use the following command for automatic installation procedure depending on your Operating System.

Windows: powershell -ExecutionPolicy ByPass -c "irm https://app.optrabot.io/static/assets/scripts/install-optrabot.ps1 | iex"

Windows Server: powershell -ExecutionPolicy ByPass -c "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; irm https://app.optrabot.io/static/assets/scripts/install-optrabot.ps1 | iex"

MacOS/Linux: curl -LsSf https://app.optrabot.io/static/assets/scripts/install-optrabot.sh | bash

This will download and automatically install UV if necessary, the correct Python version and the OptraBot itself.

Updating

The OptraBot got a auto-update functionality integrated. There is no need to update it manually.

The UV Package Manager can be updated with the command uv self update

Run OptraBot

OptraBot can be started with the following command: optrabot

Docker

OptraBot is also available as a Docker image (quantxgmbh/optrabot:latest).

Quick Start

Create a docker-compose.yaml and a data/ directory for the configuration and database:

services:
  optrabot:
    image: quantxgmbh/optrabot:latest
    container_name: optrabot
    ports:
      - "8080:8080"   # HTTP – for CDN/reverse proxy origin or direct access
      # - "8443:8443" # Optional: direct local HTTPS access (required for IB Web SSO)
    volumes:
      - ./data:/optrabot  # config.yaml and database are stored here
    environment:
      - IBGW=true         # Set to true to start the IB Client Portal Gateway inside the container
    restart: unless-stopped

Then start the container:

docker compose up -d

The OptraBot UI is then accessible at http://<host>:8080.

Environment Variables

Variable Values Description
IBGW true / false (default) Starts the IB Client Portal Gateway inside the container and routes IB API traffic via nginx

Ports

Port Protocol Description
8080 HTTP Main entry point – suitable as CDN/reverse proxy origin or for direct access
8443 HTTPS (self-signed) Optional – required for local browser-based IB Web SSO login (Secure cookies)

Note: When using Interactive Brokers Web API (ibweb) with local SSO login, use the HTTPS port 8443.

Interactive Brokers in Docker

When running OptraBot in Docker with IBGW=true, the connection to Interactive Brokers is established via the IB Client Portal Gateway, which is bundled inside the container. This is different from the native installation, where Trader Workstation (TWS) or a standalone IB Gateway on the host machine is used.

The IB Client Portal Gateway requires a one-time browser-based login (SSO). Because the SSO session cookie is set as Secure, this login must be performed over HTTPS. Make sure to:

  1. Add the port mapping 8443:8443 in your docker-compose.yaml
  2. Open https://<host>:8443 in your browser to complete the IB login
  3. Accept the self-signed certificate warning in the browser

After a successful login, OptraBot can communicate with Interactive Brokers via the gateway running inside the container.

Note: Port 8080 (HTTP) is not suitable for the IB SSO login — use 8443 (HTTPS) for any browser-based IB authentication.

Configuration

On first start, the setup wizard launches automatically if no config.yaml is found in the mounted data/ directory. It guides through the initial configuration step by step. An existing config.yaml can also be imported directly in the setup wizard.

Health Check

OptraBot exposes a health check endpoint at /up. Use this path for load balancer and container health checks:

http://<host>:8080/up

The endpoint returns HTTP 200 when OptraBot is running.


Disclaimer

Be aware that you're using this software at your own risk. The author is not liable for any losses occuring with using this software.

Metadata

Release files for optrabot 0.34.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for optrabot 0.34.0
File Size Uploaded
optrabot-0.34.0.tar.gz 2.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for optrabot 0.34.0
File Interpreter ABI Platform
optrabot-0.34.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.0 MB

Release files / optrabot-0.34.0.tar.gz

Download URL optrabot-0.34.0.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
a897d8ef64be09678df39bf555ead30473e4851b7bd4bdefbe41bd3eb0b0ede9
BLAKE2b-256 checksum
How to use checksums
cdb1593705ce9b79060982f42a101d05d82d5a07b4b16bdc0d619c6b8f8fbff1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / optrabot-0.34.0-py3-none-any.whl

Download URL optrabot-0.34.0-py3-none-any.whl
Size 2.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
aabdd95a805ff044f0cb421febee0792e85c93c50c1184adda9f3a259d281270
BLAKE2b-256 checksum
How to use checksums
e62a7a45d5fd5aa6879669fdab33c32449fc248047d378668694dbc8b520bb4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.34.1

2 release files

This release

0.34.0 This release

2 release files

0.33.3

2 release files

0.33.2

2 release files

0.33.1

2 release files

0.33.0

2 release files

0.32.3

2 release files

0.32.1

2 release files

0.32.0

2 release files

0.31.2

2 release files

0.31.1

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.28.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.1

2 release files

0.25.0

2 release files

0.24.1

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.19.3

2 release files

0.19.2

2 release files

0.19.1

2 release files

0.19.0

2 release files

0.17.2

2 release files

0.17.0

2 release files

0.16.2

2 release files

0.15.6

2 release files

0.15.5

2 release files

0.15.4

2 release files

0.15.0

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.8

2 release files

0.13.7

2 release files

0.13.6

2 release files

0.13.5

2 release files

0.13.4

2 release files

0.13.3

2 release files

0.13.2

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page