Nexus Trader

How to install

From nothing to a running paper bot

Nexus Trader trades your own Interactive Brokers account from your own Windows PC. Two programs run side by side: IBKR's Trader Workstation, which holds your broker session, and Nexus Trader, which makes the decisions and places the orders through it. This page sets both up, in order, with nothing assumed.

What is ahead
  1. The broker account — apply, fund, market data, two-factor. Mostly waiting; start it first.
  2. Install Trader Workstation — 15 minutes.
  3. The TWS settings the bot needs — 10 minutes, and the part people get wrong.
  4. Install Nexus Trader and run the setup wizard — 10 minutes.
  5. First day, and the one weekly duty.
  6. Going live later, and what to do when something does not work.
Everything starts in paper mode. The setup wizard finishes on IBKR's simulated account, where orders are not real. Real money is a separate, deliberate step you take later, from the main window, once your account is funded and approved — see part 6.

1 · The broker account

This is the slow part: applications and transfers take days, not minutes. Start here, and install the software while you wait.

1

Open an individual margin account with US stock permissions

Apply on the Interactive Brokers site for your country. Nexus Trader is offered to residents of Canada and the United States. Four answers matter:

  • Account type: individual.
  • Margin, not cash. The strategy borrows up to 1.5 times the account value; a cash account cannot do that and the software will not run as designed. Standard margin is enough — you do not need portfolio margin.
  • Trading permissions: United States → Stocks. Nothing else is used. Leave options, futures, forex and crypto off.
  • Market data status: answer the professional/non-professional questions honestly. Trading your own money, outside the finance industry, is normally non-professional, and professional data costs far more.

Registered accounts (TFSA, RRSP, RESP and the like) are not margin accounts and cannot be used.

Give the bot its own account. Nexus Trader adopts and manages every position it finds in the account it is pointed at. If you already trade at IBKR, add a second account under your existing login and dedicate that one to the bot. Do not point it at an account holding your other investments.
2

Fund it

Transfer from a bank account in your own name, in Client Portal under Transfer & Pay. Money usually lands in a few business days.

How much: the published minimum is CAD 5,000 and the recommendation is CAD 7,000 or more (about US$5,000). IBKR's own minimum is lower, and it is not enough here: the strategy sizes each position by risk and rounds to whole shares, so a small account cannot buy the positions the method depends on. Fund only with money you can afford to see fall.

3

Subscribe to live US market data

In Client Portal: Settings → User Settings → Market Data Subscriptions. Subscribe to a real-time US stock package covering NYSE, NASDAQ and NYSE American. Top-of-book is enough; you do not need depth-of-book. Budget about US$5–15 a month.

Not optional for live trading. A live account checks every open position against its stop from 04:00 ET using live quotes and decides at 15:55 ET from live prices. On delayed data a live account does not guess: it skips the check, e-mails you, and leaves the resting stop order at the broker as the only protection.

Paper mode is different: it accepts IBKR's free delayed feed (about 15 minutes behind) and trades on it, so you can run the whole paper phase without a subscription. If you do subscribe, share the data with your paper account — in Client Portal under Settings → Paper Trading Account, turn on sharing of your market-data subscriptions — and paper will price off live quotes instead.

4

Turn on IB Key two-factor login

Install IBKR Mobile on your phone and activate IB Key in it (Authenticate → IB Key → Activate). Log out of Client Portal and back in to confirm the phone prompt arrives. You approve TWS logins with it, including the one weekly login in part 5.

5

Find your paper account

Every IBKR client gets a free simulated account. Its username is different from your live one and is shown in Client Portal under Settings → Paper Trading Account. Keep those details to hand: everything below starts there. Live account ids begin with U; paper ids begin with DU.

2 · Install Trader Workstation

TWS is IBKR's own desktop platform. Nexus Trader talks to it, and you keep the broker's own screens to watch your positions and stops while the bot works.

6

Download and install

On the IBKR website go to Trading → Trading Platforms → Trader Workstation and take the Stable Windows build, not the latest beta. If IBKR offers the Stable build as an offline installer, prefer it: IBKR says the nightly Auto restart (part 3) works best on offline versions, because a failed automatic update can interrupt it. Run the installer with its defaults; it brings everything it needs. TWS uses about 1 GB of memory, which any Windows 10 or 11 PC from the last few years handles.

7

Log in to the paper account and leave it running

Start TWS, switch the login window to Paper Trading, enter the paper username and password, and approve the prompt on your phone if one arrives. Leave TWS running — minimised is fine. Do not place trades by hand in the account the bot manages.

IBKR allows one session per username, across TWS, IBKR Mobile and Client Portal. Your paper username is separate from your live one, so checking your live account while TWS runs paper is fine. Once TWS runs your live account, sign in elsewhere only with a second username or IBKR Mobile's read-only access: a full login with the same username takes the session away from TWS, and its next restart then needs your password. For a second desktop session, ask IBKR for a second username on the account.

3 · The TWS settings the bot needs

This is the part that decides whether anything works. It takes ten minutes. The connection never leaves your PC: the bot dials 127.0.0.1, which means "this computer", and nothing is opened to the internet.

8

Turn on the API

In TWS: Edit → Global Configuration → API → Settings (File instead of Edit in the Mosaic layout). Set exactly this:

SettingValueWhy
Enable ActiveX and Socket ClientsONThe API switch. Off, and the bot cannot connect at all.
Read-Only APIOFFA new TWS has it ticked — untick it. Read-only blocks every order, including the protective stop orders.
Socket port7497 paper
7496 live
The number the bot dials. It must match the mode you are in.
Allow connections from localhost onlyONThe default — leave it ticked. TWS then lets the bot on this PC connect without asking, and nothing needs adding to Trusted IPs. Unticked, TWS can pop up a dialog asking you to accept each connection — with nobody at the keyboard, that blocks trading.
Download open orders on connectionONLets the bot see the stop orders already resting at IBKR when it reconnects, and manage them instead of treating them as unknown.
Master API client IDleave blankNot used.

Click OK. If TWS asks to restart, let it.

Cannot find Allow connections from localhost only? It is ticked by default, so leave it: a pop-up asking you to accept a connection is the sign it has been turned off. If you followed an earlier version of this page and added 127.0.0.1 to Trusted IPs, that sign will not show for the bot, so check the box yourself: if it is unticked, tick it and click OK. The 127.0.0.1 entry can stay; TWS ignores the list while the box is ticked.
9

Let the bot's orders through without a confirmation click

TWS can stop an order from a program and wait for someone to click "are you sure?" — for a size or value limit, or a price warning. Nobody is at the keyboard at 15:55 ET, so the bot's order would just sit there: an entry or a sale that never happens (before a sale the bot has already cancelled that position's stop), or a protective stop that never reaches IBKR. Switch those questions off for API orders.

Open Global Configuration again (Edit → Global Configuration, or File in the Mosaic layout) and choose API → Precautions — a separate page under API in the left pane, not the Settings page above.

Tick these boxes:

  • Bypass Order Precautions for API Orders (some versions: Bypass Order and Ticket Precautions for API Orders and Tickets) — the one that matters: without it TWS can hold the bot's order for a click.
  • Bypass Redirect Order warning for Stock API Orders — another warning an unattended program cannot answer.
  • Bypass price-based volatility risk warning for API Orders — same reason.

Leave unticked: any box starting Suppress market cap. It keeps IBKR's price cap on market orders.

The other bypass boxes on the page (bonds, pair trades, advisor accounts, overfill, BBO routing) cover orders the bot never sends; ticking them does no harm. Leave Presets → Stocks → Precautionary Settings as they are. Click Apply, then OK.

What this changes: TWS no longer asks "are you sure?" before an order from a program connected to it goes to IBKR, even an unusually large one. IBKR's own checks on its side still apply. Connect only Nexus Trader to the TWS login it manages.
10

Know which port goes with which mode

ModeProgramAccountPort
Paper (where you start)Trader WorkstationDU…7497
Live (later, by approval)Trader WorkstationU…7496
Advanced, optionalIB Gatewaypaper / live4002 / 4001

The host is always 127.0.0.1. The bot checks on every connection that the account IBKR reports matches the mode it is in, and refuses the connection if they disagree. Setup always starts in paper, so if the setup wizard reports "PROFILE/ACCOUNT MISMATCH", TWS is logged in to your live account: log TWS in to your paper account.

