setup_backtest_for_universe#
API documentation for tradeexecutor.backtest.backtest_runner.setup_backtest_for_universe Python function.
- setup_backtest_for_universe(strategy, start_at, end_at, cycle_duration, initial_deposit, universe, routing_model=None, max_slippage=0.01, validate_strategy_module=False, candle_time_frame=None, allow_missing_fees=False, name=None, universe_options=None, create_indicators=None, parameters=None, indicator_storage=None, max_workers=None)[source]#
High-level entry point for setting up a single backtest for a predefined universe.
The trading universe creation from the strategy is skipped, instead of you can pass your own universe e.g. synthetic universe. This is useful for running backtests against synthetic universes.
- Parameters:
cycle_duration (CycleDuration) – Override the default strategy cycle duration
allow_missing_fees – Legacy workaround
candle_time_frame (Optional[TimeBucket]) – Override the default strategy candle time bucket
strategy (pathlib.Path | tradeexecutor.strategy.strategy_module.StrategyModuleInformation) –
start_at (datetime) –
end_at (datetime) –
universe (TradingStrategyUniverse) –
routing_model (Optional[BacktestRoutingModel]) –
universe_options (Optional[UniverseOptions]) –
create_indicators (tradeexecutor.strategy.pandas_trader.indicator.CreateIndicatorsProtocolV1 | tradeexecutor.strategy.pandas_trader.indicator.CreateIndicatorsProtocolV2 | None) –
parameters (tradeexecutor.strategy.parameters.StrategyParameters | None) –
indicator_storage (tradeexecutor.strategy.pandas_trader.indicator.DiskIndicatorStorage | None) –
max_workers (int | None) –