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.
- The broker account — apply, fund, market data, two-factor. Mostly waiting; start it first.
- Install Trader Workstation — 15 minutes.
- The five TWS settings the bot needs — 5 minutes, and the part people get wrong.
- Install Nexus Trader and run the setup wizard — 10 minutes.
- First day, and the one weekly duty.
- Going live later, and what to do when something does not work.
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.
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.
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.
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.
Then share the data with your paper account — in Client Portal under Settings → Paper Trading Account, turn on sharing of your market-data subscriptions. Without it, your paper weeks run on delayed data and you will see exactly the failures above.
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. This is what makes an unattended trading week possible — and it is also the reason for the one weekly duty in part 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.
Download and install
On the IBKR website go to Trading → Trading Platforms → Trader Workstation and take the Stable Windows build, not the latest beta. 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.
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. Leave TWS running — minimised is fine. Do not place trades by hand in the account the bot manages.
3 · The five TWS settings the bot needs
This is the part that decides whether anything works. It takes five 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.
Turn on the API
In TWS: Edit → Global Configuration → API → Settings (File instead of Edit in the Mosaic layout). Set exactly this:
| Setting | Value | Why |
|---|---|---|
| Enable ActiveX and Socket Clients | ON | The API switch. Off, and the bot cannot connect at all. |
| Read-Only API | OFF | Read-only blocks every order — including the protective stop orders. |
| Socket port | 7497 paper 7496 live | The number the bot dials. It must match the mode you are in. |
| Allow connections from localhost only | ON | The 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 connection | ON | Lets 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 ID | leave blank | Not used. |
Click OK. If TWS asks to restart, let it.
Know which port goes with which mode
| Mode | Program | Account | Port |
|---|---|---|---|
| Paper (where you start) | Trader Workstation | DU… | 7497 |
| Live (later, by approval) | Trader Workstation | U… | 7496 |
| Advanced, optional | IB Gateway | paper / live | 4002 / 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.
Set TWS to restart, not log off
By default TWS logs itself off once a day and waits for a human. That would leave the bot disconnected every morning. In TWS: Configure → Lock and Exit (in some layouts Edit → Global Configuration → Lock and Exit), choose Auto restart, and set the time outside 04:00–20:00 ET — late evening is the usual choice. Check which time zone the setting uses before you pick.
With Auto restart and IB Key together, TWS restarts and logs itself back in each day without asking you for anything.
Keep the PC on and awake
The bot must run 04:00–20:00 ET on trading days. Nexus Trader's installer switches off sleep while the PC is on mains power, but the machine still has to be on. Let Windows Update restart in the evening, not during the trading window.
4 · Install Nexus Trader
The installer is self-contained: no Python, no dependencies, nothing else to install. About 55 MB, Windows 10 or 11.
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.
Start it — the setup wizard opens
Five 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.
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.
Enter your licence key
The key arrives by e-mail. Paper mode is free and the licence is checked once a day; it keeps working for seven days without internet.
Choose where alerts go
One address receives act-now alerts, an evening summary at 20:00 ET and a monthly statement. Important only is the setting to keep — it e-mails you when something needs attention rather than on every action. Send yourself the test e-mail before continuing.
Review and finish
The last step repeats what will be saved and where. Press Finish.
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.
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.
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.
You are e-mailed when something needs you, and otherwise left alone.
The weekly duty: approve the IBKR login
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.
7 · When something does not work
| What you see | What it usually means | What 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 match | Start TWS and log in to your paper account; tick Enable ActiveX and Socket Clients; check the port against the table in part 3 |
| "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 connection | Look 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 connection | Allow connections from localhost only has been unticked | Click 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-up | Wait 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 the paper trial, TWS is logged in to your live account | Log 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 indefinitely | Work 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" e-mails | Delayed or missing market data | Subscribe to live US data and share it with the paper account; allow one trading day |
| Orders never fill, or a stop could not be placed | Read-Only API is on, or a precaution dialog is holding the order | Turn Read-Only off; see the precautions note in part 3 |
| Everything stopped on a Monday | The weekly IBKR re-login was not approved | Log in to TWS and approve IB Key — part 5 |
| Everything stopped after a Windows update | The PC rebooted or went to sleep, and TWS did not come back | Start TWS and log in; keep the PC awake 04:00–20:00 ET |
| Everything stopped after TWS updated itself | Updating to TWS 10.45 or later can switch the API off once, for security | Open 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 account | The application answers | Ask 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 and set to Auto restart outside 04:00–20:00 ET
- The API is on, Read-Only is off, and Allow connections from localhost only is ticked
- Live market data is active and shared with the paper account
- IB Key works on your phone, and you have a weekly reminder to approve the Sunday login
- The PC stays on and awake through the trading day
- The account is dedicated to the bot — nothing else trades in it
- The test e-mail from the setup wizard arrived