Skip to main content
Version: latest

Config

Backtest

parse_filters_expr(s: str | None)

Parse a pyarrow.dataset filter expression from a string.

>>> parse_filters_expr('field("Currency") == "CHF"')
<pyarrow.dataset.Expression (Currency == "CHF")>
>>> parse_filters_expr("print('hello')")
>>> parse_filters_expr("None")

class BacktestVenueConfig

Bases: NautilusConfig

Represents a venue configuration for one specific backtest engine.

name : str

oms_type : str

account_type : str

starting_balances : list[str]

base_currency : str | None

default_leverage : float

leverages : dict[str, float] | None

book_type : str

routing : bool

frozen_account : bool

bar_execution : bool

reject_stop_orders : bool

support_gtd_orders : bool

support_contingent_orders : bool

use_position_ids : bool

use_random_ids : bool

use_reduce_only : bool

modules : list[ImportableActorConfig] | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class BacktestDataConfig

Bases: NautilusConfig

Represents the data configuration for one specific backtest run.

catalog_path : str

data_cls : str

catalog_fs_protocol : str | None

catalog_fs_storage_options : dict | None

instrument_id : InstrumentId | None

start_time : str | int | None

end_time : str | int | None

filter_expr : str | None

client_id : str | None

metadata : dict | None

bar_spec : str | None

batch_size : int | None

property data_type : type

Return a type for the specified data_cls for the configuration.

  • Return type: type

property query : dict[str, Any]

Return a catalog query object for the configuration.

  • Return type: dict[str, Any]

property start_time_nanos : int

Return the data configuration start time in UNIX nanoseconds.

Will be zero if no start_time was specified.

  • Return type: int

property end_time_nanos : int

Return the data configuration end time in UNIX nanoseconds.

Will be sys.maxsize if no end_time was specified.

  • Return type: int

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class BacktestEngineConfig

Bases: NautilusKernelConfig

Configuration for BacktestEngine instances.

  • Parameters:
    • trader_id (TraderId) – The trader ID for the node (must be a name and ID tag separated by a hyphen).
    • log_level (str , default "INFO") – The stdout log level for the node.
    • loop_debug (bool , default False) – If the asyncio event loop should be in debug mode.
    • cache (CacheConfig , optional) – The cache configuration.
    • data_engine (DataEngineConfig , optional) – The live data engine configuration.
    • risk_engine (RiskEngineConfig , optional) – The live risk engine configuration.
    • exec_engine (ExecEngineConfig , optional) – The live execution engine configuration.
    • streaming (StreamingConfig , optional) – The configuration for streaming to feather files.
    • strategies (list [ImportableStrategyConfig ]) – The strategy configurations for the kernel.
    • actors (list [ImportableActorConfig ]) – The actor configurations for the kernel.
    • exec_algorithms (list [ImportableExecAlgorithmConfig ]) – The execution algorithm configurations for the kernel.
    • controller (ImportableControllerConfig , optional) – The trader controller for the kernel.
    • load_state (bool , default True) – If trading strategy state should be loaded from the database on start.
    • save_state (bool , default True) – If trading strategy state should be saved to the database on stop.
    • bypass_logging (bool , default False) – If logging should be bypassed.
    • run_analysis (bool , default True) – If post backtest performance analysis should be run.

environment : Environment

trader_id : TraderId

data_engine : DataEngineConfig

risk_engine : RiskEngineConfig

exec_engine : ExecEngineConfig

run_analysis : bool

actors : list[ImportableActorConfig]

cache : CacheConfig | None

catalog : DataCatalogConfig | None

controller : ImportableControllerConfig | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

emulator : OrderEmulatorConfig | None

exec_algorithms : list[ImportableExecAlgorithmConfig]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

instance_id : UUID4 | None

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

load_state : bool

logging : LoggingConfig | None

loop_debug : bool

message_bus : MessageBusConfig | None

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

save_state : bool

snapshot_orders : bool

snapshot_positions : bool

snapshot_positions_interval : PositiveFloat | None

strategies : list[ImportableStrategyConfig]

streaming : StreamingConfig | None

timeout_connection : PositiveFloat

timeout_disconnection : PositiveFloat

timeout_portfolio : PositiveFloat

timeout_post_stop : PositiveFloat

timeout_reconciliation : PositiveFloat

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class BacktestRunConfig

Bases: NautilusConfig

Represents the configuration for one specific backtest run.

This includes a backtest engine with its actors and strategies, with the external inputs of venues and data.

  • Parameters:
    • venues (list [BacktestVenueConfig ]) – The venue configurations for the backtest run. A valid configuration must include at least one venue config.
    • data (list [BacktestDataConfig ]) – The data configurations for the backtest run. A valid configuration must include at least one data config.
    • engine (BacktestEngineConfig) – The backtest engine configuration (the core system kernel).
    • batch_size_bytes (optional) – The batch block size in bytes (will then run in streaming mode).

venues : list[BacktestVenueConfig]

data : list[BacktestDataConfig]

engine : BacktestEngineConfig | None

batch_size_bytes : int | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class SimulationModuleConfig

Bases: ActorConfig

Configuration for SimulationModule instances.

component_id : ComponentId | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class FXRolloverInterestConfig

Bases: SimulationModuleConfig

Provides an FX rollover interest simulation module.

  • Parameters: rate_data (pd.DataFrame) – The interest rate data for the internal rollover interest calculator.

rate_data : pd.DataFrame

component_id : ComponentId | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

Cache

class CacheConfig

Bases: NautilusConfig

Configuration for Cache instances.

  • Parameters:
    • database (DatabaseConfig , optional) – The configuration for the cache backing database.
    • encoding (str , {'msgpack' , 'json'} , default 'msgpack') – The encoding for database operations, controls the type of serializer used.
    • timestamps_as_iso8601 – If timestamps should be persisted as ISO 8601 strings. If False then will persit as UNIX nanoseconds.
    • False (default) – If timestamps should be persisted as ISO 8601 strings. If False then will persit as UNIX nanoseconds.
    • buffer_interval_ms (PositiveInt , optional) – The buffer interval (milliseconds) between pipelined/batched transactions. The recommended range if using buffered pipeling is [10, 1000] milliseconds, with a good compromise being 100 milliseconds.
    • use_trader_prefix (bool , default True) – If a ‘trader-’ prefix is used for keys.
    • use_instance_id (bool , default False) – If the traders instance ID is used for keys.
    • flush_on_start (bool , default False) – If database should be flushed on start.
    • drop_instruments_on_reset (bool , default True) – If instruments data should be dropped from the caches memory on reset.
    • tick_capacity (PositiveInt , default 10_000) – The maximum length for internal tick dequeues.
    • bar_capacity (PositiveInt , default 10_000) – The maximum length for internal bar dequeues.

database : DatabaseConfig | None

encoding : str

timestamps_as_iso8601 : bool

buffer_interval_ms : int | None

use_trader_prefix : bool

use_instance_id : bool

flush_on_start : bool

drop_instruments_on_reset : bool

tick_capacity : int

bar_capacity : int

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

Common

exception InvalidConfiguration

Bases: RuntimeError

Raised when there is a violation of a configuration condition, making it invalid.

add_note()

Exception.add_note(note) – add a note to the exception

args

with_traceback()

Exception.with_traceback(tb) – set self._traceback_ to tb and return self.

resolve_path(path: str)

resolve_config_path(path: str)

msgspec_encoding_hook(obj: Any)

msgspec_decoding_hook(obj_type: type, obj: Any)

register_config_encoding(type_: type, encoder: Callable)

register_config_decoding(type_: type, decoder: Callable)

tokenize_config(obj: NautilusConfig)

class NautilusConfig

Bases: Struct

The base class for all Nautilus configuration objects.

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class DatabaseConfig

Bases: NautilusConfig

Configuration for database connections.

  • Parameters:
    • type (str , {'redis'} , default 'redis') – The database type.
    • host (str , optional) – The database host address. If None then should use the typical default.
    • port (int , optional) – The database port. If None then should use the typical default.
    • username (str , optional) – The account username for the database connection.
    • password (str , optional) – The account password for the database connection. If a value is provided then it will be redacted in the string repr for this object.
    • ssl (bool , default False) – If database should use an SSL enabled connection.
    • timeout (int , default 20) – The timeout (seconds) to wait for a new connection.

type : str

host : str | None

port : int | None

username : str | None

password : str | None

ssl : bool

timeout : int | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class MessageBusConfig

Bases: NautilusConfig

Configuration for MessageBus instances.

  • Parameters:
    • database (DatabaseConfig , optional) – The configuration for the message bus backing database.
    • encoding (str , {'msgpack' , 'json'} , default 'msgpack') – The encoding for database operations, controls the type of serializer used.
    • timestamps_as_iso8601 – If timestamps should be persisted as ISO 8601 strings. If False then will persit as UNIX nanoseconds.
    • False (default) – If timestamps should be persisted as ISO 8601 strings. If False then will persit as UNIX nanoseconds.
    • buffer_interval_ms (PositiveInt , optional) – The buffer interval (milliseconds) between pipelined/batched transactions. The recommended range if using buffered pipeling is [10, 1000] milliseconds, with a good compromise being 100 milliseconds.
    • autotrim_mins (int , optional) – The lookback window in minutes for automatic stream trimming. The actual window may extend up to one minute beyond the specified value since streams are trimmed at most once every minute. Note that this feature requires Redis version 6.2.0 or higher; otherwise it will result in a command syntax error.
    • use_trader_prefix (bool , default True) – If a ‘trader-’ prefix is used for stream names.
    • use_trader_id (bool , default True) – If the traders ID is used for stream names.
    • use_instance_id (bool , default False) – If the traders instance ID is used for stream names.
    • streams_prefix (str , default 'streams') – The prefix for externally published stream names (must have a database config). If use_trader_id and use_instance_id are both false, then it becomes possible for many traders to be configured to write to the same streams.
    • types_filter (list *[*type ] , optional) – A list of serializable types not to publish externally.

database : DatabaseConfig | None

encoding : str

timestamps_as_iso8601 : bool

buffer_interval_ms : int | None

autotrim_mins : int | None

use_trader_prefix : bool

use_trader_id : bool

use_instance_id : bool

streams_prefix : str

types_filter : list[type] | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class InstrumentProviderConfig

Bases: NautilusConfig

Configuration for InstrumentProvider instances.

  • Parameters:
    • load_all (bool , default False) – If all venue instruments should be loaded on start.
    • load_ids (FrozenSet [InstrumentId ] , optional) – The list of instrument IDs to be loaded on start (if load_all_instruments is False).
    • filters (frozendict , optional) – The venue specific instrument loading filters to apply.
    • filter_callable (str , optional) – A fully qualified path to a callable that takes a single argument, instrument and returns a bool, indicating whether the instrument should be loaded
    • log_warnings (bool , default True) – If parser warnings should be logged.

load_all : bool

load_ids : frozenset[InstrumentId] | None

filters : dict[str, Any] | None

filter_callable : str | None

log_warnings : bool

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class OrderEmulatorConfig

Bases: NautilusConfig

Configuration for OrderEmulator instances.

  • Parameters: debug (bool , default False) – If debug mode is active (will provide extra debug logging).

debug : bool

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class ActorConfig

Bases: NautilusConfig

The base model for all actor configurations.

  • Parameters: component_id (ComponentId , optional) – The component ID. If None then the identifier will be taken from type(self)._name_.

component_id : ComponentId | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class ImportableActorConfig

Bases: NautilusConfig

Configuration for an actor instance.

  • Parameters:
    • actor_path (str) – The fully qualified name of the Actor class.
    • config_path (str) – The fully qualified name of the Actor Config class.
    • config (dict) – The actor configuration.

actor_path : str

config_path : str

config : dict

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class ActorFactory

Bases: object

Provides actor creation from importable configurations.

static create(config: ImportableActorConfig)

Create an actor from the given configuration.

  • Parameters: config (ImportableActorConfig) – The configuration for the building step.
  • Return type: Actor
  • Raises: TypeError – If config is not of type ImportableActorConfig.

class LoggingConfig

Bases: NautilusConfig

Configuration for standard output and file logging for a NautilusKernel instance.

  • Parameters:
    • log_level (str , default "INFO") – The minimum log level to write to stdout. Will always write ERROR level logs to stderr (unless bypass_logging is True).
    • log_level_file (str , optional) – The minimum log level to write to a log file. If None then no file logging will occur.
    • log_directory (str , optional) – The path to the log file directory. If None then will write to the current working directory.
    • log_file_name (str , optional) – The custom log file name (will use a ‘.log’ suffix for plain text or ‘.json’ for JSON). This will override automatic naming, and no daily file rotation will occur.
    • log_file_format (str { 'JSON' } , optional) – The log file format. If None (default) then will log in plain text.
    • log_colors (bool , default True) – If ANSI codes should be used to produce colored log lines.
    • log_component_levels (dict *[*str , LogLevel ]) – The additional per component log level filters, where keys are component IDs (e.g. actor/strategy IDs) and values are log levels.
    • bypass_logging (bool , default False) – If all logging should be bypassed.
    • print_config (bool , default False) – If the core logging configuration should be printed to stdout at initialization.
    • use_pyo3 (bool , default False) – If the logging system should be initialized via pyo3, this isn’t recommended for backtesting as the performance is much lower but can be useful for seeing logs originating from Rust.

log_level : str

log_level_file : str | None

log_directory : str | None

log_file_name : str | None

log_file_format : str | None

log_colors : bool

log_component_levels : dict[str, str] | None

bypass_logging : bool

use_pyo3 : bool

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class ImportableFactoryConfig

Bases: NautilusConfig

Represents an importable (JSON) factory config.

path : str

create()

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class ImportableConfig

Bases: NautilusConfig

Represents an importable configuration (typically live data client or live execution client).

path : str

config : dict

factory : ImportableFactoryConfig | None

static is_importable(data: dict)

create()

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

Data

class DataEngineConfig

Bases: NautilusConfig

Configuration for DataEngine instances.

  • Parameters:
    • time_bars_build_with_no_updates (bool , default True) – If time bar aggregators will build and emit bars with no new market updates.
    • time_bars_timestamp_on_close (bool , default True) – If time bar aggregators will timestamp ts_event on bar close. If False then will timestamp on bar open.
    • time_bars_interval_type (str , default 'left-open') – Determines the type of interval used for time aggregation.
      • ‘left-open’: start time is excluded and end time is included (default).
      • ‘right-open’: start time is included and end time is excluded.
    • validate_data_sequence (bool , default False) – If data objects timestamp sequencing will be validated and handled.
    • buffer_deltas (bool , default False) – If order book deltas should be buffered until the F_LAST flag is set for a delta.
    • debug (bool , default False) – If debug mode is active (will provide extra debug logging).

time_bars_build_with_no_updates : bool

time_bars_timestamp_on_close : bool

time_bars_interval_type : str

validate_data_sequence : bool

buffer_deltas : bool

debug : bool

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

Execution

class ExecEngineConfig

Bases: NautilusConfig

Configuration for ExecutionEngine instances.

  • Parameters:
    • load_cache (bool , default True) – If the cache should be loaded on initialization.
    • debug (bool , default False) – If debug mode is active (will provide extra debug logging).

load_cache : bool

debug : bool

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class ExecAlgorithmConfig

