Connecting IBKR

VolNinja places every order and streams every quote through your Interactive Brokers account. Connecting it is a three-part job: get IBKR's connection app running, turn on its API, and tell VolNinja which ports to use. A one-time setup wizard walks you through that last part the first time you open the app.

This page assumes VolNinja is already installed and running — if not, start with Installing & starting VolNinja. Once the basics work, Recommended IBKR setup covers running paper and live at once and keeping an eye on your account from your phone while VolNinja trades.

1. Get IBKR Gateway or TWS running

IBKR gives you two apps that can carry the connection. Install one on the same machine as VolNinja and log in:

  • IB Gateway — a small, no-frills app that does nothing but hold the API connection. It is lighter, more stable to leave running, and the recommended choice — especially on a VPS.
  • Trader Workstation (TWS) — IBKR's full trading platform, which exposes the same API.

Either works with VolNinja.

2. Turn on API access in IBKR

VolNinja reaches IBKR through its API, which is off by default. In Gateway or TWS, open the API settings (Configure → Settings → API → Settings in Gateway, or Global Configuration → API → Settings in TWS) and:

  • Turn on Enable ActiveX and Socket Clients.
  • Uncheck Read-Only API — VolNinja needs to place and manage orders, not just read them.
  • In the Precautions tab, turn on Bypass Order Precautions for API Orders. Without it, IBKR can silently reject valid orders: its precaution warnings (order size, value, and price limits) are pop-ups meant to be clicked, and an automated order has no way to answer them.
  • Allow connections from the same machine (add 127.0.0.1 to the trusted addresses).
  • Note the Socket port. The standard values are:
    • IB Gateway4001 live, 4002 paper.
    • TWS7496 live, 7497 paper.

Apply the changes, and restart Gateway or TWS if it asks you to.

If you plan to use broker-side Standing Orders (stop/limit orders that live at IBKR), also turn on Bypass No Overfill Protection precaution for destinations where implied natively in the same Precautions tab, so their linked stop-and-target groups are accepted. This option only exists on newer TWS/Gateway versions.

Important

Your paper and live logins have separate API settings. If you plan to use both, enable the API the same way while signed into each one — turning it on for your live account does not turn it on for paper.

Tip

IB Gateway signs itself out on a schedule by default. In its settings, set a daily auto-restart time (or turn off the automatic logout) so your connection doesn't drop in the middle of a session — this matters most when VolNinja runs unattended on a VPS.

3. Tell VolNinja which ports to use

The first time you open the trading app, a short setup wizard appears before the trading screens and collects everything VolNinja needs.

Step 1 — Connect your broker. Enter your Live account port and, if you use one, your Paper account port. Each field shows the standard values (IB Gateway 4001/4002 · TWS 7496/7497) — use whichever matches the app you are running.

  • Advanced — client IDs (optional): VolNinja opens several connections to IBKR — Trading (live and paper), Market data, and Monitoring (live and paper) — each with its own unique connection ID. The defaults work unless another IBKR API client is already using them; if you change them, each must be unique.
  • Test connection (optional): saves your ports and checks the connection right away, reporting ✓ Connected or "Couldn't connect — is IBKR Gateway running?".
  • Click Save & continue.

Step 2 — Market data. Tell VolNinja your total number of market-data lines. IBKR gives every account 100 by default; entering your total lets VolNinja stay within it. Need more? You buy extra 100-line bundles from IBKR, not from us.

You can revisit all of this any time under Settings → Connections and Settings → Market data.

Warning

When VolNinja is set to live, every order is real money at your broker. Never submit test orders in live mode — switch to paper whenever you want to experiment. You choose the active account with the trading-mode switch in the header; see Paper vs live.

Confirm the connection

Once IBKR is running with the API on and your ports are saved, VolNinja connects on its own. Check it from the System Status indicator in the top bar — the activity badge that reads Healthy, Issues, or Loading…. Opening it lists each connection VolNinja keeps to IBKR:

  • Trading Workers — your Live and Paper trading connections.
  • Monitoring Worker — a read-only watcher that keeps an eye on your positions.
  • Market Data Service — the live quote feed.

When IBKR is reachable, these rows read Connected and the header badge shows Healthy. If a connection shows Disconnected, click Reconnect to retry.

Tip

Outside market hours a healthy connection still shows Connected, but quotes and the SPX price read as a dash () until the market opens and data starts flowing. That is normal — it means you're connected and waiting for data, not disconnected.

Important

The Market Data Service row also shows a live count like 42 / 100 subs — how many option quotes VolNinja is streaming against IBKR's hard limit of 100 at a time. VolNinja manages these slots for you and warns you as you approach the limit; going over is flagged, never blocked. You'll meet this budget again on the Options Chain.

If it won't connect

Run through these quick checks (see Troubleshooting for more):

  • Gateway or TWS is running and logged in on the same machine as VolNinja.
  • The API is enabled (Enable ActiveX and Socket Clients), and Read-Only API is off — in the account (live or paper) you're trying to use.
  • The ports in Settings → Connections match your app — IB Gateway 4001/4002 or TWS 7496/7497.
  • If you changed the client IDs, each is unique and not used by another IBKR client.

Then reopen the form and click Test connection, or open System Status and click Reconnect.

Next steps

Your broker is connected. Now:

Last updated