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:
Return type:

StrategyExecutionUniverse

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:
Return type:

StrategyExecutionUniverse