IB Gateway is a headless alternative with the same API. It works, but it shows nothing on screen, and because of the one-session rule you would lose the ability to watch the account in TWS. Use it only if you know you want it; everything here assumes TWS.

11

Make TWS restart itself every night instead of closing

IBKR shuts TWS down once a day. With Auto logoff it simply closes and stays closed until someone starts it and logs in, and the bot can do nothing until then (it keeps retrying by itself: log in by about 3 PM ET and it still makes that day's 3:55 PM decision). With Auto restart TWS closes and reopens itself at the time you set and logs itself back in, with no password and no phone approval, Monday to Saturday (Sunday is part 5).

TWS reads the restart time on its own clock, which is not necessarily your PC's, so the first thing is to put that clock on New York time — the market's own clock, and the one setting that is right everywhere, all year:

  1. Log out of TWS. On the login screen open More Options, set Time Zone to America/New_York, and log in again. From then on TWS shows times in New York time.
  2. Open Edit → Global Configuration → Lock and Exit (File instead of Edit in the Mosaic layout; the gear icon at the top right of TWS also opens Global Configuration).
  3. Under Lock Trader Workstation, select Never lock (it reads "Never lock Trader Workstation" or "Never lock trading system"). A locked TWS drops the bot's connection.
  4. Choose Auto restart, not Auto logoff.
  5. Type 10:00, choose PM, and click Apply, then OK. If TWS says auto restart starts at your next login, or that the change needs a restart, click Yes and log in again when it reopens: Auto restart works from that login on.

Why 10:00 PM New York: the bot works until 20:00 ET and checks in once more around 21:00 ET, and IBKR's own nightly maintenance starts about 00:15 ET. Any time from 9:30 PM to 11:30 PM New York time also works. On the first evening, check that TWS closes and reopens by itself at 10:00 PM New York time.

12

Keep the PC on and awake

Leave the PC on and awake day and night. The bot works 04:00–20:00 ET on trading days, but TWS closes whenever Windows shuts down, restarts or loses power, and Auto restart does not bring it back — only a login does; the 10:00 PM New York restart also needs the PC awake. Nexus Trader's installer switches off sleep while the PC is on mains power. After any Windows restart — an update included — sign in to Windows, then start TWS and log in: Nexus Trader starts by itself when you sign in (with the installer's start-at-sign-in option) and starts the bot, but TWS does not. Schedule Windows Update restarts for a time you are at the PC.

4 · Install Nexus Trader

The installer is self-contained: no Python, no dependencies, nothing else to install. About 55 MB, Windows 10 or 11.

13

Download and run the installer

Get it from the Get started page. Windows SmartScreen may warn on first run because the installer is not yet code-signed; choose More info → Run anyway.

Take the two options under Unattended operation. They are what let the bot work while you are not at the machine.

The installer's options page. Both unattended-operation boxes are ticked by default; leave them ticked.
The installer's options page. Both unattended-operation boxes are ticked by default; leave them ticked.
14

Start it — the setup wizard opens

Four steps, about five minutes. It ends in paper mode; real money is a separate decision later. Before you begin, TWS should be running and logged in to your paper account, with the API settings from part 3 in place.

Step 1: what the wizard needs before it starts, and where your settings will be stored.
Step 1: what the wizard needs before it starts, and where your settings will be stored.
15

Connect to the broker

The wizard fills in the host, port and client id for paper mode. Press Test connection: it reads the account id and its value and shows them back to you. Nothing is ordered by the test. If your login has several accounts, pick the one the bot should manage.

If the test fails, part 7 lists what each message means.

Step 2: the connection test has found the paper account and its value. The test only reads.
Step 2: the connection test has found the paper account and its value. The test only reads.
16

No licence key to enter

Paper mode is free and needs no licence, so the wizard goes straight from the broker test to your e-mail address. A licence is only for live trading: when your account is funded and Nexus has approved it, you get a key and activate it from the main window (Activate licence…). The Review page of the wizard also has an “Already have a licence? Activate it…” button for that case.

17

Choose where alerts go

