Config ¶
The config subpackage groups all configuration classes and factories.
All configurations inherit from
msgspec.Struct
.
Common ¶
- class NautilusConfig ¶
-
Bases:
Struct
The base class for all Nautilus configuration objects.
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class CacheConfig ( tick_capacity : int = 10000 , bar_capacity : int = 10000 , snapshot_orders : bool = False , snapshot_positions : bool = False , snapshot_positions_interval : Optional [ float ] = None ) ¶
-
Bases:
NautilusConfig
Configuration for
Cache
instances.- Parameters :
-
-
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.
-
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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class CacheDatabaseConfig ( type : str = 'in-memory' , host : str = 'localhost' , port : Optional [ int ] = None , username : Optional [ str ] = None , password : Optional [ str ] = None , ssl : bool = False , flush_on_start : bool = False , timestamps_as_iso8601 : bool = False ) ¶
-
Bases:
NautilusConfig
Configuration for
CacheDatabase
instances.- Parameters :
-
-
type ( str , {'in-memory' , 'redis'} , default 'in-memory' ) – The database type.
-
host ( str , default 'localhost' ) – The database host address.
-
port ( int , optional ) – The database port.
-
username ( str , optional ) – The account username for the database connection.
-
password ( str , optional ) – The account password for the database connection.
-
ssl ( bool , default False ) – If database should use an SSL enabled connection.
-
flush_on_start ( bool , default False ) – If database should be flushed on start.
-
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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class InstrumentProviderConfig ( load_all : bool = False , load_ids : Optional [ frozenset [ str ] ] = None , filters : Optional [ dict [ str , Any ] ] = None , filter_callable : Optional [ str ] = None , log_warnings : bool = True ) ¶
-
Bases:
NautilusConfig
Configuration for
InstrumentProvider
instances.- Parameters :
-
-
load_all ( bool , default False ) – If all venue instruments should be loaded on start.
-
load_ids ( FrozenSet [ str ] , 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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class DataEngineConfig ( time_bars_build_with_no_updates : bool = True , time_bars_timestamp_on_close : bool = True , validate_data_sequence : bool = False , debug : bool = False ) ¶
-
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.
-
validate_data_sequence ( bool , default False ) – If data objects timestamp sequencing will be validated and handled.
-
debug ( bool , default False ) – If debug mode is active (will provide extra debug logging).
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class RiskEngineConfig ( bypass: bool = False , max_order_submit_rate: str = '100/00:00:01' , max_order_modify_rate: str = '100/00:00:01' , max_notional_per_order: dict[str , int] = <factory> , debug: bool = False ) ¶
-
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).
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class ExecEngineConfig ( load_cache : bool = True , allow_cash_positions : bool = True , debug : bool = False ) ¶
-
Bases:
NautilusConfig
Configuration for
ExecutionEngine
instances.- Parameters :
-
-
load_cache ( bool , default True ) – If the cache should be loaded on initialization.
-
allow_cash_positions ( bool , default True ) – If unleveraged spot/cash assets should generate positions.
-
debug ( bool , default False ) – If debug mode is active (will provide extra debug logging).
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class OrderEmulatorConfig ( debug : bool = False ) ¶
-
Bases:
NautilusConfig
Configuration for
OrderEmulator
instances.- Parameters :
-
debug ( bool , default False ) – If debug mode is active (will provide extra debug logging).
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class StreamingConfig ( catalog_path : str , fs_protocol : Optional [ str ] = None , fs_storage_options : Optional [ dict ] = None , flush_interval_ms : Optional [ int ] = None , replace_existing : bool = False , include_types : Optional [ list [ str ] ] = None ) ¶
-
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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class DataCatalogConfig ( path : str , fs_protocol : Optional [ str ] = None , fs_storage_options : Optional [ dict ] = None , use_rust : bool = False ) ¶
-
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.
-
use_rust ( bool , default False ) – If queries will be for Rust schema versions (when implemented).
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class ActorConfig ( * , component_id : Optional [ str ] = None ) ¶
-
Bases:
NautilusConfig
The base model for all actor configurations.
- Parameters :
-
component_id ( str , optional ) – The component ID. If
None
then the identifier will be taken from type(self).__name__ .
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class ImportableActorConfig ( actor_path : str , config_path : str , config : dict ) ¶
-
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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
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.
- Returns :
-
Actor
- Raises :
-
TypeError – If config is not of type ImportableActorConfig .
- class StrategyConfig ( * , strategy_id : Optional [ str ] = None , order_id_tag : Optional [ str ] = None , oms_type : Optional [ str ] = None , external_order_claims : Optional [ list [ str ] ] = None ) ¶
-
Bases:
NautilusConfig
The base model for all trading strategy configurations.
- Parameters :
-
-
strategy_id ( str , 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 (see docs).
-
external_order_claims ( list [ str ] , optional ) – The external order claim instrument IDs. External orders for matching instrument IDs will be associated with (claimed by) the strategy.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class ImportableStrategyConfig ( strategy_path : str , config_path : str , config : dict [ str , Any ] ) ¶
-
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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
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.
- Returns :
-
Strategy
- Raises :
-
TypeError – If config is not of type ImportableStrategyConfig .
- class ExecAlgorithmConfig ( * , exec_algorithm_id : Optional [ str ] = None ) ¶
-
Bases:
NautilusConfig
The base model for all execution algorithm configurations.
- Parameters :
-
exec_algorithm_id ( str , optional ) – The unique ID for the execution algorithm. If not
None
then will become the execution algorithm ID.
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class ImportableExecAlgorithmConfig ( exec_algorithm_path : str , config_path : str , config : dict [ str , Any ] ) ¶
-
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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class ExecAlgorithmFactory ¶
-
Bases:
object
Provides execution algorithm creation from importable configurations.
- static create ( config : ImportableExecAlgorithmConfig ) ¶
-
Create an execution algorithm from the given configuration.
- Parameters :
-
config ( ImportableExecAlgorithmConfig ) – The configuration for the building step.
- Returns :
-
ExecAlgorithm
- Raises :
-
TypeError – If config is not of type ImportableExecAlgorithmConfig .
- class TracingConfig ( stdout_level : Optional [ str ] = None , stderr_level : Optional [ str ] = None , file_level : Optional [ tuple [ str , str , str ] ] = None ) ¶
-
Bases:
NautilusConfig
Configuration for standard output and file logging for Rust tracing statements for a
NautilusKernel
instance.- Parameters :
-
-
stdout_level ( str , optional ) – The minimum log level to write to stdout. Possible options are “debug”, “info”, “warn”, “error”. Setting it None means no logs are written to stdout.
-
stderr_level ( str , optional ) – The minimum log level to write to stderr. Possible options are “debug”, “info”, “warn”, “error”. Setting it None means no logs are written to stderr.
-
file_config ( tuple [ str , str , str ] , optional ) – The minimum log level to write to log file. Possible options are “debug”, “info”, “warn”, “error”. Setting it None means no logs are written to the log file. The second str is the prefix name of the log file and the third str is the name of the directory.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class LoggingConfig ( log_level : str = 'INFO' , log_level_file : Optional [ str ] = None , log_directory : Optional [ str ] = None , log_file_name : Optional [ str ] = None , log_file_format : Optional [ str ] = None , log_component_levels : Optional [ dict [ str , str ] ] = None , bypass_logging : bool = False ) ¶
-
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_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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class NautilusKernelConfig ( environment: ~nautilus_trader.common.Environment , trader_id: str , instance_id: ~typing.Optional[str] = None , cache: ~typing.Optional[~nautilus_trader.config.common.CacheConfig] = None , cache_database: ~typing.Optional[~nautilus_trader.config.common.CacheDatabaseConfig] = None , data_engine: ~typing.Optional[~nautilus_trader.config.common.DataEngineConfig] = None , risk_engine: ~typing.Optional[~nautilus_trader.config.common.RiskEngineConfig] = None , exec_engine: ~typing.Optional[~nautilus_trader.config.common.ExecEngineConfig] = None , emulator: ~typing.Optional[~nautilus_trader.config.common.OrderEmulatorConfig] = None , streaming: ~typing.Optional[~nautilus_trader.config.common.StreamingConfig] = None , catalog: ~typing.Optional[~nautilus_trader.config.common.DataCatalogConfig] = None , actors: list[nautilus_trader.config.common.ImportableActorConfig] = <factory> , strategies: list[nautilus_trader.config.common.ImportableStrategyConfig] = <factory> , exec_algorithms: list[nautilus_trader.config.common.ImportableExecAlgorithmConfig] = <factory> , load_state: bool = False , save_state: bool = False , loop_debug: bool = False , logging: ~typing.Optional[~nautilus_trader.config.common.LoggingConfig] = None , tracing: ~typing.Optional[~nautilus_trader.config.common.TracingConfig] = None , timeout_connection: float = 10.0 , timeout_reconciliation: float = 10.0 , timeout_portfolio: float = 10.0 , timeout_disconnection: float = 10.0 , timeout_post_stop: float = 10.0 ) ¶
-
Bases:
NautilusConfig
Configuration for a
NautilusKernel
core system instance.- Parameters :
-
-
environment (Environment {
BACKTEST
,SANDBOX
,LIVE
}) – The kernel environment context. -
trader_id ( str ) – The trader ID for the kernel (must be a name and ID tag separated by a hyphen).
-
cache ( CacheConfig , optional ) – The cache configuration.
-
cache_database ( CacheDatabaseConfig , optional ) – The cache database 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.
-
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.
-
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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class ImportableFactoryConfig ( path : str ) ¶
-
Bases:
NautilusConfig
Represents an importable (JSON) factory config.
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class ImportableConfig ( path: str , config: dict = <factory> , factory: ~typing.Optional[~nautilus_trader.config.common.ImportableFactoryConfig] = None ) ¶
-
Bases:
NautilusConfig
Represents an importable configuration (typically live data client or live execution client).
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
Backtest ¶
- class BacktestVenueConfig ( name : str , oms_type : str , account_type : str , starting_balances : list [ str ] , base_currency : Optional [ str ] = None , default_leverage : float = 1.0 , leverages : Optional [ dict [ str , float ] ] = None , book_type : str = 'L1_TBBO' , routing : bool = False , frozen_account : bool = False , bar_execution : bool = True , reject_stop_orders : bool = True , support_gtd_orders : bool = True , use_position_ids : bool = True , use_random_ids : bool = False , use_reduce_only : bool = True , modules : Optional [ list [ nautilus_trader.config.common.ImportableConfig ] ] = None ) ¶
-
Bases:
NautilusConfig
Represents a venue configuration for one specific backtest engine.
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class BacktestDataConfig ( catalog_path : str , data_cls : str , catalog_fs_protocol : Optional [ str ] = None , catalog_fs_storage_options : Optional [ dict ] = None , instrument_id : Optional [ str ] = None , start_time : Optional [ Union [ str , int ] ] = None , end_time : Optional [ Union [ str , int ] ] = None , filter_expr : Optional [ str ] = None , client_id : Optional [ str ] = None , metadata : Optional [ dict ] = None , bar_spec : Optional [ str ] = None , use_rust : Optional [ bool ] = False , batch_size : Optional [ int ] = 10000 ) ¶
-
Bases:
NautilusConfig
Represents the data configuration for one specific backtest run.
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class BacktestEngineConfig ( environment: ~nautilus_trader.common.Environment = Environment.BACKTEST , trader_id: str = 'BACKTESTER-001' , instance_id: ~typing.Optional[str] = None , cache: ~typing.Optional[~nautilus_trader.config.common.CacheConfig] = None , cache_database: ~typing.Optional[~nautilus_trader.config.common.CacheDatabaseConfig] = None , data_engine: ~nautilus_trader.config.common.DataEngineConfig = DataEngineConfig(time_bars_build_with_no_updates=True , time_bars_timestamp_on_close=True , validate_data_sequence=False , debug=False) , risk_engine: ~nautilus_trader.config.common.RiskEngineConfig = RiskEngineConfig(bypass=False , max_order_submit_rate='100/00:00:01' , max_order_modify_rate='100/00:00:01' , max_notional_per_order={} , debug=False) , exec_engine: ~nautilus_trader.config.common.ExecEngineConfig = ExecEngineConfig(load_cache=True , allow_cash_positions=True , debug=False) , emulator: ~typing.Optional[~nautilus_trader.config.common.OrderEmulatorConfig] = None , streaming: ~typing.Optional[~nautilus_trader.config.common.StreamingConfig] = None , catalog: ~typing.Optional[~nautilus_trader.config.common.DataCatalogConfig] = None , actors: list[nautilus_trader.config.common.ImportableActorConfig] = <factory> , strategies: list[nautilus_trader.config.common.ImportableStrategyConfig] = <factory> , exec_algorithms: list[nautilus_trader.config.common.ImportableExecAlgorithmConfig] = <factory> , load_state: bool = False , save_state: bool = False , loop_debug: bool = False , logging: ~typing.Optional[~nautilus_trader.config.common.LoggingConfig] = None , tracing: ~typing.Optional[~nautilus_trader.config.common.TracingConfig] = None , timeout_connection: float = 10.0 , timeout_reconciliation: float = 10.0 , timeout_portfolio: float = 10.0 , timeout_disconnection: float = 10.0 , timeout_post_stop: float = 10.0 , run_analysis: bool = True ) ¶
-
Bases:
NautilusKernelConfig
Configuration for
BacktestEngine
instances.- Parameters :
-
-
trader_id ( str ) – 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.
-
cache_database ( CacheDatabaseConfig , optional ) – The cache database 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 node.
-
actors ( list [ ImportableActorConfig ] ) – The actor configurations for the node.
-
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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class BacktestRunConfig ( engine : Optional [ BacktestEngineConfig ] = None , venues : Optional [ list [ nautilus_trader.config.backtest.BacktestVenueConfig ] ] = None , data : Optional [ list [ nautilus_trader.config.backtest.BacktestDataConfig ] ] = None , batch_size_bytes : Optional [ int ] = None ) ¶
-
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 :
-
-
engine ( BacktestEngineConfig , optional ) – The backtest engine configuration (represents the core system kernel).
-
venues ( list [ BacktestVenueConfig ] ) – The venue configurations for the backtest run.
-
data ( list [ BacktestDataConfig ] ) – The data configurations for the backtest run.
-
batch_size_bytes ( optional ) – The batch block size in bytes (will then run in streaming mode).
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- parse_filters_expr ( s : Optional [ str ] ) ¶
-
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")
Live ¶
- class LiveDataEngineConfig ( time_bars_build_with_no_updates : bool = True , time_bars_timestamp_on_close : bool = True , validate_data_sequence : bool = False , debug : bool = False , qsize : int = 100000 ) ¶
-
Bases:
DataEngineConfig
Configuration for
LiveDataEngine
instances.- Parameters :
-
qsize ( PositiveInt , default 100_000 ) – The queue size for the engines internal queue buffers.
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class LiveRiskEngineConfig ( bypass: bool = False , max_order_submit_rate: str = '100/00:00:01' , max_order_modify_rate: str = '100/00:00:01' , max_notional_per_order: dict[str , int] = <factory> , debug: bool = False , qsize: int = 100000 ) ¶
-
Bases:
RiskEngineConfig
Configuration for
LiveRiskEngine
instances.- Parameters :
-
qsize ( PositiveInt , default 100_000 ) – The queue size for the engines internal queue buffers.
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class LiveExecEngineConfig ( load_cache : bool = True , allow_cash_positions : bool = True , debug : bool = False , reconciliation : bool = True , reconciliation_lookback_mins : Optional [ int ] = None , filter_unclaimed_external_orders : bool = False , filter_position_reports : bool = False , inflight_check_interval_ms : int = 2000 , inflight_check_threshold_ms : int = 5000 , qsize : int = 100000 ) ¶
-
Bases:
ExecEngineConfig
Configuration for
LiveExecEngine
instances.The purpose of the in-flight order check is for live reconciliation, events emitted from the exchange 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 ` PositionStatusReport`s 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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class RoutingConfig ( default : bool = False , venues : Optional [ frozenset [ str ] ] = None ) ¶
-
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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class LiveDataClientConfig ( handle_revised_bars : bool = False , instrument_provider : InstrumentProviderConfig = InstrumentProviderConfig(load_all=False, load_ids=None, filters=None, filter_callable=None, log_warnings=True) , routing : RoutingConfig = RoutingConfig(default=False, venues=None) ) ¶
-
Bases:
NautilusConfig
Configuration for
LiveDataClient
instances.- Parameters :
-
-
handle_revised_bars ( bool ) – If DataClient will emit bar updates as soon new bar opens.
-
instrument_provider ( InstrumentProviderConfig ) – The clients instrument provider configuration.
-
routing ( RoutingConfig ) – The clients message routing config.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class LiveExecClientConfig ( instrument_provider : InstrumentProviderConfig = InstrumentProviderConfig(load_all=False, load_ids=None, filters=None, filter_callable=None, log_warnings=True) , routing : RoutingConfig = RoutingConfig(default=False, venues=None) ) ¶
-
Bases:
NautilusConfig
Configuration for
LiveExecutionClient
instances.- Parameters :
-
-
instrument_provider ( InstrumentProviderConfig ) – The clients instrument provider configuration.
-
routing ( RoutingConfig ) – The clients message routing config.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool
- class TradingNodeConfig ( environment: ~nautilus_trader.common.Environment = Environment.LIVE , trader_id: str = 'TRADER-001' , instance_id: ~typing.Optional[str] = None , cache: ~typing.Optional[~nautilus_trader.config.common.CacheConfig] = None , cache_database: ~typing.Optional[~nautilus_trader.config.common.CacheDatabaseConfig] = None , data_engine: ~nautilus_trader.config.live.LiveDataEngineConfig = LiveDataEngineConfig(time_bars_build_with_no_updates=True , time_bars_timestamp_on_close=True , validate_data_sequence=False , debug=False , qsize=100000) , risk_engine: ~nautilus_trader.config.live.LiveRiskEngineConfig = LiveRiskEngineConfig(bypass=False , max_order_submit_rate='100/00:00:01' , max_order_modify_rate='100/00:00:01' , max_notional_per_order={} , debug=False , qsize=100000) , exec_engine: ~nautilus_trader.config.live.LiveExecEngineConfig = LiveExecEngineConfig(load_cache=True , allow_cash_positions=True , debug=False , reconciliation=True , reconciliation_lookback_mins=None , filter_unclaimed_external_orders=False , filter_position_reports=False , inflight_check_interval_ms=2000 , inflight_check_threshold_ms=5000 , qsize=100000) , emulator: ~typing.Optional[~nautilus_trader.config.common.OrderEmulatorConfig] = None , streaming: ~typing.Optional[~nautilus_trader.config.common.StreamingConfig] = None , catalog: ~typing.Optional[~nautilus_trader.config.common.DataCatalogConfig] = None , actors: list[nautilus_trader.config.common.ImportableActorConfig] = <factory> , strategies: list[nautilus_trader.config.common.ImportableStrategyConfig] = <factory> , exec_algorithms: list[nautilus_trader.config.common.ImportableExecAlgorithmConfig] = <factory> , load_state: bool = False , save_state: bool = False , loop_debug: bool = False , logging: ~typing.Optional[~nautilus_trader.config.common.LoggingConfig] = None , tracing: ~typing.Optional[~nautilus_trader.config.common.TracingConfig] = None , timeout_connection: float = 10.0 , timeout_reconciliation: float = 10.0 , timeout_portfolio: float = 10.0 , timeout_disconnection: float = 10.0 , timeout_post_stop: float = 10.0 , data_clients: dict[str , nautilus_trader.config.live.LiveDataClientConfig] = <factory> , exec_clients: dict[str , nautilus_trader.config.live.LiveExecClientConfig] = <factory> , heartbeat_interval: ~typing.Optional[float] = None ) ¶
-
Bases:
NautilusKernelConfig
Configuration for
TradingNode
instances.- Parameters :
-
-
trader_id ( str , 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.
-
cache_database ( CacheDatabaseConfig , optional ) – The cache database 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.
-
streaming ( StreamingConfig , optional ) – The configuration for streaming to feather files.
-
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.
-
- dict ( ) dict [ str , Any ] ¶
-
Return a dictionary representation of the configuration.
- Returns :
-
dict[str, Any]
- classmethod fully_qualified_name ( ) str ¶
-
Return the fully qualified name for the NautilusConfig class.
- Returns :
-
str
References
- json ( ) bytes ¶
-
Return serialized JSON encoded bytes.
- Returns :
-
bytes
- classmethod parse ( raw : bytes ) Any ¶
-
Return a decoded object of the given cls .
- Parameters :
-
-
cls ( type ) – The type to decode to.
-
raw ( bytes ) – The raw bytes to decode.
-
- Returns :
-
Any
- validate ( ) bool ¶
-
Return whether the configuration can be represented as valid JSON.
- Returns :
-
bool