Connecting Interactive Brokers to SabrTrader
This page documents how to connect SabrTrader to an Interactive Brokers (IBKR) account so that a single API session supplies live market data, account information and order routing. It covers the SabrTrader Control Center and Connections tab, every field on the Interactive Brokers connection profile, every Trader Workstation (TWS) API checkbox that must be set, the difference between the numeric API client ID and the IBKR account ID that begins with the letter U, and a full end-to-end verification workflow. Prerequisites, paper-trading configuration, best practices, common mistakes and a symptom-cause-fix troubleshooting table are included.
Overview and prerequisites
SabrTrader connects to Interactive Brokers as an API client. It does not log into IBKR directly. Instead, it opens a TCP socket to Interactive Brokers' own desktop software — Trader Workstation (TWS) or IB Gateway — which is already logged in and which relays requests to IBKR's servers. Because IBKR exposes market data, account data and order entry through the same API session, one Interactive Brokers connection in SabrTrader is both a data feed connection and a broker connection.
This page assumes no prior knowledge of the IBKR API. It explains what each setting does, what value to enter, and how to prove the connection is working.
Prerequisites
- A funded Interactive Brokers account. The account must be open and approved for the products you intend to trade (equities, futures, options, FX). A paper-trading account alone is enough for testing, but live data and live fills require the funded account.
- TWS or IB Gateway installed and logged in on the same computer as SabrTrader (recommended) or on a machine reachable over your local network.
- Market data subscriptions for the exchanges you want live prices from, purchased inside IBKR Client Portal. Without them, quotes arrive delayed or not at all.
- SabrTrader installed and launched at least once so the default workspace and preloaded connection list exist.
- Local network permissions allowing loopback traffic on the API socket port (firewall/antivirus must not block it).
What ships out of the box
On first launch, SabrTrader opens a default workspace — a preconfigured arrangement of charts and panels — already attached to a delayed dxFeed demo data feed. The purpose of the demo feed is to make prices visible immediately so a new user can explore layout, indicators and windows before any broker is connected. Delayed data is unsuitable for live trading and unsuitable for order-flow analysis. Everything in the workspace is modular: windows can be moved, docked, resized, closed or replaced with a new blank workspace.

If you are connecting a different provider instead, see Connecting SabrTrader to Rithmic for futures and prop-firm accounts, or Connecting Your Schwab Account to SabrTrader for an OAuth-based broker link.
How the Interactive Brokers connection works
The IBKR integration is a four-hop chain. Understanding the chain makes almost every failure self-diagnosing.
- SabrTrader opens a TCP socket as an API client and identifies itself with a numeric client ID.
- The socket targets a host address and port — normally
127.0.0.1(the loopback address, meaning "this same computer") on port7496. - TWS or IB Gateway listens on that port, authenticates nothing further (your TWS login already did that), and forwards requests.
- IBKR servers return quotes, historical bars, account balances, positions and order acknowledgements back down the same path.
Consequences of this architecture
- TWS or IB Gateway must be running and logged in at all times while SabrTrader is connected. If TWS closes, restarts or logs out, the SabrTrader connection drops.
- The API must be explicitly enabled inside TWS. IBKR ships with the socket API disabled for security.
- Each connected application needs its own client ID. Two applications using the same client ID against the same TWS instance will conflict, and one will be refused or disconnected.
- There is one socket port per TWS session, and the port differs between live and paper logins. The port is the single most common source of "it connects but nothing is real" confusion.
- Data quality is inherited from IBKR. Order-flow tools such as footprint charts, delta and volume profile consume trade-by-trade ticks, so IBKR's snapshot-style consolidated feed and your entitlement level directly limit their granularity.
Trader Workstation versus IB Gateway
| Criterion | Trader Workstation (TWS) | IB Gateway |
|---|---|---|
| What it is | IBKR's full desktop trading platform with charts, order tickets, portfolio screens | A minimal, chart-less application that only hosts the API |
| API hosting | Yes, identical API surface | Yes, identical API surface |
| Default live port | 7496 | 4001 |
| Default paper port | 7497 | 4002 |
| Resource use | Higher (CPU, RAM, GUI) | Low |
| Manual visual cross-check of orders | Yes — you can see fills and positions in a familiar UI | No UI for trading |
| Best for | Learning, verification, discretionary trading alongside SabrTrader | Long unattended sessions, automation, low-resource machines |
The demonstration uses Trader Workstation, and TWS is the recommended starting point because it lets you visually confirm that orders, positions and quotes match what SabrTrader shows. Switch to IB Gateway later if you need a lighter, always-on host.
The Control Center, workspaces and the Connections tab
The Control Center is SabrTrader's primary window. It hosts the Connections tab, workspace management, and the launcher used to create new charts and components. All connection work happens here.
Step 1 — clear the workspace (optional but recommended)
Open the Workspace menu in the Control Center. A fresh installation shows a single entry named default; experienced users accumulate several saved workspaces. Closing the default workspace leaves only the Control Center on screen, which makes the connection steps easier to follow. Nothing is lost — workspaces can be reopened, recreated or replaced with a new blank layout at any time.
Step 2 — disconnect the delayed demo feed
In the connections list at the bottom of the Connections tab, select the dxFeed entry and choose Disconnect feed connection. This matters for two reasons:
- Leaving a delayed feed connected alongside IBKR can produce duplicate symbol subscriptions, and a chart may bind to the delayed source without any obvious visual warning.
- Delayed prices make order-flow tools misleading: the tape you read is 10–15 minutes stale, so any absorption, imbalance or DOM reading is historical, not actionable.

Step 3 — find Interactive Brokers in the provider list
The Connections tab contains 57 preloaded broker and data-feed configurations. Each provider row shows the asset classes it serves, so you can filter by the markets you trade. The Interactive Brokers row lists futures, equities, options and FX. Selecting a provider only highlights it — the configuration fields on the right remain locked and greyed out until you press Add.
Add creates a saved connection profile named New Interactive Brokers and unlocks the fields. This is the single step most new users miss.

Step 4 — the Interactive Brokers connection profile fields
| Field / control | What it does | What to enter |
|---|---|---|
| Connection name | The label shown in the connections list and in symbol/chart source pickers. Purely cosmetic. | Rename to something explicit, e.g. IBKR Live or IBKR Paper. Remove the word "New". |
| Application | Tells SabrTrader which IBKR host application it should expect, which drives the default port and connection handshake. |
Trader Workstation (recommended) or Gateway. |
| Host / IP | The network address of the machine running TWS. | Leave the preconfigured 127.0.0.1 when TWS and SabrTrader run on the same computer. Enter the LAN IP of the TWS machine otherwise. |
| Client ID | The numeric API session identifier that distinguishes SabrTrader from every other API application talking to the same TWS. | A small integer, e.g. 0, 1 or 10. See Client ID versus account ID. |
| Port | The TCP port TWS is listening on for API clients. Must match the TWS Socket port setting exactly. |
7496 live TWS, 7497 paper TWS, 4001 live Gateway, 4002 paper Gateway. |
| Connect | Opens the API session. | Press after TWS is logged in and the API is enabled. |
| Disconnect | Closes the API session without deleting the profile. | Use before shutting TWS down, or when switching between live and paper profiles. |
| Remove / Delete | Deletes the saved connection profile. | Disconnect first, then remove. |
| Status indicator | Shows the live state of the connection (disconnected / connecting / connected). | Read-only. Must show connected before charts will stream. |

