Skip to main content

QuantX OptraBot is a Options Trading Bot for automatically trading options strategies with an Interactive Brokers account.

Project description

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

optrabot-0.32.1.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

optrabot-0.32.1-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file optrabot-0.32.1.tar.gz.

File metadata

  • Download URL: optrabot-0.32.1.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for optrabot-0.32.1.tar.gz
Algorithm Hash digest
SHA256 ca3541c7498c01f0a4a5821d48d303cddbc2a907d21a853bafdeb4c1befb11c9
MD5 be6e913daf0f7c0550f8bdcda7eeac19
BLAKE2b-256 4a1fbbf9a832b119f3547b9cc92b08858027b3eceafccb1c868b3acbe08d5652

See more details on using hashes here.

File details

Details for the file optrabot-0.32.1-py3-none-any.whl.

File metadata

  • Download URL: optrabot-0.32.1-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for optrabot-0.32.1-py3-none-any.whl
Algorithm Hash digest
SHA256 18b2abd46b623daa287b0bbd620004de1ac3a5083d30b5004327e96c3394fbca
MD5 5d22cc660a2b2e9883a2e3c872aa8f0e
BLAKE2b-256 2d81583e3dc6aa4f65afb7610d27f77abf94acb053321b9476f13b88a3e2c233

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page