One address receives act-now alerts and an evening summary shortly after 20:00 ET, in free paper mode too, and a monthly statement once you are trading live. Press Send confirmation e-mail: we e-mail you a link, and e-mail starts once you press Confirm on the page it opens (check the spam folder if it does not arrive). Until then, and always, the Nexus Trader window shows your account and every action the bot takes. Important only is the setting to keep — it e-mails you when something needs attention rather than on every action. In paper mode every e-mail has a link to stop them, and one address can be used on up to three PCs.

Step 3: the alert address, and how much you want to hear.
Step 3: the alert address, and how much you want to hear.
18

Review and finish

The last step repeats what will be saved and where. Press Finish.

Step 4: everything the wizard is about to write, including the settings file.
Step 4: everything the wizard is about to write, including the settings file.

5 · First day, and the one weekly duty

After the wizard, the main window is where you live. Nothing trades until you start the bot.

19

Start the bot

Press Start Bot. Leave Start the bot automatically when Nexus Trader opens ticked so it comes back by itself after a restart. The panel at the top says what it is doing and when it next wakes; the log on the right is the detail.

Two controls are worth knowing before you need them. STOP TRADING stops new positions being opened while the bot keeps managing and protecting what you already hold. FLATTEN sells everything at market. Both are one button.

The main window just after setup, in paper mode, before the bot is started.
The main window just after setup, in paper mode, before the bot is started.
20

What a normal day looks like

  • 04:00 ET the bot wakes and starts watching stops in extended hours.
  • Through the day it checks positions against their stops and repairs anything missing.
  • 15:55 ET one decision cycle: it sells what its rules say to sell, and buys what they say to buy.
  • 20:00 ET the daily summary e-mail (in paper mode within about 15 minutes of it), once your address is confirmed.

You are e-mailed when something needs you and otherwise left alone; the same notices appear in the Nexus Trader window.

21

The weekly duty: log TWS in again every Sunday

Every Sunday at 01:00 ET IBKR cancels the saved login that Auto restart reuses, so from then on TWS cannot log itself back in — even if it still looks logged in. Once a week, between Sunday 02:00 ET (after IBKR's Sunday-morning maintenance) and Monday 04:00 ET, close TWS if it is open, start it again and log in — on Paper Trading while you are in paper mode — and approve the prompt on your phone if asked. Sunday afternoon or evening is safe everywhere in Canada and the US; a Saturday-evening login is too early. Log in before 8:00 PM New York time so the evening summary can read your account. After that the nightly restarts need nothing until next Sunday. IBKR can also ask for a login on another day: rarely for security reasons, and whenever the same username logs in to IBKR Mobile, Client Portal or TWS on another PC. If nobody logs in, the bot cannot connect on Monday: the Nexus Trader window shows "IBKR NOT reachable" (and, with e-mail on, you are also e-mailed), no new positions are opened, and the stop orders already resting at IBKR stay in place. Put a weekly reminder in your phone.

6 · Going live, later

Live trading is a separate, deliberate step, and it is by approval.

Run in paper for a few weeks first. When you and Nexus agree you are ready, you will need a funded margin account, the live market-data subscription, TWS logged in to the live account on port 7496, and the in-app Live Trading Risk Acknowledgment, which you read and confirm item by item. The switch itself is the Go Live button in the main window; it asks for the last four characters of the account before it will do anything.

Trading with real money can lose real money. The strategy uses margin (up to 1.5× gross leverage) and can lose more than the amount invested in a single position; about 4 out of 5 trades lose a small amount, and extended periods of flat or negative performance are normal. The performance page carries the simulated record and every caveat that travels with it.

7 · When something does not work

What you seeWhat it usually meansWhat to do
"nothing accepted the connection" (once setup is finished, the main window shows "IBKR NOT reachable")TWS is not running or not logged in, TWS is logged in to your live account (port 7496 by default, not 7497), the API switch is off, or the port does not matchStart TWS and log in to your paper account; tick Enable ActiveX and Socket Clients; check the port against the table in part 3. If this happens every morning, see "TWS is gone every morning" below
"accepted the connection but did not answer the API handshake"TWS may be waiting for someone to answer a pop-up asking to accept the connectionLook for the pop-up (next row); if there is none, restart TWS, log in, and test again
A TWS pop-up asks you to accept an incoming connectionAllow connections from localhost only has been untickedClick No on any of these pop-ups; tick the box again in the API settings (part 3), click OK, and test again; nothing needs adding to Trusted IPs. Clicking Yes is not a fix: it lets that one connection in, whatever sent it, and TWS asks again next time
"did not finish starting the API session" / "closed the API connection before it was ready"TWS may still be starting up or not be fully logged in, or someone may have clicked No on a TWS pop-upWait a minute and test again; if it keeps happening, restart TWS and log in
"refused client id"Another program on this PC is already connected to TWS with that client id (Nexus Trader itself runs only one copy)Close that program; if nothing else is connected, restart TWS, log in, and test again
"PROFILE/ACCOUNT MISMATCH"TWS is logged in to a different kind of account than the mode the bot is in — during setup and in paper mode, TWS is logged in to your live accountLog TWS in to the account that matches the mode: your paper account, unless you have switched the bot to live with Go Live…; ignore any suggestion in the message to edit settings files
Older versions: "did not provide nextValidId", or the test stays on "Connecting to TWS …"Before version 0.2.2 most connection problems showed that one message, and a waiting TWS pop-up could keep the test running indefinitelyWork through the rows above. If you are still in setup, download and run the current installer from the Get started page; a copy that already runs the bot downloads updates by itself and installs them when you restart Nexus Trader outside 04:00–20:00 ET
Repeated "stop check skipped" notices (live)Delayed or missing market data on a live accountSubscribe to live US data (paper mode accepts the delayed feed); allow one trading day
TWS is gone every morning: it closes at night and does not reopen (the main window shows "IBKR NOT reachable" while TWS is closed; a few minutes of it around 10:00 PM New York time is the nightly restart and is normal)TWS is set to Auto logoff; the PC was off, asleep or restarting at the restart time; TWS was closed another way (File → Exit, a crash); or a TWS self-update failed during the restart. If TWS sits at a login window instead, IBKR wants a fresh login (Sunday, or after the same username logged in elsewhere)Start TWS and log in; set TWS's time zone to America/New_York and Lock and Exit to Auto restart at 10:00 PM with Never lock selected (part 3); leave the PC on day and night
Orders never fill, a stop could not be placed, or TWS shows the bot's order with a Transmit button or a warning pop-upRead-Only API is on, or TWS is holding the order for a clickTurn Read-Only off; tick Bypass Order Precautions for API Orders on the API → Precautions page (part 3). Do not click Transmit on an order TWS is already holding: the bot has already given up on it, and sending it late can open or close a position it does not expect. Cancel it in TWS; the bot's regular stop checks replace a missing stop
Everything stopped on a MondayNobody logged TWS in again after IBKR's Sunday resetStart TWS, log in and approve the phone prompt if asked — part 5
Everything stopped after a Windows updateThe PC restarted or went to sleep, and TWS did not come backSign in to Windows, start TWS and log in; leave the PC on and awake day and night
Everything stopped after TWS updated itselfUpdating to TWS 10.45 or later can switch the API off once, for securityOpen the API settings (part 3), tick Enable ActiveX and Socket Clients again, check the rest still matches the table, and click OK
IBKR approved a cash accountThe application answersAsk IBKR to upgrade it to margin before running the bot

Where a row says "test again": during setup, press Test connection again; once the bot is running, it retries by itself.

Anything on the IBKR side — login, data billing, margin approval — is IBKR's client services; Nexus cannot see or log in to your account. Anything the software reports: inquiries@nexustrader.app, and we answer within one business day.

Before you leave it running

  • TWS is logged in to the right account, its time zone is America/New_York, and Lock and Exit is set to Auto restart at 10:00 PM with Never lock selected
  • The API is on, Read-Only is off, and Allow connections from localhost only is ticked
  • Bypass Order Precautions for API Orders is ticked on the API → Precautions page
  • IB Key works on your phone, and you have a weekly reminder to log TWS in again on Sunday
  • The PC stays on and awake day and night
  • The account is dedicated to the bot — nothing else trades in it
  • A test e-mail sent with Send Test Email in the main window has arrived
  • Live only: real-time market data is active (paper runs on the free delayed feed)