SabrTrader supports multiple simultaneous connections. You can keep IBKR, a futures feed such as Rithmic and additional broker links active at once, and bind each chart or DOM to a specific source.
Configuring the TWS API settings (every option explained)
Nothing in SabrTrader can connect until the API is enabled inside TWS. The settings live behind the cog icon in the top-right of the TWS window, immediately to the right of your user ID: cog icon → API → Settings. In IB Gateway the same page is at Configure → Settings → API → Settings.
Required settings
| Setting | State | Explanation |
|---|---|---|
| Enable ActiveX and Socket Clients | Checked | The master switch for the socket API. While unchecked, TWS refuses every external connection attempt and SabrTrader reports a refused connection. This is the first box to check. |
| Read-Only API | Unchecked | When checked, API clients may request quotes, historical data, positions and balances but every order, modification and cancellation is rejected. It must be unchecked to trade from SabrTrader. Leave it checked deliberately if you only want charting and want to guarantee no order can be sent. |
| Socket port | 7496 (live) / 7497 (paper) | The TCP port TWS listens on. The value here must equal the Port field in the SabrTrader connection profile. IB Gateway defaults to 4001 (live) and 4002 (paper). |
| Allow connections from localhost only | Checked | A security restriction: only applications running on the same computer may open an API session. Keep it checked in the normal same-machine setup. Uncheck it only when SabrTrader runs on a different machine, and then add that machine's address under Trusted IP addresses. |
Optional and advanced settings
- Trusted IP addresses — a whitelist of remote addresses permitted to open API sessions. Required for a remote or virtual-machine setup where SabrTrader is not on the TWS computer. Add the SabrTrader machine's LAN IP and uncheck localhost-only.
- Master API client ID — if set, the client that connects with this ID receives status updates for all orders on the account, including orders placed manually in TWS or by other API applications. Useful when you want SabrTrader to see and manage every working order. Leave blank if you want each client to see only its own orders.
- Download open orders on connection — when enabled, existing working orders are pushed to the API client as soon as it connects, so SabrTrader immediately shows pre-existing orders instead of an empty order book.
- Create API message log file — writes the raw API conversation to disk. Enable it only when diagnosing a problem or when IBKR support asks for it; it adds disk activity.
- Bypass Order Precautions for API orders — suppresses the TWS confirmation pop-ups (size warnings, price-percentage warnings) that would otherwise block or delay API orders. Many order-flow workflows require this because pop-ups appear in TWS, not in SabrTrader, and silently stall the order. Understand that it removes a safety net.
- Send instrument-specific attributes / Include FX positions and similar toggles are situational; defaults are correct for most users.
After changing anything, press Apply and then OK. Pressing Cancel discards the changes. API settings are stored per TWS user profile and per installation, so a paper login and a live login each keep their own settings, and a new computer must be configured again.
Core concepts defined
These definitions apply throughout SabrTrader documentation and are used consistently on this page.
Data concepts
- Market data feed is the real-time or delayed stream of quotes, trades and depth that a platform consumes to build charts and order-flow tools.
- Delayed data is exchange data published with a lag, typically 10–15 minutes. It is legitimate for learning the platform, building layouts and configuring indicators. It is unusable for live execution or order-flow reading because every event you see already happened.
- Real-time data subscription is an exchange-level entitlement purchased through your broker that unlocks live tick data for a given market. IBKR sells these per exchange group in Client Portal; SabrTrader cannot create entitlements on your behalf.
- Market data entitlements are the exchange permissions attached to your account that determine which real-time data a platform may display. Without the relevant entitlement, prices arrive delayed even on a correctly connected session.
- Market data lines are the limited number of simultaneous streaming symbols an IBKR account may subscribe to (commonly 100 by default, expandable with quote boosters or account equity). Exceeding the limit causes symbols to be throttled or dropped rather than producing an obvious error.
- Order-flow tooling dependency on tick data: footprint, cumulative delta, DOM and volume profile are computed from individual trades and their aggressor side. If the feed aggregates or snapshots trades, these tools lose precision. Feed quality is therefore an analytical constraint, not just a convenience.
Connection concepts
- Broker connection: a connection that carries orders, balances and positions in addition to prices.
- Data feed connection: a connection that carries prices only, with no order routing or account access. dxFeed in SabrTrader is a data feed connection.
- Interactive Brokers API: the socket-based programming interface exposed by TWS or IB Gateway that lets third-party platforms request market and account data and submit orders. IBKR delivers both broker and data functions through this one session.
- Socket port: the TCP port number a listening application accepts connections on. For IBKR: 7496 live TWS, 7497 paper TWS, 4001 live Gateway, 4002 paper Gateway.
- Localhost / 127.0.0.1: the loopback address that always resolves to the local computer. Traffic sent to it never leaves the machine, which is why it is the default and most secure host value.
- Order routing: the path an order takes from SabrTrader through the API session in TWS to IBKR's smart router or a chosen venue, and finally to the exchange.
- Paper trading account: a simulated IBKR account with virtual funds that mirrors live platform behaviour. It uses a separate login and a separate socket port.
Platform concepts
- Control Center: SabrTrader's main hub window hosting the Connections tab, workspace management and the new-window launcher.
- Workspace: a saved arrangement of SabrTrader windows — charts, DOMs, panels — that can be created, named, closed and reopened.
- Asset class filtering: grouping of providers in the Connections tab by the markets they serve. IBKR is listed under futures, equities, options and FX.
- Timeframe / bar interval: the aggregation period of each chart bar. The demonstration uses 5-minute bars.
- Historical data lookback (history depth): how far back a chart requests bars when it loads. IBKR enforces pacing rules that limit how many historical requests may be made in a short window, so very deep lookbacks on many charts at once can fail or arrive slowly.
- IBKR daily auto-restart and two-factor authentication: TWS is designed to restart or log out on a daily schedule and may require a 2FA approval. Until you complete it, the API stops and the SabrTrader connection is down.
Client ID versus account ID — what actually goes in the field
This is the single most misunderstood part of the setup, and the video conflates the two identifiers. They are different values with different purposes.
| API client ID | IBKR account ID | |
|---|---|---|
| Format | A small non-negative integer, e.g. 0, 1, 7, 101
|
A string beginning with U followed by digits, e.g. U1234567
|
| Where you see it | You choose it. TWS shows connected client IDs under API → Settings and in the API log. | Displayed next to your user name in the TWS title bar and in Client Portal. |
| Purpose | Uniquely identifies one API session so several applications can share one TWS instance without conflict. | Identifies which brokerage account orders, positions and balances belong to. |
| Uniqueness | Must be unique among applications connected to the same TWS at the same time. | Fixed by IBKR; one per account. A single login may control several. |
| Goes in the SabrTrader Client ID field | Yes | No |
What to enter
-
Client ID field: type a small integer. If SabrTrader is the only API application,
0or1is fine. If you also run Excel DDE/RTD, a Python script, an EA bridge or a second SabrTrader instance, give each one a different number (for example SabrTrader1, Excel2, scripts3). - Do not paste the U-prefixed value here. A non-numeric value either fails validation or is rejected at handshake, producing a connection that never completes.
- Account selection: the U-account is used to choose which account is traded. With one account under the login, SabrTrader binds to it automatically. With multiple accounts (advisor, family, multiple sub-accounts), pick the target U-account in the order-entry or account selector before sending orders, and never leave it on an aggregate/All value, which IBKR rejects for single orders.
Avoiding client ID collisions
- Decide on a fixed client ID per application and write it down.
- If you set a Master API client ID in TWS and want SabrTrader to see every order on the account, set SabrTrader's client ID to that same number — and then make sure no other application uses it.
- Client ID
0has a historical special meaning in the IBKR API (it can receive manually placed orders). It is safe to use, but reserve it for a single application. - If a connection succeeds then instantly drops, a duplicate client ID is the most likely cause. Change SabrTrader's client ID to an unused number and reconnect.
Step-by-step: connecting SabrTrader to Interactive Brokers
- Launch and log into Trader Workstation. Use your live IBKR credentials for live trading, or your paper credentials for simulation. Complete any two-factor authentication prompt. Leave TWS running for the whole session.
- Open the TWS API settings. Click the cog icon at the top right, immediately to the right of your user ID, then choose API → Settings.
- Check Enable ActiveX and Socket Clients. This is mandatory; nothing else works until it is checked.
- Confirm Read-Only API is unchecked. If it is checked, SabrTrader will show data but every order will be rejected.
-
Confirm the socket port.
7496for a live TWS login,7497for a paper TWS login. Note the exact number. - Check Allow connections from localhost only if SabrTrader runs on the same computer. Otherwise leave it unchecked and add the remote machine's IP under Trusted IP addresses.
- Optionally set Download open orders on connection and a Master API client ID if you want SabrTrader to see orders placed elsewhere.
- Press Apply, then OK. Cancel discards everything.
- In SabrTrader, close the default workspace from the Workspace menu so only the Control Center remains. This step is optional but keeps the screen clear.
- Disconnect the dxFeed demo feed. Right-click or select the dxFeed entry in the connections list and choose Disconnect feed connection, so no delayed source competes with IBKR.
- Open the Connections tab in the Control Center and locate Interactive Brokers in the list of 57 providers. Its asset-class tags read futures, equities, options, FX.
- Press Add. A profile named New Interactive Brokers appears in your saved connections and the configuration fields unlock. Fields stay greyed out until this step is done.
-
Rename the connection to something unambiguous such as
IBKR Live. - Set Application to Trader Workstation (choose Gateway only if that is what you launched).
-
Leave Host at
127.0.0.1for a same-machine setup. -
Enter a numeric Client ID, for example
1. Do not enter the U-prefixed account number here. -
Enter the Port that matches TWS exactly —
7496live,7497paper. - Save the profile, then press Connect.
- Confirm the status indicator in the Control Center shows the connection as connected. If TWS displays an incoming-connection prompt, accept it.
-
Create your first chart. Use the Control Center's new-window menu, choose New chart, enter symbol
SPY, set the timeframe to 5 minutes, set the historical lookback to last 7 days, and confirm. - Verify live ticks. During US market hours, the last bar should update continuously, the last price should change, and volume should accumulate. If it does not, work through Verifying the connection.
- Save the workspace once your charts and panels are arranged, so the layout and data bindings reopen next session.
Verifying the connection
A green or "connected" status only proves the socket opened. Verify the four functional layers separately.
- Session state. The Control Center status indicator shows the IBKR profile as connected. In TWS, API → Settings lists the connected client ID, or the API log shows the inbound session.
- Account data. Balances, buying power and existing positions populate in SabrTrader. Empty account data with a connected status usually means Read-Only API restrictions, an unselected account, or a paper login when you expected live.
- Streaming quotes. Open a liquid symbol during market hours. Bid, ask and last must tick. A frozen last price with a moving clock indicates no entitlement, an exhausted market data line allowance, or a delayed subscription.
- Historical bars. The chart must load the requested lookback. Missing bars or a partial series points to IBKR historical pacing limits — reduce depth, reduce the number of simultaneously loading charts, and retry.
- Order path (optional, recommended). On a paper connection, send a small limit order far from the market, confirm it appears in both SabrTrader and TWS, modify it, then cancel it. This proves routing, acknowledgement and cancellation all work before you risk capital.

Telling delayed data from live data
- Delayed symbols in IBKR are typically flagged as delayed by the provider and update in visible steps rather than continuously; the timestamp of the last trade lags the wall clock by 10–15 minutes.
- Live symbols show continuous last-price changes, a tightening and widening spread, and a last-trade timestamp within a second or two of the clock.
- Compare the SabrTrader chart's last price against the same symbol in TWS. If they differ by a fixed lag, the data source is delayed.
- If the dxFeed demo connection is still active, a chart may be reading it rather than IBKR. Disconnect dxFeed and recreate the chart to be certain of the source.
Paper trading setup
A paper trading account is a simulated IBKR account with virtual funds that mirrors live platform behaviour. It is the correct place to learn SabrTrader order entry, bracket handling and hotkeys.
- Log into TWS with your paper user name (IBKR issues a separate paper login) rather than your live credentials.
- Open API → Settings on the paper login and repeat the same configuration: enable ActiveX and Socket Clients, uncheck Read-Only API, keep localhost-only checked.
- Confirm the socket port reads 7497 for paper TWS, or 4002 for paper IB Gateway.
- In SabrTrader, create a second, separately named connection profile — for example
IBKR Paper— with the paper port and a different client ID from the live profile. - Connect only one of the two profiles at a time, and confirm which one is active before trading.
Why keep separate profiles
- Editing a single profile back and forth between 7496 and 7497 is how traders accidentally send live orders while believing they are simulating.
- Distinct names appear in chart data-source pickers and in the connection status area, giving a constant visual reminder of which account is live.
- Paper data is often delayed unless your live entitlements are shared to the paper account in Client Portal. Expect paper prices to differ from live prices; simulated fills are also idealised and do not reflect true queue position.
Best practices
- Keep TWS logged in for the whole trading session. In TWS, set the daily maintenance behaviour to auto-restart rather than auto-logoff so the API returns automatically instead of requiring a manual login.
- Use IB Gateway for long, unattended or automated sessions and TWS when you want a visual cross-check of orders and positions.
- Assign a unique, documented client ID to every API application. Never reuse the same number across two applications on one TWS instance.
- Disconnect the dxFeed demo feed while trading live. Delayed prices next to live prices is a reliable way to misread the market.
- Save a workspace after configuring it so charts, DOMs and indicator settings reopen with the right data source.
- Buy the real-time subscriptions for the exact exchanges you trade. Order-flow tools are only as accurate as the tick stream feeding them; see footprint and Liquidity Heatmap and SuperDOM for what tick and depth quality affect.
- Respect market data line limits. Every open chart, DOM and watchlist row consumes a line. Opening dozens of footprint charts at once can silently throttle quotes; close what you are not using or buy additional quote boosters.
- Run SabrTrader and TWS on the same machine when possible and keep Allow connections from localhost only checked. Remote setups add latency and firewall complexity.
- Whitelist SabrTrader and TWS in your firewall and antivirus so loopback traffic on the API port is never intercepted.
- Use modest historical lookbacks when opening several charts at once to avoid IBKR pacing violations, then increase depth selectively.
- Test every new configuration on paper first, including a place-modify-cancel cycle, before switching the port to live.
- Set Bypass Order Precautions for API orders only after you understand the safety checks you are disabling, and keep sensible risk limits in SabrTrader instead.
Common mistakes
| Mistake | Result | Correction |
|---|---|---|
| TWS or IB Gateway not running, or running but not logged in | Connection refused; nothing streams | Launch and fully log into TWS before pressing Connect in SabrTrader |
| Enable ActiveX and Socket Clients left unchecked | Every connection attempt is refused | Check the box in API → Settings, Apply, OK |
| Read-Only API left checked | Data works, all orders rejected | Uncheck it and reconnect the API session |
| Port mismatch between TWS and SabrTrader | Cannot connect at all | Make the SabrTrader Port field identical to the TWS socket port |
| Using 7497 while expecting live fills, or 7496 against a paper login | Trading the wrong account, or no connection | Maintain separate named live and paper profiles |
| Duplicate client ID with another API application | Connects then immediately drops | Assign a unique integer to each application |
| Entering the U-prefixed account ID in the Client ID field | Handshake never completes | Enter a small integer; the U-value is the account ID, not the client ID |
| Leaving dxFeed connected during live trading | Reading 10–15 minute delayed prices while believing they are live | Disconnect the demo feed and rebind charts to IBKR |
| Pressing Connect before pressing Add | Fields stay locked and no profile exists | Select Interactive Brokers, press Add, fill fields, then Connect |
| Firewall or antivirus blocking loopback traffic | Intermittent or refused connections with correct settings | Whitelist both applications and the API port |
| Expecting footprint, delta or DOM tools to work on delayed data | Misleading imbalance and absorption readings | Purchase real-time entitlements for the traded exchange |
| Opening very deep history on many charts simultaneously | Missing bars, pacing violation messages | Reduce lookback, stagger chart creation |
| Ignoring the daily TWS restart window | Connection silently dies mid-session | Configure auto-restart and reconnect in SabrTrader afterwards |
After you connect — next steps
Once the IBKR profile shows connected, all remaining work is layout and tooling.
Creating windows and charts
Use the Control Center's new-window menu. The New chart dialog asks for three things:
-
Symbol — the instrument, with exchange selection where required (for example
SPYon a US equity venue). - Timeframe / bar interval — the aggregation period of each bar. The demonstration uses 5 minutes: small enough to show intraday structure, large enough to stay readable.
- Historical lookback / history depth — how much past data to load, for example the last 7 days. More depth gives context but costs load time, memory and IBKR pacing budget.

