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)check_data_age
(ts, universe, ...)Check if our data is up-to-date and we do not have issues with feeds.
construct_universe
(ts, live, universe_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, live, universe_options)[source]#
Always return the same universe copy - there is no refresh.
- Parameters:
ts (datetime) –
live (bool) –
universe_options (UniverseOptions) –
- 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: