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

BacktestSetup