Interactive Brokers (REST) Backtesting¶
LumiBot supports backtesting with Interactive Brokers Client Portal (REST) via the shared Data Downloader service.
This backtesting path does not use the legacy TWS API.
Quick Start¶
Ensure you have access to a Data Downloader deployment that supports IBKR (
/ibkr/...routes).Configure the downloader connection:
export DATADOWNLOADER_BASE_URL="http://data-downloader.lumiwealth.com:8080"
export DATADOWNLOADER_API_KEY="..."
Select IBKR for backtesting:
export BACKTESTING_DATA_SOURCE="ibkr"
Supported Data¶
Futures: contract bars via IBKR historical endpoints (1-minute+ bars).
Spot crypto: IBKR crypto bars (availability depends on region and IBKR product support).
Caching¶
IBKR backtests cache historical bars as Parquet:
Local:
LUMIBOT_CACHE_FOLDER/ibkr/...Optional S3 mirroring: configured via the standard
LUMIBOT_CACHE_*variables (see Environment Variables).
Multi-provider routing (Theta + IBKR)¶
To use multiple providers in a single backtest (example: ThetaData for options/stocks/indexes and IBKR for futures/crypto), set a JSON mapping in BACKTESTING_DATA_SOURCE:
export BACKTESTING_DATA_SOURCE='{"default":"thetadata","stock":"thetadata","option":"thetadata","index":"thetadata","future":"ibkr","crypto":"ibkr"}'
Routing values are case/whitespace/_/- insensitive. For crypto, you may also route to CCXT by using either "ccxt" (auto-select exchange) or a CCXT exchange id directly (for example: "coinbase" or "kraken").
Market Data Subscriptions (IBKR)¶
IBKR requires appropriate market data entitlements to access market data via the API. IBKR notes that historical bars are part of Level 1 entitlements and that crypto does not require additional market data subscriptions:
For CME futures (ES/MES/NQ/MNQ), note that the cheap CME S&P Indices subscription is for index data, not futures contracts. Professional subscriber pricing and package availability can differ, so confirm your exact costs in the IBKR Market Data Subscriptions page and pricing table:
Authentication / Session Behavior¶
The Client Portal Gateway is session-based; if the session becomes unauthenticated, the gateway must be re-authenticated. IBKR documents the expected authentication lifecycle and recommends using /iserver/auth/ssodh/init to re-authenticate in most scenarios: