System

class NautilusKernel ( name : str , config : NautilusKernelConfig , loop : Optional [ AbstractEventLoop ] = None , loop_sig_callback : Optional [ Callable ] = None )

Bases: object

Provides the core Nautilus system kernel.

The kernel is common between backtest, sandbox and live environment context types.

Parameters :
  • name ( str ) – The name for the kernel (will prepend all log messages).

  • config ( NautilusKernelConfig ) – The configuration for the kernel instance.

  • loop ( asyncio.AbstractEventLoop , optional ) – The event loop for the kernel.

  • loop_sig_callback ( Callable , optional ) – The callback for the signal handler.

Raises :
  • ValueError – If name is not a valid string.

  • TypeError – If any configuration object is not of the expected type.

property environment : Environment

Return the kernels environment context { BACKTEST , SANDBOX , LIVE }.

Returns :

Environment

property loop : AbstractEventLoop

Return the kernels event loop.

Returns :

AbstractEventLoop

property loop_sig_callback : Optional [ Callable ]

Return the kernels signal handling callback.

Returns :

Callable or None

property executor : Optional [ ThreadPoolExecutor ]

Return the kernels default executor.

Returns :

ThreadPoolExecutor or None

property name : str

Return the kernels name.

Returns :

str

property trader_id : TraderId

Return the kernels trader ID.

Returns :

TraderId

property machine_id : str

Return the kernels machine ID.

Returns :

str

property instance_id : UUID4

Return the kernels instance ID.

Returns :

UUID4

property ts_created : int

Return the UNIX timestamp (nanoseconds) when the kernel was created.

Returns :

uint64_t

property load_state : bool

If the kernel has been configured to load actor and strategy state.

Returns :

bool

property save_state : bool

If the kernel has been configured to save actor and strategy state.

Returns :

bool

property clock : Clock

Return the kernels clock.

Returns :

Clock

property log : LoggerAdapter

Return the kernels logger adapter.

Returns :

LoggerAdapter

property logger : Logger

Return the kernels logger.

Returns :

Logger

property msgbus : MessageBus

Return the kernels message bus.

Returns :

MessageBus

property cache : CacheFacade

Return the kernels read-only cache instance.

Returns :

CacheFacade

property portfolio : PortfolioFacade

Return the kernels read-only portfolio instance.

Returns :

PortfolioFacade

property data_engine : DataEngine

Return the kernels data engine.

Returns :

DataEngine

property risk_engine : RiskEngine

Return the kernels risk engine.

Returns :

RiskEngine

property exec_engine : ExecutionEngine

Return the kernels execution engine.

Returns :

ExecutionEngine

property emulator : OrderEmulator

Return the kernels order emulator.

Returns :

OrderEmulator

property trader : Trader

Return the kernels trader instance.

Returns :

Trader

property writer : Optional [ StreamingFeatherWriter ]

Return the kernels writer.

Returns :

StreamingFeatherWriter or None

property catalog : Optional [ ParquetDataCatalog ]

Return the kernels data catalog.

Returns :

ParquetDataCatalog or None

dispose ( ) None

Dispose of the kernel releasing system resources.

This method is idempotent and irreversible. No other methods should be called after disposal.