setup_backtest#
API documentation for tradeexecutor.backtest.backtest_runner.setup_backtest Python function.
- setup_backtest(strategy_path, start_at=None, end_at=None, initial_deposit=None, max_slippage=0.01, cycle_duration=None, candle_time_frame=None, strategy_module=None, name=None, minimum_data_lookback_range=None, universe_options=None, client=None)[source]#
High-level entry point for setting up a backtest from a strategy module.
This function is useful for running backtests for strategies in notebooks and unit tests
Instead of giving strategy and trading universe as direct function arguments, this entry point loads a strategy given as a Python file
Note
A lot of arguments for this function are optional/ unit test only/legacy. Only strategy_path is needed.
See also
- Parameters:
strategy_path (Path) – Path to the strategy Python module
cycle_duration (Optional[CycleDuration]) – Override the default strategy cycle duration
candle_time_frame (Optional[TimeBucket]) –
Legacy. Use universe_options.
Override the default strategy candle time bucket
strategy_module (Optional[StrategyModuleInformation]) – If strategy module was previously loaded
initial_deposit (Optional[float]) –
Legacy.
Override INITIAL_CASH from the strategy module.
universe_options (Optional[UniverseOptions]) –
- Return type: