StaticUniverseModel#
API documentation for tradeexecutor.strategy.universe_model.StaticUniverseModel Python class in Trading Strategy framework.
- class StaticUniverseModel[source]#
Bases:
UniverseModel
Universe that never changes and all assets are in in-process memory.
Only useful for testing, because - any real trading pair universe is deemed to change - trade executor is deemed to go down and up again
- __init__(universe)[source]#
- Parameters:
universe (StrategyExecutionUniverse) –
Methods
__init__
(universe)construct_universe
(ts, mode, options[, ...])Always return the same universe copy - there is no refresh.
preload_universe
(universe_options[, ...])Triggered before backtesting execution.
- __init__(universe)[source]#
- Parameters:
universe (StrategyExecutionUniverse) –
- construct_universe(ts, mode, options, strategy_parameters=None, execution_model=None)[source]#
Always return the same universe copy - there is no refresh.
- Parameters:
ts (datetime) –
mode (ExecutionMode) –
options (UniverseOptions) –
strategy_parameters (tradeexecutor.strategy.parameters.StrategyParameters | None) –
execution_model (tradeexecutor.strategy.execution_model.ExecutionModel | None) –
- Return type:
- preload_universe(universe_options, execution_context=None)[source]#
Triggered before backtesting execution.
Load all datasets with progress bar display
Data is saved in FS cache
Not triggered in live trading, as universe changes between cycles
- Parameters:
universe_options (UniverseOptions) – Options to override universe loading parameters from the strategy file
execution_context (tradeexecutor.strategy.execution_context.ExecutionContext | None) –
- Return type: