Skip to main content
InQuantWeTrust logo

Glossary

IBKR + Python glossary

A shared vocabulary for Interactive Brokers, TWS, Gateway, market data, order handling, backtesting, portfolio metrics, and Python workflows.

Search and filters

IBKR

Interactive Brokers account, contract, routing, and API concepts.

7 terms

TWS

Trader Workstation terms for desktop API development and manual review.

5 terms

Gateway

IB Gateway terms for lighter, longer-running API sessions.

3 terms

Market data

Live, delayed, historical, and permissioned data terms.

8 terms

Orders

Order types, identifiers, controls, and safety vocabulary.

8 terms

Backtesting

Research validation terms and common sources of overstatement.

7 terms

Portfolio metrics

Return, risk, exposure, and performance measurement terms.

8 terms

Python

Python environment, data, async, and reproducibility terms.

8 terms

IBKR

IBKR terms

Interactive Brokers account, contract, routing, and API concepts.

Filter IBKR
IBKR

client ID

A numeric identifier for an API connection. Multiple API clients must use distinct client IDs against the same TWS or Gateway session.

  • A duplicate client ID can cause connection conflicts or missing callbacks.

Related: API socket, TWS, IB Gateway

IBKRcontract ID

conId

IBKR's numeric contract identifier for a specific tradable instrument or contract definition.

  • A conId can reduce ambiguity, but contract metadata still needs to match the intended market and currency.

Related: contract, contract details

IBKR

Contract

The instrument descriptor sent to the IBKR API, including fields such as symbol, security type, exchange, currency, and sometimes expiry or strike.

  • Ambiguous contracts can return errors or unexpected matches; prefer explicit contract fields.

Related: conId, SMART routing, primary exchange

IBKR

IBKR account

The brokerage account context that controls permissions, balances, subscriptions, trading mode, and API access for a session.

  • Avoid posting account identifiers, statements, or raw account logs in public questions.

Related: market data subscription, paper trading, net liquidation value

IBKRIBKRIB

Interactive Brokers

A brokerage platform commonly used by active traders, developers, and institutions for global market access through desktop tools and APIs.

  • In this site, IBKR examples are technical and educational, not trading advice.

Related: TWS, IB Gateway, paper trading

IBKR

Paper trading

A simulated trading environment used to test connectivity, order logic, and workflows without intentionally placing live orders.

  • Paper trading is still a test environment: verify assumptions before adapting code to any live account.

Related: live trading, order safety, transmit flag

IBKR

SMART routing

IBKR order routing logic that can route eligible orders across venues instead of forcing a single exchange destination.

  • SMART is common in equity examples, but every order should still be reviewed for instrument, account, and routing assumptions.

Related: exchange, order route, primary exchange

TWS

TWS terms

Trader Workstation terms for desktop API development and manual review.

Filter TWS
TWS

API socket

The local network interface that TWS or IB Gateway exposes so Python clients can connect to the IBKR API.

  • Socket clients must be enabled in the local IBKR application before Python can connect.

Related: client ID, localhost, trusted IPs

TWS

paper/live ports

The local port numbers used by TWS or Gateway for API connections. Paper and live sessions often use different defaults and local settings can override them.

  • Always confirm the port inside the running IBKR application instead of assuming a tutorial default.

Related: API socket, paper trading, connection refused

TWS

read-only API

A TWS or Gateway setting that allows API clients to read account or market data while blocking order placement through that connection.

  • Read-only mode is useful for diagnostics and reporting workflows that should never submit orders.

Related: order safety, account summary, positions

TWSTWS

Trader Workstation

IBKR's desktop trading application. Developers often use TWS while building because the UI makes account state, orders, logs, and settings visible.

  • TWS is convenient for manual inspection; IB Gateway is often preferred for lighter unattended workflows.

Related: API socket, IB Gateway, paper trading port

TWS

trusted IPs

A local API security setting that limits which network addresses may connect to the TWS or Gateway socket.

  • Local examples usually expect 127.0.0.1; keep trusted IP access narrow.

Related: localhost, API socket, security

Gateway

Gateway terms

IB Gateway terms for lighter, longer-running API sessions.

Filter Gateway
Gateway

Gateway session

The authenticated runtime state of IB Gateway, including login status, API settings, and any scheduled restart behavior.

  • Plan for disconnections, daily resets, and authentication prompts in any unattended workflow.

Related: reconnect logic, session reset, heartbeat

Gateway

IB Gateway

A lighter IBKR application that exposes API connectivity without the full TWS trading desktop interface.

  • Gateway is frequently used for longer-running technical workflows, but it still requires session management and authentication planning.

Related: TWS, API socket, session reset

Gateway

reconnect logic

Application code that detects a lost IBKR API connection, waits safely, reconnects, and resubscribes only when appropriate.

  • Reconnect logic should not blindly replay orders. Treat order state and market data subscriptions separately.

Related: heartbeat, order state, market data subscription

Market data

Market data terms

Live, delayed, historical, and permissioned data terms.

Filter Market data
Market data

bar size

The duration of each historical data bucket, such as 1 minute, 5 minutes, 1 hour, or 1 day.

  • Changing bar size changes signal timing, missing-data behavior, and backtest assumptions.

Related: historical bars, resampling, time zone

Market data

historical bars

Time-bucketed historical data records such as one-minute or daily bars, often containing open, high, low, close, and volume fields.

  • Document duration, bar size, time zone, useRTH, and whatToShow before interpreting historical data.

Related: bar size, whatToShow, regular trading hours

Market data

market data subscription

An account permission that determines whether a session can receive real-time or certain historical data for an instrument or exchange.

  • Missing permissions can produce delayed data, errors, or incomplete responses.

Related: delayed data, snapshot, historical bars

Market data

pacing

IBKR request-rate constraints that limit how quickly certain market data, historical data, or scanner requests may be submitted.

  • Batch jobs should back off, cache, and retry deliberately instead of hammering the API.

Related: historical bars, rate limit, retry

Market dataRTHuseRTH

regular trading hours

A filter for market data or orders that limits behavior to a venue's regular session rather than extended-hours periods.

  • RTH assumptions should be recorded in research outputs and order examples.

Related: historical bars, outside RTH

Market data

snapshot data

A one-time market data request that returns the current available values instead of keeping an ongoing streaming subscription open.

  • Snapshots are useful for checks, but not for building a continuous tick stream.

Related: streaming market data, market data subscription

Market data

streaming market data

A live subscription where updates are pushed to the API client as values change, subject to permissions and pacing constraints.

  • Streaming subscriptions need lifecycle management so unused subscriptions are cancelled.

Related: snapshot data, pacing, tick

Market data

whatToShow

An IBKR historical data request parameter that selects the data series, such as trades, midpoint, bid, ask, or adjusted last when supported.

  • Different values can produce materially different research results.

Related: historical bars, market data subscription

Orders

Orders terms

Order types, identifiers, controls, and safety vocabulary.

Filter Orders
Orders

bracket order

A linked order structure that usually combines an entry order with profit-taking and stop-loss child orders.

  • Parent/child relationships and transmit flags must be reviewed carefully to avoid partial or unintended submissions.

Related: parent order, child order, transmit flag

Orders

limit order

An order with a specified limit price that caps the buy price or floors the sell price, while not guaranteeing execution.

  • Limit prices should be explicit and reviewed before any order is transmitted.

Related: market order, time in force, transmit flag

Orders

market order

An order intended to execute immediately at the best available price, accepting execution price uncertainty.

  • Market orders can be dangerous in thin or volatile markets. Use paper trading and explicit safeguards in examples.

Related: limit order, slippage, order safety

Ordersorder ID

orderId

The API-side order identifier used by a client session to place, track, modify, or cancel orders.

  • Do not assume order IDs are stable across all contexts; use broker callbacks and permId where appropriate.

Related: permId, order status, client ID

Orderspermanent ID

permId

An IBKR-assigned order identifier intended to remain associated with an order beyond a single client-side orderId sequence.

  • permId is useful when reconciling order records, fills, and broker callbacks.

Related: orderId, execution, fill

Orders

stop order

An order that becomes active after a stop trigger condition is met, commonly used for exits or risk controls.

  • Stop behavior differs by product and venue; verify broker documentation and paper-test logic.

Related: bracket order, trigger, risk

OrdersTIF

time in force

An order instruction that controls how long an order remains active, such as day, good-till-cancelled, or immediate-or-cancel.

  • TIF defaults can differ across order builders, instruments, or examples.

Related: limit order, order status

Orders

transmit flag

An IBKR API order field that controls whether an order or linked set is actually sent for execution when placed through the API.

  • Use paper trading and logs to verify linked order transmission behavior before adapting examples.

Related: bracket order, parent order, paper trading

Backtesting

Backtesting terms

Research validation terms and common sources of overstatement.

Filter Backtesting
Backtesting

benchmark

A reference series used to evaluate strategy returns, risk, exposure, or opportunity cost.

  • Choose a benchmark that matches the strategy's universe, currency, and investable alternatives.

Related: alpha, beta, drawdown

Backtesting

lookahead bias

A research error where a strategy uses information that would not have been known at the simulated decision time.

  • Timestamp alignment, adjusted data, and signal calculation windows are common sources.

Related: out-of-sample, walk-forward, data leakage

Backtesting

out-of-sample

Data reserved for evaluation after strategy rules or parameters have been selected using separate development data.

  • Repeatedly tuning to the out-of-sample set turns it into another in-sample set.

Related: in-sample, walk-forward, overfitting

Backtesting

slippage

The difference between an assumed execution price and the actual or modeled fill price.

  • Slippage assumptions should vary by liquidity, order type, volatility, and trade size.

Related: market order, transaction costs, fill

Backtesting

survivorship bias

A research error caused by testing only instruments that still exist or remain listed, excluding failed, delisted, or removed instruments.

  • Survivorship bias can make historical strategies look more robust than they were.

Related: universe selection, benchmark, sample period

