Principle:Nautechsystems Nautilus trader Strategy Registration
| Field | Value |
|---|---|
| sources | https://github.com/nautechsystems/nautilus_trader , https://nautilustrader.io/docs/ |
| domains | backtesting, strategy management, trading system architecture |
| last_updated | 2026-02-10 12:00 GMT |
Overview
Strategy Registration is the principle of attaching one or more trading strategy instances to an execution environment so that they receive market data events, can submit orders, and participate in the system lifecycle.
Description
A trading strategy encapsulates the decision-making logic that transforms market observations into trading actions. However, a strategy cannot operate in isolation -- it must be wired into a runtime environment that provides data subscriptions, order routing, portfolio access, risk checks, and lifecycle management. Strategy registration is the step that performs this wiring.
The principle addresses the following concerns:
- Lifecycle integration -- A registered strategy is managed by the engine's
Tradercomponent, which starts, stops, resets, and disposes it in coordination with the rest of the system. Unregistered strategies would miss lifecycle events and could leak resources. - Message bus subscription -- Registration connects the strategy to the kernel's message bus, enabling it to subscribe to data topics (quotes, trades, bars) and receive execution reports (order fills, position updates).
- Execution routing -- Registered strategies can submit orders through the execution engine, which routes them to the correct venue's execution client. Without registration, the strategy would have no path to the matching engine.
- Portfolio and cache access -- Registration provides the strategy with references to the portfolio (for position and balance queries) and the cache (for instrument lookups), both of which are owned by the kernel.
- Multi-strategy support -- Multiple strategies can be registered with the same engine. Each strategy has a unique
StrategyIdthat tags its orders and positions, enabling per-strategy PnL attribution and risk management.
Usage
Apply this principle whenever you need to:
- Run one or more trading strategies in a backtest.
- Ensure strategies are properly wired to data feeds, execution, and portfolio services.
- Test strategy lifecycle behavior (initialization, start, stop, dispose).
- Compose a portfolio of strategies that trade different instruments or employ different signals.
Theoretical Basis
Strategy registration follows the Plugin/Component pattern, where the engine acts as a host container and each strategy is a pluggable component that conforms to a known interface.
Key theoretical elements:
- Strategy as component -- A strategy extends a base
Strategyclass that defines lifecycle hooks (on_start,on_stop,on_data,on_event) and provides convenience methods for subscribing to data and submitting orders. - Trader as registry -- The
Traderobject (owned by the kernel) maintains a list of registered strategies. Registration is delegated fromBacktestEngine.add_strategy()toTrader.add_strategy(), which performs identity validation and wiring. - Deferred initialization -- Strategies are registered before the backtest run begins. Their
on_starthook is called only whenengine.run()triggers the kernel start sequence. This ensures that all data, venues, and instruments are fully set up before any strategy logic executes. - Idempotent identity -- Each strategy carries a
StrategyId(e.g.,"MyStrategy-001"). The trader validates that no duplicate IDs are registered, preventing accidental double-registration.
Pseudocode:
FUNCTION register_strategy(engine, strategy):
VALIDATE strategy is of type Strategy
VALIDATE strategy.id is unique among registered strategies
engine.kernel.trader.add_strategy(strategy)
-- Wires strategy to msgbus, cache, portfolio, clock
-- Registers strategy ID for order/position tagging
LOG "Added strategy {strategy.id}"