Guide 11.1
Intermediate, 8 min read. Checked with Scalpel 1.12.8 on .
In short
The Connection tab decides how Scalpel reaches Interactive Brokers: Host 127.0.0.1 and Port 7497 by default, which must match the API socket port in TWS or IB Gateway. It also holds the IBKR scanner's switch and filters (by default $0.10 to $100, up 10% or more, 30 names, stocks only) and Data recording, which is off by default. Click Apply and the changes take effect at once, with no restart.
Open Settings from the header (or press Ctrl+,, Cmd+, on a Mac). Connection is the first tab. It has three blocks: the link to TWS or IB Gateway 1, the IBKR scanner that feeds every scan panel 2, and the market-data recorder 3.
Scalpel has no data feed or order route of its own. Everything, from the Level 2 book to your fills, goes through the API socket that TWS or IB Gateway opens on your computer. These three settings point Scalpel at it.
| Option | What it does for your trading | Default | Allowed values | When to change it |
|---|---|---|---|---|
| Enabled | Turns the link on or off. Off parks the connection: Scalpel stops retrying, the status bar's IBKR pill reads Off, and the connection banner is hidden. No data, no orders. | On | On or off | Turn it off when you run Scalpel without TWS on purpose (reviewing Analytics in the evening), so it stops trying to connect. Clicking the IBKR pill in the status bar does the same. |
| Host | The computer TWS or IB Gateway runs on. | 127.0.0.1 | An IP address or host name | Almost never. Keep 127.0.0.1 rather than localhost: TWS does not accept the IPv6 address localhost can resolve to. |
| Port | The API socket port Scalpel connects to. It must be the same number as in TWS (Configure > API > Settings > Socket port) or IB Gateway. | 7497 | 1 to 65535 | When TWS or IB Gateway uses another port. A blank or 0 port greys out Apply until you fix it. |
The settings note reads: "Scalpel starts on 7497 for TWS and 4001 for IB Gateway. Host/port changes reconnect on Apply (no restart)." When you change the host or port and click Apply, a Reconnecting to IB toast appears and the link drops and comes back on the new address. Positions and app-monitored stops stay as they are.
Interactive Brokers' programs each suggest a different socket port, depending on the program and on whether you log in to your live or paper account:
| Program | Live login | Paper login |
|---|---|---|
| TWS | 7496 | 7497 |
| IB Gateway | 4001 | 4002 |
Whatever the program shows in its API settings is the number to type here. You do not need IBKR's paper login to practise: Scalpel's own SIM mode is a paper account that fills against the live book.
This is the list every scan panel works from. There is no separate scanner service to pay for: it runs on the Interactive Brokers market data you already have. It runs Interactive Brokers' own market scanner on your TWS connection: top gainers, 3 minute volume spikes, halts, hot by volume and gappers, merged into one list, pre-market included. IBKR refreshes the scans about every 30 seconds; the prices, change and ranking on the panel are live, tick by tick. If you switch it off, every scan panel says "IBKR scanner is off".
| Option | What it does for your trading | Default | Allowed values | When to change it |
|---|---|---|---|---|
| Enabled | Runs the scanner. Turning it on also turns on the scan engine, so the panels come alive. | On | On or off | Off only if you never use scan desks and want the market-data lines for something else. |
| Price min | The cheapest stock the list keeps, in dollars. | 0.1 ($0.10) | 0 or more, decimals allowed | Raise it to 1 or 2 to drop sub-dollar names if you do not trade them. |
| Price max | The most expensive stock the list keeps. | 100 ($100) | At least Price min (a lower number is raised to it) | Lower it to 20 for a classic small-cap momentum band. |
| Min change % | How far a stock must be up on the day, against yesterday's close, pre-market included. The scans are long only, so this is always "up at least". | 10 | 0 or more, decimals allowed | Raise it (20 or 30) on busy days to see only the strongest movers; lower it on quiet days. |
| Min volume | Shares traded today, pre-market included. Drops names that show a big move on a few hundred shares. | Empty (no limit) | A whole number of shares, or empty for no limit | Set 100000 or more if thin, untradeable names keep crowding the list. |
| List size | The most names the list holds. Each name uses one IBKR market-data line. | 30 | 1 to 100 | Lower it if you run short of market-data lines (desks need them too); raise it on a wide-open morning. |
| Max shares out (M) | A cap on shares outstanding, in millions. IBKR does not allow float as a scan filter, so this is the closest stand-in. | Empty (no limit) | Millions, decimals allowed (7.5 is 7.5 million), or empty | Leave it empty unless you need it: names IBKR has no share count for are dropped, and those are often the fresh small caps that run. |
| Stocks only (no ETFs) | Leaves out ETFs, so a leveraged single-stock fund does not double up its underlying on the list. ADRs stay in, since many small-cap runners are ADRs. | On | On or off | Turn it off only if you trade ETFs. |
Scanner changes apply live: the next refresh uses the new filters.
A small-cap momentum trader who only wants $1 to $20 stocks that are up 20% on real volume would set Price min 1, Price max 20, Min change % 20, Min volume 200000 and leave List size at 30. The list then holds at most 30 names and uses 30 market-data lines. Interactive Brokers accounts usually start with 100 lines, so that leaves room for your desks. Setting the filters up step by step is in guide 8.1.
| Option | What it does for your trading | Default | Allowed values | When to change it |
|---|---|---|---|---|
| Enabled | Writes every session's market data, scans and fills to the recordings folder for the replay tools, plus a liquidity log, and opens up to twelve extra TWS connections to capture the IBKR scanner's list. | Off | On or off | Leave it off. It uses disk space (tens of megabytes a day) and TWS connections most traders never need. It does not change anything about your trading. |
It applies live, with no restart. A new file starts each UTC day.