Backtesting

transaction costs

Costs associated with trading, including commissions, fees, spreads, market impact, borrow costs, and taxes where relevant.

  • Backtests that ignore realistic costs often overstate performance.

Related: slippage, turnover, spread

Backtesting

walk-forward analysis

A validation workflow that repeatedly trains or selects parameters on one time window and evaluates them on a later window.

  • Walk-forward testing helps reveal parameter instability, but it does not guarantee future performance.

Related: out-of-sample, overfitting, sample period

Portfolio metrics

Portfolio metrics terms

Return, risk, exposure, and performance measurement terms.

Filter Portfolio metrics
Portfolio metrics

beta

A measure of sensitivity between a strategy or asset return series and a benchmark return series.

  • Beta depends on the benchmark, return frequency, and regression window.

Related: benchmark, correlation, exposure

Portfolio metrics

drawdown

The decline from a prior equity-curve peak to a later trough, usually expressed as a percentage.

  • Drawdowns can be measured on daily, intraday, or monthly series; frequency affects the result.

Related: maximum drawdown, equity curve, risk

Portfolio metrics

equity curve

A time series of portfolio value or cumulative returns used to inspect growth, drawdowns, and regime behavior.

  • Equity curves should specify whether values include cash, dividends, fees, and open positions.

Related: drawdown, CAGR, volatility

Portfolio metricsmax drawdown

maximum drawdown

The largest observed peak-to-trough decline in a selected evaluation period.

  • Maximum drawdown is path-dependent and should be interpreted with sample length and data frequency.

Related: drawdown, equity curve, recovery

Portfolio metricsNetLiqNAV

net liquidation value

An account-level value that estimates total account equity if positions were liquidated at current marks, subject to broker calculations.

  • Treat account values as sensitive and avoid sharing raw account data publicly.

Related: equity curve, cash, portfolio

Portfolio metrics

Sharpe ratio

A risk-adjusted return metric that compares excess return to return volatility over a specified period and annualization convention.

  • Sharpe ratios are sensitive to frequency, non-normal returns, costs, and the chosen risk-free rate.

Related: volatility, Sortino ratio, risk-free rate

Portfolio metrics

Sortino ratio

A risk-adjusted return metric that compares excess return to downside deviation rather than total volatility.

  • Define the target return and downside calculation window before comparing results.

Related: Sharpe ratio, downside deviation, risk

Portfolio metrics

turnover

A measure of how much of a portfolio is traded over a period, often used to estimate cost sensitivity and operational load.

  • High turnover makes cost, spread, and slippage assumptions more important.

Related: transaction costs, slippage, rebalance

Python

Python terms

Python environment, data, async, and reproducibility terms.

Filter Python
Python

asyncio event loop

Python's runtime mechanism for scheduling and running asynchronous tasks, callbacks, and coroutines.

  • Event-loop conflicts are common when combining notebooks, async broker libraries, and application frameworks.

Related: coroutine, ib_async, Jupyter notebook

Python

coroutine

An async Python function result that must be awaited or scheduled before it actually runs.

  • Warnings about an unawaited coroutine usually mean async code was constructed but never executed.

Related: asyncio event loop, await, task

Python

DataFrame

A two-dimensional labeled table, most commonly from pandas, used for market data, positions, account values, and research results.

  • Explicit column names, dtypes, index meaning, and time zones make DataFrames easier to review.

Related: pandas, Series, CSV

Python

package pinning

Recording exact or constrained dependency versions so code can be reproduced later with fewer unexpected package changes.

  • Pinning is especially helpful for pandas, broker API wrappers, and notebook examples.

Related: virtual environment, requirements.txt, lockfile

Python

Series

A one-dimensional labeled pandas object often used for a single price, return, signal, or metric time series.

  • Series index alignment can change calculations; inspect indexes before joining data.

Related: DataFrame, time series, pandas

Python

timezone-aware datetime

A Python datetime value that carries time zone information, reducing ambiguity when aligning market sessions and historical bars.

  • Always record whether timestamps are UTC, exchange-local, broker-local, or naive.

Related: historical bars, bar size, time series

Python

type hints

Python annotations that describe expected value types for functions, variables, and data structures.

  • Type hints improve reviewability for trading and data pipelines where implicit shapes are risky.

Related: mypy, dataclass, pydantic

Pythonvenv

virtual environment

An isolated Python environment that keeps project dependencies separate from the system Python and other projects.

  • Use one environment per project to make IBKR and data-analysis examples reproducible.

Related: package pinning, requirements.txt, dependency drift

Educational boundary

This content is for educational and technical research purposes only. It is not financial advice, investment advice, trading advice, tax advice, or legal advice. Backtests and examples may contain errors or omissions. Past performance does not guarantee future results. Always test code in a safe environment before using it with real accounts or live trading systems.

Interactive Brokers, IBKR, Trader Workstation, and IB Gateway are trademarks or registered trademarks of their respective owners. InQuantWeTrust is independent and is not affiliated with, endorsed by, or sponsored by Interactive Brokers.