Skip to content

Core Concepts

Strategy Routing

All requests can carry a strategy ID. The engine uses it to route to paper or live accounts and to tag orders for attribution.

  • Header: X-Strategy-Id: AQC-Pxxxxxx
  • Optional in SDK: TradingClient(strategy_id=...)

Contract IDs (conid)

Most market data and order endpoints accept a conid (IBKR contract identifier). Use these helpers:

python
conid = client.get_conid("AAPL")
spx_conid = client.get_index_conid("SPX")

Time Formats

  • Historical bars (get_history): period="1d", bar_size="1min"
  • Historical bars (get_historical_bars): duration="1 D", bar_size="30 mins"
  • Tick history: YYYYMMDD-HH:MM:SS
  • Calendar/trading days: YYYY-MM-DD

Order Confirmations

Some IBKR orders return a confirmation prompt. Use force=True on order requests to auto-confirm warnings.

Data Availability

Some data depends on IBKR subscriptions:

  • Options OI/volume
  • Level 2 depth
  • Certain greeks/market data fields

When unavailable, the SDK returns empty datasets with a note.

Engine Status

python
status = client.get_status()

Use this to quickly validate connectivity and gateway readiness.