Bases: NautilusConfig

The base model for all execution algorithm configurations.

  • Parameters: exec_algorithm_id (ExecAlgorithmId , optional) – The unique ID for the execution algorithm. If not None then will become the execution algorithm ID.

exec_algorithm_id : ExecAlgorithmId | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class ImportableExecAlgorithmConfig

Bases: NautilusConfig

Configuration for an execution algorithm instance.

  • Parameters:
    • exec_algorithm_path (str) – The fully qualified name of the execution algorithm class.
    • config_path (str) – The fully qualified name of the config class.
    • config (dict *[*str , Any ]) – The execution algorithm configuration.

exec_algorithm_path : str

config_path : str

config : dict[str, Any]

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class ExecAlgorithmFactory

Bases: object

Provides execution algorithm creation from importable configurations.

static create(config: ImportableExecAlgorithmConfig)

Create an execution algorithm from the given configuration.

Live

class LiveDataEngineConfig

Bases: DataEngineConfig

Configuration for LiveDataEngine instances.

  • Parameters: qsize (PositiveInt , default 100_000) – The queue size for the engines internal queue buffers.

qsize : int

buffer_deltas : bool

debug : bool

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

time_bars_build_with_no_updates : bool

time_bars_interval_type : str

time_bars_timestamp_on_close : bool

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

validate_data_sequence : bool

class LiveRiskEngineConfig

Bases: RiskEngineConfig

Configuration for LiveRiskEngine instances.

  • Parameters: qsize (PositiveInt , default 100_000) – The queue size for the engines internal queue buffers.

qsize : int

bypass : bool

debug : bool

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

max_notional_per_order : dict[str, int]

max_order_modify_rate : str

max_order_submit_rate : str

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class LiveExecEngineConfig

Bases: ExecEngineConfig

Configuration for LiveExecEngine instances.

The purpose of the in-flight order check is for live reconciliation, events emitted from the venue may have been lost at some point - leaving an order in an intermediate state, the check can recover these events via status reports.

  • Parameters:
    • reconciliation (bool , default True) – If reconciliation is active at start-up.
    • reconciliation_lookback_mins (NonNegativeInt , optional) – The maximum lookback minutes to reconcile state for. If None or 0 then will use the maximum lookback available from the venues.
    • filter_unclaimed_external_orders (bool , default False) – If unclaimed order events with an EXTERNAL strategy ID should be filtered/dropped.
    • filter_position_reports (bool , default False) – If position status reports are filtered from reconciliation. This may be applicable when other nodes are trading the same instrument(s), on the same account - which could cause conflicts in position status.
    • inflight_check_interval_ms (NonNegativeInt , default 2_000) – The interval (milliseconds) between checking whether in-flight orders have exceeded their time-in-flight threshold. This should not be set less than the inflight_check_interval_ms.
    • inflight_check_threshold_ms (NonNegativeInt , default 5_000) – The threshold (milliseconds) beyond which an in-flight orders status is checked with the venue. As a rule of thumb, you shouldn’t consider reducing this setting unless you are colocated with the venue (to avoid the potential for race conditions).
    • qsize (PositiveInt , default 100_000) – The queue size for the engines internal queue buffers.

reconciliation : bool

reconciliation_lookback_mins : int | None

filter_unclaimed_external_orders : bool

filter_position_reports : bool

inflight_check_interval_ms : int

inflight_check_threshold_ms : int

qsize : int

debug : bool

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

load_cache : bool

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class RoutingConfig

Bases: NautilusConfig

Configuration for live client message routing.

  • Parameters:
    • default (bool) – If the client should be registered as the default routing client (when a specific venue routing cannot be found).
    • venues (list *[*str ] , optional) – The venues to register for routing.

default : bool

venues : frozenset[str] | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class LiveDataClientConfig

Bases: NautilusConfig

Configuration for LiveDataClient instances.

  • Parameters:
    • handle_revised_bars (bool) – If DataClient will emit bar updates when a new bar opens.
    • instrument_provider (InstrumentProviderConfig) – The clients instrument provider configuration.
    • routing (RoutingConfig) – The clients message routing config.

handle_revised_bars : bool

instrument_provider : InstrumentProviderConfig

routing : RoutingConfig

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class LiveExecClientConfig

Bases: NautilusConfig

Configuration for LiveExecutionClient instances.

instrument_provider : InstrumentProviderConfig

routing : RoutingConfig

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class ControllerConfig

Bases: ActorConfig

The base model for all controller configurations.

component_id : ComponentId | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class ControllerFactory

Bases: object

Provides controller creation from importable configurations.

static create(config: ImportableControllerConfig, trader)

class TradingNodeConfig

Bases: NautilusKernelConfig

Configuration for TradingNode instances.

  • Parameters:
    • trader_id (TraderId , default "TRADER-000") – The trader ID for the node (must be a name and ID tag separated by a hyphen).
    • cache (CacheConfig , optional) – The cache configuration.
    • data_engine (LiveDataEngineConfig , optional) – The live data engine configuration.
    • risk_engine (LiveRiskEngineConfig , optional) – The live risk engine configuration.
    • exec_engine (LiveExecEngineConfig , optional) – The live execution engine configuration.
    • data_clients (dict *[*str , ImportableConfig | LiveDataClientConfig ] , optional) – The data client configurations.
    • exec_clients (dict *[*str , ImportableConfig | LiveExecClientConfig ] , optional) – The execution client configurations.
    • heartbeat_interval (PositiveFloat , optional) – The heartbeat interval (seconds) to use for trading node health.

environment : Environment

trader_id : TraderId

data_engine : LiveDataEngineConfig

risk_engine : LiveRiskEngineConfig

exec_engine : LiveExecEngineConfig

data_clients : dict[str, LiveDataClientConfig]

exec_clients : dict[str, LiveExecClientConfig]

heartbeat_interval : PositiveFloat | None

actors : list[ImportableActorConfig]

cache : CacheConfig | None

catalog : DataCatalogConfig | None

controller : ImportableControllerConfig | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

emulator : OrderEmulatorConfig | None

exec_algorithms : list[ImportableExecAlgorithmConfig]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

instance_id : UUID4 | None

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

load_state : bool

logging : LoggingConfig | None

loop_debug : bool

message_bus : MessageBusConfig | None

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

save_state : bool

snapshot_orders : bool

snapshot_positions : bool

snapshot_positions_interval : PositiveFloat | None

strategies : list[ImportableStrategyConfig]

streaming : StreamingConfig | None

timeout_connection : PositiveFloat

timeout_disconnection : PositiveFloat

timeout_portfolio : PositiveFloat

timeout_post_stop : PositiveFloat

timeout_reconciliation : PositiveFloat

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

Persistence

class StreamingConfig

Bases: NautilusConfig

Configuration for streaming live or backtest runs to the catalog in feather format.

  • Parameters:
    • catalog_path (str) – The path to the data catalog.
    • fs_protocol (str , optional) – The fsspec filesystem protocol for the catalog.
    • fs_storage_options (dict , optional) – The fsspec storage options.
    • flush_interval_ms (int , optional) – The flush interval (milliseconds) for writing chunks.
    • replace_existing (bool , default False) – If any existing feather files should be replaced.
    • include_types (list *[*type ] , optional) – A list of Arrow serializable types to write. If this is specified then only the included types will be written.

catalog_path : str

fs_protocol : str | None

fs_storage_options : dict | None

flush_interval_ms : int | None

replace_existing : bool

include_types : list[type] | None

property fs

as_catalog()

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class DataCatalogConfig

Bases: NautilusConfig

Configuration for a data catalog.

  • Parameters:
    • path (str) – The path to the data catalog.
    • fs_protocol (str , optional) – The fsspec file system protocol for the data catalog.
    • fs_storage_options (dict , optional) – The fsspec storage options for the data catalog.

path : str

fs_protocol : str | None

fs_storage_options : dict | None

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

Risk

class RiskEngineConfig

Bases: NautilusConfig

Configuration for RiskEngine instances.

  • Parameters:
    • bypass (bool , default False) – If True then will bypass all pre-trade risk checks and rate limits (will still check for duplicate IDs).
    • max_order_submit_rate (str , default 100/00:00:01) – The maximum rate of submit order commands per timedelta.
    • max_order_modify_rate (str , default 100/00:00:01) – The maximum rate of modify order commands per timedelta.
    • max_notional_per_order (dict *[*str , int ] , default empty dict) – The maximum notional value of an order per instrument ID. The value should be a valid decimal format.
    • debug (bool , default False) – If debug mode is active (will provide extra debug logging).

bypass : bool

max_order_submit_rate : str

max_order_modify_rate : str

max_notional_per_order : dict[str, int]

debug : bool

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

System

class NautilusKernelConfig

Bases: NautilusConfig

Configuration for a NautilusKernel core system instance.

  • Parameters:
    • environment (Environment { BACKTEST, SANDBOX, LIVE }) – The kernel environment context.
    • trader_id (TraderId) – The trader ID for the kernel (must be a name and ID tag separated by a hyphen).
    • cache (CacheConfig , optional) – The cache configuration.
    • message_bus (MessageBusConfig , optional) – The message bus configuration.
    • data_engine (DataEngineConfig , optional) – The live data engine configuration.
    • risk_engine (RiskEngineConfig , optional) – The live risk engine configuration.
    • exec_engine (ExecEngineConfig , optional) – The live execution engine configuration.
    • emulator (OrderEmulatorConfig , optional) – The order emulator configuration.
    • streaming (StreamingConfig , optional) – The configuration for streaming to feather files.
    • catalog (DataCatalogConfig , optional) – The data catalog config.
    • actors (list [ImportableActorConfig ]) – The actor configurations for the kernel.
    • strategies (list [ImportableStrategyConfig ]) – The strategy configurations for the kernel.
    • exec_algorithms (list [ImportableExecAlgorithmConfig ]) – The execution algorithm configurations for the kernel.
    • controller (ImportableControllerConfig , optional) – The trader controller for the kernel.
    • load_state (bool , default True) – If trading strategy state should be loaded from the database on start.
    • save_state (bool , default True) – If trading strategy state should be saved to the database on stop.
    • loop_debug (bool , default False) – If the asyncio event loop should be in debug mode.
    • logging (LoggingConfig , optional) – The logging config for the kernel.
    • snapshot_orders (bool , default False) – If order state snapshot lists should be persisted. Snapshots will be taken at every order state update (when events are applied).
    • snapshot_positions (bool , default False) – If position state snapshot lists should be persisted. Snapshots will be taken at position opened, changed and closed (when events are applied). To include the unrealized PnL in the snapshot then quotes for the positions instrument must be available in the cache.
    • snapshot_positions_interval (PositiveFloat , optional) – The interval (seconds) at which additional position state snapshots are persisted. If None then no additional snapshots will be taken. To include the unrealized PnL in the snapshot then quotes for the positions instrument must be available in the cache.
    • timeout_connection (PositiveFloat *(*seconds )) – The timeout for all clients to connect and initialize.
    • timeout_reconciliation (PositiveFloat *(*seconds )) – The timeout for execution state to reconcile.
    • timeout_portfolio (PositiveFloat *(*seconds )) – The timeout for portfolio to initialize margins and unrealized PnLs.
    • timeout_disconnection (PositiveFloat *(*seconds )) – The timeout for all engine clients to disconnect.
    • timeout_post_stop (PositiveFloat *(*seconds )) – The timeout after stopping the node to await residual events before final shutdown.

environment : Environment

trader_id : TraderId

instance_id : UUID4 | None

cache : CacheConfig | None

message_bus : MessageBusConfig | None

data_engine : DataEngineConfig | None

risk_engine : RiskEngineConfig | None

exec_engine : ExecEngineConfig | None

emulator : OrderEmulatorConfig | None

streaming : StreamingConfig | None

catalog : DataCatalogConfig | None

actors : list[ImportableActorConfig]

strategies : list[ImportableStrategyConfig]

exec_algorithms : list[ImportableExecAlgorithmConfig]

controller : ImportableControllerConfig | None

load_state : bool

save_state : bool

loop_debug : bool

logging : LoggingConfig | None

snapshot_orders : bool

snapshot_positions : bool

snapshot_positions_interval : float | None

timeout_connection : float

timeout_reconciliation : float

timeout_portfolio : float

timeout_disconnection : float

timeout_post_stop : float

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

Trading

class StrategyConfig

Bases: NautilusConfig

The base model for all trading strategy configurations.

  • Parameters:
    • strategy_id (StrategyId , optional) – The unique ID for the strategy. Will become the strategy ID if not None.
    • order_id_tag (str , optional) – The unique order ID tag for the strategy. Must be unique amongst all running strategies for a particular trader ID.
    • oms_type (OmsType , optional) – The order management system type for the strategy. This will determine how the ExecutionEngine handles position IDs.
    • external_order_claims (list [InstrumentId ] , optional) – The external order claim instrument IDs. External orders for matching instrument IDs will be associated with (claimed by) the strategy.
    • manage_contingent_orders (bool , default False) – If OUO and OCO open contingent orders should be managed automatically by the strategy. Any emulated orders which are active local will be managed by the OrderEmulator instead.
    • manage_gtd_expiry (bool , default False) – If all order GTD time in force expirations should be managed by the strategy. If True then will ensure open orders have their GTD timers re-activated on start.

strategy_id : StrategyId | None

order_id_tag : str | None

oms_type : str | None

external_order_claims : list[InstrumentId] | None

manage_contingent_orders : bool

manage_gtd_expiry : bool

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class ImportableStrategyConfig

Bases: NautilusConfig

Configuration for a trading strategy instance.

  • Parameters:
    • strategy_path (str) – The fully qualified name of the strategy class.
    • config_path (str) – The fully qualified name of the config class.
    • config (dict *[*str , Any ]) – The strategy configuration.

strategy_path : str

config_path : str

config : dict[str, Any]

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool

class StrategyFactory

Bases: object

Provides strategy creation from importable configurations.

static create(config: ImportableStrategyConfig)

Create a trading strategy from the given configuration.

  • Parameters: config (ImportableStrategyConfig) – The configuration for the building step.
  • Return type: Strategy
  • Raises: TypeError – If config is not of type ImportableStrategyConfig.

class ImportableControllerConfig

Bases: NautilusConfig

Configuration for a controller instance.

  • Parameters:
    • controller_path (str) – The fully qualified name of the controller class.
    • config_path (str) – The fully qualified name of the config class.
    • config (dict *[*str , Any ]) – The controller configuration.

controller_path : str

config_path : str

config : dict

dict()

Return a dictionary representation of the configuration.

  • Return type: dict[str, Any]

classmethod fully_qualified_name()

Return the fully qualified name for the NautilusConfig class.

  • Return type: str

property id : str

Return the hashed identifier for the configuration.

  • Return type: str

json()

Return serialized JSON encoded bytes.

  • Return type: bytes

json_primitives()

Return a dictionary representation of the configuration with JSON primitive types as values.

  • Return type: dict[str, Any]

classmethod parse(raw: bytes | str)

Return a decoded object of the given cls.

  • Parameters:
    • cls (type) – The type to decode to.
    • raw (bytes or str) – The raw bytes or JSON string to decode.
  • Return type: Any

validate()

Return whether the configuration can be represented as valid JSON.

  • Return type: bool