Nexus deep diveStep 7 · ExecuteCompanion to the case study
From a target book to broker orders, with brakes at every step and a reconciliation before every cycle.
The trader runs the book that research promotes, sized by the same position engine the backtest used. A scheduler sends each market's orders at its own exchange's time, staged pre-trade limits check every order, independent brakes can stop trading at once, and positions, funding and fills are reconciled with the broker. It all runs every trading day.
Filled orders read on 2026-11-27 from the trader's order records, through the site's figures register; markets, position checks and drills read on 2026-10-15 from the trader's schedule, reconciliation and drill records. The order figures on this page are from the demo account.
The Nexus overview shows step 7 as orders passing staged limits on their way to the broker. This is the whole path, and every step of it runs every trading day.
An account trades only the research book promoted for it. If that link is unknown or wrong, new risk is removed and exits still go out.
The trader and research pin the same position engine, so a backtest and the live book can't disagree about how a signal becomes a position.
The book is built only when every input market's data is complete. A closed market takes no orders, and stakes are rounded to the broker's deal steps.
Every order passes the pre-trade limits. A flip is a close, then an open that is sent only after the close confirms.
Positions are checked against the broker before every cycle. Funding and fills are reconciled every night.
For your firmEvery trading day starts with a full-book dry run before the first slot, 78 of them since 24 August, so the day's orders are rehearsed before any reach the broker.
Every order is checked against size, notional and position limits, set for 122 scopes from a single instrument up to a whole asset class. The limits are staged from off to warn to block, and the next stage is switched on only when the evidence says it is safe.
Maximum order size, maximum notional and maximum position are checked on every order, and any breach is written on the order record itself.
No stage ever refuses an order that reduces a position, so a limit can't trap the book. The check still runs and is recorded.
Each order's price is compared with an independently captured price, and unusable quotes are caught.
A margin cap trims the plan or stops the run before anything reaches the broker. It has never had to fire in production, and a drill proved that it works.
Alerts fire at 50% and 80% of a limit, with hysteresis so they don't flap.
Block mode refuses a breach, and it refuses any instrument that has no limit set. It goes live only once a replay of real fills under block refuses nothing. The replay of 2 September 2026 refused none of 306 fills, and block is now set account by account, on the operator's word.
The model contract describes what a strategy wants to hold. A broker contract describes what Nexus can trade, how it sends an order, and what the broker reports back. Each broker gets an adapter: a translator between its own API and the common language of the trading engine.
The aim is to connect a second broker without rewriting the strategy, risk controls or reconciliation. Nexus already has the starting interface and an account-based adapter selector. IG is implemented; Interactive Brokers is a placeholder. A fully portable contract is the next step, proposed here. The first implementation would use IG. IB could be added alongside it later, on separately configured accounts.
A common method name is only the beginning. The contract also fixes units, identity, freshness and failure behaviour. These are the eight parts a second adapter should satisfy.
| Element | What crosses the boundary | Where Nexus stands |
|---|---|---|
| 1. Account & session | Broker, account and demo/paper/live identity; connect, disconnect, health and permissions. Every result belongs to one account and environment. | Exists: account registry, adapter selection, login and authentication. To add: a common health and reconnect contract. |
| 2. Instruments & units | Research ticker → exact tradable product, venue and expiry; broker ID, quantity unit, minimum and increment, price tick, point value, currency and trading hours. | Exists for IG: market lookup and dealing rules. To add: IB contract resolution and futures specifications. |
| 3. Quotes & capabilities | Timestamped bid/offer and market status, with source and freshness; supported order types, time-in-force, cancel/replace and data permissions. Unsupported requests receive a named refusal. | Exists for IG: quotes and market rules. To add: a versioned capability declaration and common quote shape. |
| 4. Order requests | Account, instrument, side, quantity and unit, type, optional limit price, time-in-force, intent ID and book/run attribution. Submit, inspect, cancel; replace only when supported. | Exists: order placement through the interface. To add: typed neutral requests and cancellation semantics. |
| 5. Order events & fills | Broker order and execution IDs, status, each partial fill, remaining quantity, price, fees and timestamps. Acceptance, execution and cancellation are distinct events. | Exists for IG: confirmation and fill recording. To add: a common event lifecycle, replay and deduplication. |
| 6. Positions & capital | Positions by exact contract, signed quantity and unit, average price; cash by currency, equity, available funds, initial/maintenance margin and valuation time. | Exists: shared position and account records. To add: explicit units, freshness and multi-currency/margin semantics. |
| 7. History & reconciliation | Open orders, executions, cash movements, commissions, funding and statements, with stable IDs and retrieval checkpoints. Nexus compares them with its own ledger. | Exists for IG: position, funding and fill workflows. To add: a portable history contract and IB reconciliation. |
| 8. Failures & recovery | Named rejection, unavailable data, lost session, rate limit or unknown order outcome; bounded retries and an audit trail of request, reply and recovery. | Exists for IG: pacing and error handling. To add: shared failure meanings and restart/recovery proofs. |
The current BrokerClient protocol has seven methods, an authentication flag and account configuration. The factory selects IG, the internal simulator or the IB stub from the account's broker setting.
login() / authenticatedaccount()positions()market(epic)search_markets(term)place_order(order, currency)confirm(reference)BrokerPosition already holds an instrument key, signed size, average level, deal IDs and currency. BrokerAccountSnapshot holds equity, available funds, balance, margin used, P&L, currency and account ID.
Several calls still return raw dictionaries, and execution callers still interpret IG fields such as dealStatus. The records also lack explicit quantity units and observation times. The interface is a useful starting point; completing the neutral types and migrating their callers is part of making a second broker work.
A broker switch starts from the desired exposure and sizes it for that broker's product. Copying the order quantity would change the risk.
£ per point
Exposure becomes a stake on the mapped IG market, rounded to that account's dealing increment. The price convention and point value determine its money exposure.
Whole contracts
Exposure becomes a number of a specific futures contract, using its multiplier and currency, then FX into the book's currency. Expiry, roll, fees and margin need their own treatment.
The promise of plug-and-playChoose an admitted broker adapter and account; reuse the model and the control framework. Recalculate quantities and costs for its instruments. Equivalent exposure is the objective; identical fills, costs and returns are not guaranteed. A new adapter must pass the same conformance checks before it is selectable for execution.
This is an illustrative message contract, not a callable API or an enabled IB account.
Duplicate or out-of-order notifications must not double-count a fill or roll back a completed state. A cancel request is pending until confirmed; a fill can arrive while cancellation is in flight. Missing balances or stale positions must be reported as unavailable, never silently turned into a zero position or a healthy account.
Where the responsibility staysNexus decides what to trade and whether the controls permit it; the adapter translates and reports broker facts. A capability mismatch stops admission. Adding IB does not automatically reroute an IG order, transfer an open position, or authorise live money.
The IG REST client places orders, confirms them and reads positions, selecting demo or live by account configuration. It paces requests to IG's allowance. The recorded sample had 780 confirmed orders; median send and confirmation times over 696 confirmed orders were 74 ms and 71 ms. Rejections fell from 117 in July to none in the October sample. These are the original dated measurements, not a new live readout.
Broker section checked against trader source on 26 October 2026: the broker protocol and records, adapter factory, IB stub, account registry and IG execution callers. The fuller contract above is a proposal; the target specification and transition plan are recorded in the engineering handbook. IB's official documentation describes contract identity and fields and the order callbacks an adapter must monitor. The rest of this page retains its dated operational evidence.
A reconciliation is only useful if it can stop trading. The position check can, and it has: 74 live runs were stopped because the books didn't agree or the check couldn't finish.
Positions are checked against the broker before each trading cycle, and a break halts the run. There have been 1,085 checks since 26 July. Since 15 September, 227 of 230 were clean.
A daily check compares the trader's book with research's targets. It has run 182 times and halted trading 3 times.
IG transaction history is pulled every night and reconciled against the model's funding, and breaks are flagged for follow-up.
Fills sync into the portfolio ledger every night: 361 transactions over 53 runs since 23 August.
Each trading day is audited the next morning, 168 times so far.
Reconciliation against the broker's statements is built and has not run yet.
A resident scheduler trades each of 37 markets at its local exchange time, in Chicago, New York and London, and stays correct across daylight-saving changes. It made 908 live runs over 90 trading days, from 7 July to 14 October.
How it is scheduledEvery trading job is a systemd unit on the production host, with no separate job framework: Scheduled by systemd.
Each control is shown at the stage it has reached in production.
Sources, read 2026-10-15: the trader's order, account, schedule, scheduler-run, limit, reconciliation and drill records; the portfolio ledger's sync runs; the deployed versions of the trader and the research service; the trader's code and documentation on its main branch; and the handbook's status page.
I can set up the order path, the pre-trade controls and the reconciliation around your book.