Where to go next
- Footprint Chart Indicator — bid/ask volume per price, delta, imbalance and absorption, all built from the IBKR tick stream.
- Liquidity Heatmap and SuperDOM — resting depth visualisation and precise ladder order entry.
- Volume Profile Indicator — point of control, value area and VWAP over your chosen session.
- Market Structure Indicator and TDU Price Action Indicator — structural context around order-flow entries.
- Free Indicators and Premium Indicators — full catalogue of what you can add to the chart.
- AlgoStudio Pro and Auto Strategy Builder — automating strategies against the connected broker.
Finally, save the workspace. A saved workspace restores window positions, symbols, timeframes, indicators and data-source bindings, so the next session begins with a single click plus a TWS login.
Frequently Asked Questions
Do I need Trader Workstation running to use SabrTrader with Interactive Brokers?
Yes. SabrTrader is an API client, not an IBKR login. It connects to a socket hosted by Trader Workstation (TWS) or IB Gateway, which must be running and fully logged in for the entire session. If TWS closes, restarts or logs out, the SabrTrader connection drops and must be reconnected.
Should I use Trader Workstation or IB Gateway?
Both expose the identical API. Use TWS when you want to visually cross-check orders, fills and positions in IBKR's own interface — this is the recommended starting point. Use IB Gateway for long unattended or automated sessions and on lower-specification machines, because it has no charts or trading GUI and uses far fewer resources. Remember the ports differ: TWS uses 7496/7497, IB Gateway uses 4001/4002.
Which socket port do I use for a live account versus paper trading?
Trader Workstation: 7496 for live, 7497 for paper. IB Gateway: 4001 for live, 4002 for paper. The number in the SabrTrader connection profile's Port field must match the TWS API → Settings socket port exactly, and the port must match the credentials you logged into TWS with.
What is the API client ID and what number should I enter?
The API client ID is a small non-negative integer that uniquely identifies one API session so several applications can share a single TWS instance without conflicting. If SabrTrader is the only API application, enter 0 or 1. If you also run Excel, Python scripts or a second platform, give each one a different number. Duplicate client IDs cause a connection to establish and then immediately drop.
Is the ID starting with 'U' the client ID or the account ID?
The value beginning with U next to your TWS user name is your IBKR account ID (for example U1234567). It identifies which brokerage account holds your positions and is used to select the trading account. It is not the API client ID and must not be typed into SabrTrader's Client ID field, which requires a small integer. The video conflates the two; enter a number such as 1 in Client ID.
Why are my Interactive Brokers orders rejected from SabrTrader?
Check in this order: (1) Read-Only API is still checked in TWS API → Settings — uncheck it and reconnect; (2) a TWS order-precaution pop-up is blocking the order — enable Bypass Order Precautions for API orders or answer the prompt in TWS; (3) the account is not permissioned for that product or currency; (4) you are connected to a paper port but expecting live behaviour, or the wrong U-account is selected; (5) insufficient buying power or a position/size limit.
Why do my quotes show as delayed after connecting to IBKR?
The API session and market data entitlements are separate things. A connected session with delayed quotes means your IBKR account lacks a real-time market data subscription for that exchange. Purchase the relevant subscription in IBKR Client Portal. Also confirm the chart is bound to the IBKR connection and not to the still-connected dxFeed demo feed, and that you have not exhausted your account's market data lines.
Do I need IBKR real-time market data subscriptions for footprint and DOM tools?
Yes. Footprint, cumulative delta, volume profile and DOM tools are computed from individual trades and resting depth. Delayed data makes every reading historical, and without depth entitlements a DOM has no liquidity to display. Subscribe to real-time data — including depth where required — for each exchange you trade.
Can I keep the dxFeed demo feed connected at the same time as IBKR?
Technically yes — SabrTrader supports multiple simultaneous connections — but it is not recommended while trading. The demo feed is delayed, and a chart or watchlist can bind to it instead of IBKR without an obvious warning, so you may read 10–15 minute old prices. Disconnect the dxFeed connection before live trading.
Can I run SabrTrader on a different computer from TWS?
Yes. On the TWS machine, uncheck Allow connections from localhost only and add the SabrTrader machine's IP address under Trusted IP addresses. In SabrTrader, replace 127.0.0.1 in the Host field with the TWS machine's LAN IP, and make sure the socket port is open through both firewalls. Same-machine setups are simpler, lower latency and more secure, so use a remote setup only when necessary.
Why does my connection drop once a day?
TWS and IB Gateway perform a scheduled daily maintenance cycle and may also require two-factor authentication. If TWS is set to auto-logoff, the API session ends until you log in again. Configure auto-restart in the TWS lock-and-exit settings so the application restarts and the API returns automatically, then press Connect again in SabrTrader if the session does not resume on its own.
Can I connect more than one broker or data feed at the same time?
Yes. SabrTrader's Connections tab supports multiple active profiles, so you can run Interactive Brokers alongside another broker or feed such as Rithmic or Schwab. Each chart, DOM or watchlist can be bound to a specific connection. Give each connection a clear name so you always know which source a window is reading and which account an order will hit.
How do I rename or delete an Interactive Brokers connection?
Select the saved profile in the Connections tab. To rename, edit the connection name field and save — the name is a label only and can be changed at any time (for example from New Interactive Brokers to IBKR Live). To delete, press Disconnect first, then Remove. Deleting a profile does not affect your IBKR account or TWS settings.
How do I open my first chart after connecting?
From the Control Center, open the new-window menu and choose New chart. Enter a symbol (the demonstration uses SPY), choose a timeframe (5 minutes), and set the historical lookback (last 7 days), then confirm. During market hours the newest bar should update continuously, which confirms live ticks are arriving from IBKR.
What is the difference between a broker connection and a data connection?
A broker connection carries orders, balances and positions in addition to prices; a data feed connection carries prices only. dxFeed is a data feed connection. Interactive Brokers is a broker connection: the same API session in TWS delivers market data, account information and order routing.
Why are the connection fields greyed out when I select Interactive Brokers?
Selecting a provider in the list of 57 preloaded configurations only highlights it. The fields stay locked until you press Add, which creates a saved profile named New Interactive Brokers and unlocks the connection name, Application, Host, Client ID and Port fields.
What is the Master API client ID for?
The Master API client ID is a client ID designated in TWS that receives status updates for all orders on the account, including orders placed manually in TWS or by other API clients. Set SabrTrader's client ID to that number if you want SabrTrader to see and manage every working order. Leave the master field blank if each client should see only its own orders.
Why did my historical bars fail to load?
IBKR enforces historical data pacing rules that limit how many historical requests an API client may make in a short period. Requesting deep lookbacks on many charts simultaneously triggers throttling, producing missing bars or pacing errors. Reduce the history depth, create charts one at a time, wait a minute and retry.
Does closing the default workspace delete anything?
No. A workspace is only a saved arrangement of windows. Closing the default workspace leaves the Control Center on screen and removes nothing from your account, connections or indicator settings. You can reopen it or build and save a new layout at any time.
Can I use SabrTrader with IBKR for charting only, without any risk of sending orders?
Yes. Leave Read-Only API checked in TWS API → Settings. The API session will still deliver quotes, historical data, positions and balances, but every order, modification and cancellation from any API client will be rejected. Uncheck it when you are ready to trade.
Troubleshooting
Cannot connect / connection refused
Causes: TWS or IB Gateway not running or not logged in; Enable ActiveX and Socket Clients unchecked; port mismatch; firewall blocking the loopback port.
Fix: Log into TWS, open API → Settings, check Enable ActiveX and Socket Clients, note the socket port, press Apply then OK. Set the identical port in SabrTrader with Host 127.0.0.1, then press Connect. If it still fails, whitelist both applications in the firewall and antivirus.
Connects, then immediately disconnects
Cause: Almost always a duplicate client ID — another application (Excel, a script, a second SabrTrader instance) is already using that number against the same TWS. It can also occur when TWS rejects an untrusted remote address.
Fix: Change the SabrTrader Client ID to an unused integer and reconnect. For remote setups, add the SabrTrader machine's IP to Trusted IP addresses and uncheck Allow connections from localhost only.
Connected but quotes are flagged delayed or frozen
Causes: No real-time market data subscription for that exchange; market data line limit exhausted; the chart is bound to the dxFeed demo feed.
Fix: Purchase the exchange subscription in IBKR Client Portal; close unused charts, DOMs and watchlist rows to free market data lines; disconnect dxFeed and recreate the chart against the IBKR connection. Cross-check the last price against TWS to confirm the lag is gone.
Historical bars missing or a pacing error appears
Cause: IBKR historical data pacing limits were exceeded by too many or too deep historical requests in a short window.
Fix: Reduce the history depth in the new-chart dialog, open charts one at a time rather than restoring a large workspace all at once, wait 60 seconds and reload. Increase depth selectively on the charts that truly need it.
Orders rejected or never acknowledged
Causes: Read-Only API checked; a TWS order-precaution confirmation waiting unanswered in TWS; product not permissioned; wrong or aggregate account selected; insufficient buying power.
Fix: Uncheck Read-Only API and reconnect. Switch to TWS and answer any pending prompt, or enable Bypass Order Precautions for API orders. Verify trading permissions in Client Portal, and select a specific U-account rather than an aggregate. Test the full place-modify-cancel cycle on a paper connection first.
Connection lost at the same time every day, or after a 2FA prompt
Cause: TWS performs a scheduled daily restart or logoff, and IBKR may require two-factor approval to resume the session.
Fix: In TWS, configure auto-restart rather than auto-logoff so the application relaunches without credentials. Approve the 2FA request when it appears. After TWS is back up, press Connect on the IBKR profile in SabrTrader if it has not reconnected automatically. For unattended operation, use IB Gateway.
Balances and positions are empty despite a connected status
Causes: A paper login is active while you expect the live account; no account selected under a multi-account login; Download open orders on connection disabled so existing orders do not appear.
Fix: Confirm the port matches the credentials used (7496 live, 7497 paper). Select the correct U-account in SabrTrader's account selector. Enable Download open orders on connection in TWS API → Settings and reconnect.
Multiple accounts under one login and orders go to the wrong one
Cause: Advisor, family or multi-sub-account logins expose several U-accounts; an aggregate or All selection is invalid for single orders.
Fix: Always select an explicit U-account before trading. Consider one SabrTrader connection profile per account, each with a unique client ID and a clear name, so the active account is visible at a glance.
Remote machine cannot reach TWS
Cause: Localhost-only restriction still enabled, the remote IP not trusted, or the socket port not open through the network firewall.
Fix: On the TWS machine, uncheck Allow connections from localhost only, add the SabrTrader machine's IP under Trusted IP addresses, Apply and OK. Open the port (7496/7497 or 4001/4002) inbound on the TWS machine's firewall. In SabrTrader, set Host to the TWS machine's LAN IP. Prefer a same-machine setup where possible.
Order-flow tools look wrong or empty
Cause: Footprint, delta, volume profile and DOM tools require trade-by-trade and depth data. Delayed or unentitled feeds produce sparse, aggregated or absent data.
Fix: Confirm the chart is bound to a live IBKR connection, confirm real-time (and where needed depth) entitlements for the exchange, and disconnect the delayed demo feed. See Footprint Chart Indicator and Liquidity Heatmap and SuperDOM for the data each tool needs.
Configuration fields are greyed out and nothing can be typed
Cause: The Interactive Brokers provider is only highlighted, not added.
Fix: Press Add. A profile named New Interactive Brokers appears in the saved connections list and the fields become editable.
Client ID field will not accept my identifier
Cause: The U-prefixed IBKR account ID was entered where a numeric API client ID is required.
Fix: Enter a small integer such as 1. Use the U-account only for selecting which account trades.
Glossary
- ActiveX and Socket Clients
- The TWS API setting that must be enabled before any external application can open an API session. While unchecked, TWS refuses all incoming API connections.
- Allow connections from localhost only
- A TWS security option restricting API access to applications running on the same computer as TWS. It should stay enabled for same-machine setups.
- API client ID
- A small non-negative integer that uniquely identifies one API session, allowing several applications to share a single TWS instance without conflict.
- Asset class
- A category of tradable instrument. The Interactive Brokers connection covers futures, equities, options and FX, and providers in the Connections tab are grouped by the asset classes they serve.
- Broker connection
- A connection that supplies market data and order routing for a live trading account, along with balances and positions. The Interactive Brokers connection in SabrTrader is a broker connection.
- Bypass Order Precautions for API orders
- A TWS setting that suppresses order confirmation and size/price warning dialogs for orders arriving via the API, preventing them from silently stalling API order submission.
- Chart interval
- The duration or unit of each bar on a chart, such as the 5-minute bars used in the demonstration. Smaller intervals reveal more detail with more noise; larger intervals smooth price at the cost of granularity.
- Connections tab
- The area of the Control Center containing SabrTrader's 57 preloaded broker and data-feed configurations, saved connection profiles, and the Add, Save, Connect, Disconnect and Advanced controls plus the connection status indicator.
- Control Center
- SabrTrader's primary window, hosting the Connections tab, workspace management and the launcher for new components and windows.
- Data feed connection
- A connection that supplies market prices only, with no order routing or account access. Suitable for learning the platform and configuring indicators.
- Delayed data
- Exchange prices delivered with a time lag, typically 10-15 minutes, available without a paid data subscription; suitable for learning and configuration, not live trading.
- DOM
- Depth of Market - a price ladder showing resting bid and ask liquidity at each price level, used for order-flow trading and precise order entry.
- dxFeed
- The market-data feed SabrTrader is connected to out of the box, providing delayed prices across supported markets so new users see data immediately. It provides prices only and cannot route orders.
- Footprint
- A chart type that displays traded volume split by buy and sell aggressor at each price within each bar, used to read absorption, imbalance and delta. It requires trade-by-trade tick data.
- Historical data pacing
- Interactive Brokers' limit on how many historical data requests an API client may issue within a short period. Exceeding it causes missing bars or pacing violation messages.
- History depth
- The amount of past data loaded when a chart is created, expressed in days or bars. Greater depth provides more context but increases load time, memory use and exposure to IBKR historical pacing limits.
- IB Gateway
- A lightweight, chart-less Interactive Brokers application that hosts the same API as TWS with substantially lower resource usage, intended for long or unattended sessions.
- IBKR account ID
- The Interactive Brokers account identifier beginning with the letter U, shown next to your TWS user name, used to select which account orders, positions and balances belong to. It is not the API client ID.
- IBKR daily auto-restart
- Interactive Brokers' scheduled daily maintenance cycle in which TWS or IB Gateway restarts or logs out, interrupting the API session until it returns or you log back in, sometimes with two-factor authentication.
- Interactive Brokers API
- The socket-based programming interface exposed by Trader Workstation or IB Gateway that lets third-party platforms request market and account data and submit orders on an IBKR account.
- Loopback address
- A reserved network address, commonly 127.0.0.1 or localhost, that resolves to the local computer. Traffic sent to it never leaves the machine.
- Market data entitlements
- The exchange permissions attached to a brokerage account that determine which real-time data a platform may display. Without the relevant entitlement, data arrives delayed or not at all even on an authorized connection.
- Market data feed
- The real-time or delayed stream of quotes, trades and depth that a platform consumes to build charts and order-flow tools.
- Market data lines
- The limited number of simultaneous streaming symbol subscriptions an IBKR account is entitled to before quotes are throttled or dropped.
- Master API client ID
- A client ID designated in TWS that receives status updates for all orders on the account, including orders placed manually in TWS or by other API clients.
- Modular window layout
- SabrTrader's design principle that components can be moved, docked and resized freely so each trader can build a personal layout.
- Order routing
- The path an order takes from SabrTrader through the API session in TWS or IB Gateway to Interactive Brokers and on to the exchange.
- Paper trading account
- A simulated IBKR account with virtual funds that mirrors live platform functionality, reached with a separate login and a separate socket port.
- Read-Only API
- A TWS option that permits data and account requests but blocks all order placement, modification and cancellation from API clients. It must be unchecked for live trading from SabrTrader.
- Real-time data subscription
- An exchange-level entitlement purchased through your broker that unlocks live tick data for a given market.
- Socket port
- The TCP port a listening application accepts connections on. For IBKR: 7496 for live TWS, 7497 for paper TWS, 4001 for live IB Gateway, 4002 for paper IB Gateway.
- Trader Workstation (TWS)
- Interactive Brokers' full desktop trading application, which can also act as the API host for external platforms such as SabrTrader.
- Trusted IP addresses
- A TWS whitelist of remote network addresses permitted to open API sessions, used instead of localhost-only when the trading platform runs on a different machine.
- Two-factor authentication
- A second identity confirmation step, typically via the IBKR mobile app, required at login and after some restarts. Until it is approved, the API session cannot be re-established.
- Workspace
- A saved arrangement of SabrTrader windows - charts, DOMs and panels - that can be created, named, closed, reopened and switched.