Email Trader setup guide Part 2 – Connect to Interactive Brokers (IBKR)

Step-by-step guide to connect Email Trader with Interactive Brokers (TWS/IB Gateway).

Connect to Interactive Brokers (IBKR), step by step.

By the end of this tutorial, Email Trader will be connected to IBKR via the official TWS/IB Gateway API, with reliable auto‑restart, and a validated connectivity test on EUR/USD. The flow is designed for clarity, safety, and low friction.

Good to know
Email Trader runs locally and talks directly to the official IBKR API (TWS/IB Gateway). There’s no central relay server and no change to IBKR default socket ports.

📺 Watch the demo video

We’ve prepared a 10-minute walkthrough that covers most of the steps explained in this guide. Following the video in parallel with this article is often the fastest way to set up Email Trader correctly.

YouTube icon — watch the Email Trader IBKR setup video

Watch the 10-minute Email Trader setup video on YouTube


Prerequisites

  • IBKR platform: install TWS (Trader Workstation) or IB Gateway on your machine.
  • Email Trader: installed from Mac App Store or Microsoft Store.
  • Network & power: stable internet; disable OS sleep during market hours.
  • Order of launch: start TWS/IB Gateway first, then Email Trader (not mandatory but preferable).

Step 1 — Create/enable a Paper Trading account

Paper Trading lets you test end-to-end without financial risk — and that’s precisely why it’s worth going through the process, even if activation takes about 24 hours.

  • Create/enable your IBKR Paper account (activation can take ~24h).
YouTube icon – watch Email Trader setup video

Paper Account Overview

Why Paper first?
You will mirror the exact same configuration in Live later. Paper and Live are separate; configure both.

 


Step 2 — Enable the IBKR API

In TWS (Global Configuration) or IB Gateway (Configure):

  1. Enable API access (Sockets/ActiveX clients).
  2. Keep default socket ports (don’t customize).
  3. Save and restart TWS/IB Gateway if prompted.

Tip
Default socket ports work out of the box—don’t change them.

YouTube icon – watch Email Trader setup video

API settings walk‑through

 


Step 3 — Set Bypass confirmations for full automation

Enable the relevant Bypass options so TWS/IB Gateway doesn’t stop on order confirmation dialogs (consistent with your risk policy). This ensures Email Trader can transmit orders without manual clicks.

  • Open the IBKR Settings
Interactive Brokers TWS main screen with red arrow pointing to the settings gear icon in the top-right corner.

On the main TWS screen, the settings menu is accessed via the small gear icon in the top-right corner — a key step before enabling Auto Restart.

  • Open the Bypass/Confirmations section.
Interactive Brokers TWS – API precautions settings for Email Trader setup

TWS API ‘Precautions’ settings – required bypass options for Email Trader automation.

  • Enable the suggested bypasses for automated examples (you can fine‑tune per your strategy).
  • Apply and OK.

Note
The example bypass set in the screenshots is tailored to the demo orders. Depending on your trading style, you may add or remove bypasses.


Step 4 — Configure Auto log‑off and Auto restart

A clean daily restart keeps TWS/IB Gateway healthy all week. The only intervention required is a TWS authentication once per week — after that, the auto-restart takes care of everything.

  1. In Lock and Exit settings, set an Auto log‑off time when your markets are closed.
  2. Enable Auto restart so the app closes and relaunches automatically.
  3. Click Apply, then OK.
  4. Repeat this setup in both Paper and Live—they are independent.

Weekly token reminder
IBKR requires a manual login roughly once per week (token refresh, typically Sunday ~01:00 ET). During the daily reboot the API is unavailable for ~1–3 minutes.

For a detailed explanation on this topic please refer to this blog article.


Step 5 — First launch of Email Trader

Each time you open Email Trader, the app performs a full connectivity test with Interactive Brokers automatically. Nothing needs to be triggered manually — the process runs in the background as part of the startup sequence.

Here’s what you will see in the logs:

  1. Connection established

Connected to [platform]. Starting API Test ...
  1. where [platform] depends on the IBKR app and account type you opened beforehand:

    • TWS Live

    • TWS Paper

    • IBGW Live

    • IBGW Paper

     

  2. API test sequence

    Email Trader then runs test queries on EUR/USD (forex permissions are normally enabled by default). The test takes about 5–10 seconds.

  3. Validation

API tests successfully passed

 

Session status

At this stage, the IBKR link is confirmed.

  • If you already linked a Gmail account via OAuth2.0 and activated a subscription, you’ll then see:

... Session started on [platform]
    • If not, Email Trader pauses here and waits. You’ll need to complete Gmail association and activate your subscription (the first week is free) before sessions can run end-to-end.

Pass criteria

You should always see the “API tests successfully passed” line — it confirms that the bridge to IBKR is alive.

⚠️ If not

Check the basics:

  • The API is correctly enabled in your IBKR platform.

  • Your machine didn’t enter sleep mode.

  • TWS/IB Gateway was launched before Email Trader.
  • Both Paper and Live environments were configured separately.

💡 Reminder: The full setup sequence looks like this, and we’ve just achieved the First Launch of Email Trader with IBKR Tests:

First launch (IBKR tests)Gmail link (OAuth2.0)Subscription activation (1st week free).

Once these three steps are complete, Email Trader sessions run end-to-end automatically.


Step 6 — Mirror the configuration in Live

Once Paper tests pass, maybe a few days/weeks later, repeat Steps 2–4 in your Live environment:

  • Enable API in Live TWS/IB Gateway.
  • Re‑apply Bypass options.
  • Reconfigure Auto log‑off/Auto restart.
  • Run a small‑size Live test when markets are open.

Important
Paper and Live have distinct settings. Configure both to ensure consistent behavior.


Troubleshooting checklist

  • Don’t change default ports.
  • Disable OS sleep during market hours.
  • Logs are your friend: Email Trader shows which alert it parsed and what was sent to IBKR.
  • Paper vs Live: mirror settings; test on Paper before Live.
  • Auto restart: expect a 1–3 min API gap at the chosen time.
  • Client ID conflicts: if you run multiple API clients, set unique Client IDs. (Client IDs identify API sessions. If you only run Email Trader, you can ignore this. If you run multiple API clients (scripts, other apps) at the same time, make sure each uses a different Client ID to avoid conflicts.)

Why this flow fits Email Trader’s positioning

  • Simple:
    Simple does not mean instantaneous. You don’t need a VPS or custom scripts — just TWS/IB Gateway plus OAuth to Gmail (covered in Part 3). The steps themselves are technically straightforward, but they do take a bit of time, especially when opening and activating a paper account. Still, the effort is worthwhile: once in place, the bridge runs smoothly. And in finance, patience is not only a virtue — it’s often a source of discipline and safety.
  • Secure by design: local processing, no central relay, store‑signed binaries.
  • Low‑cost: you avoid server rent and DevOps overhead; a guided setup gets you trading quickly.