BacktestSetup#
tradeexecutor.backtest.backtest_runner.BacktestSetup Python class in Trading Strategy framework.
- class BacktestSetup[source]#
Bases:
object
Describe backtest setup, ready to run.
- __init__(start_at, end_at, universe_options, cycle_duration, universe, wallet, state, pricing_model, routing_model, execution_model, sync_model, trading_strategy_engine_version, trade_routing, reserve_currency, decide_trades, create_trading_universe, data_preload=True, name='backtest', minimum_data_lookback_range=None)#
- Parameters:
start_at (datetime.datetime | None) –
end_at (datetime.datetime | None) –
universe_options (UniverseOptions) –
cycle_duration (Optional[CycleDuration]) –
universe (Optional[TradingStrategyUniverse]) –
wallet (SimulatedWallet) –
state (State) –
pricing_model (Optional[BacktestSimplePricingModel]) –
routing_model (Optional[BacktestRoutingModel]) –
execution_model (BacktestExecutionModel) –
sync_model (BacktestSyncModel) –
trading_strategy_engine_version (str) –
trade_routing (TradeRouting) –
reserve_currency (ReserveCurrency) –
decide_trades (DecideTradesProtocol) –
create_trading_universe (Optional[CreateTradingUniverseProtocol]) –
data_preload (bool) –
name (str) –
- Return type:
None
Methods
__init__
(start_at, end_at, universe_options, ...)Create a strategy description and runner based on backtest parameters in this setup.
Attributes
data_preload
minimum_data_lookback_range
Name for this backtest
Test start
Test end
Override trading_strategy_cycle from strategy module
Override trading_strategy_cycle from strategy module
universe
wallet
state
pricing_model
routing_model
execution_model
sync_model
trading_strategy_engine_version
trade_routing
reserve_currency
decide_trades
create_trading_universe
- start_at: datetime.datetime | None#
Test start
- end_at: datetime.datetime | None#
Test end
- universe_options: UniverseOptions#
Override trading_strategy_cycle from strategy module
- cycle_duration: Optional[CycleDuration]#
Override trading_strategy_cycle from strategy module
- backtest_static_universe_strategy_factory(*ignore, execution_model, execution_context, sync_model, pricing_model_factory, valuation_model_factory, client, timed_task_context_manager, approval_model, **kwargs)[source]#
Create a strategy description and runner based on backtest parameters in this setup.
- Parameters:
execution_model (BacktestExecutionModel) –
execution_context (ExecutionContext) –
sync_model (BacktestSyncModel) –
pricing_model_factory (Callable) –
valuation_model_factory (Callable) –
client (Client) –
timed_task_context_manager (AbstractContextManager) –
approval_model (ApprovalModel) –
- Return type:
- __init__(start_at, end_at, universe_options, cycle_duration, universe, wallet, state, pricing_model, routing_model, execution_model, sync_model, trading_strategy_engine_version, trade_routing, reserve_currency, decide_trades, create_trading_universe, data_preload=True, name='backtest', minimum_data_lookback_range=None)#
- Parameters:
start_at (datetime.datetime | None) –
end_at (datetime.datetime | None) –
universe_options (UniverseOptions) –
cycle_duration (Optional[CycleDuration]) –
universe (Optional[TradingStrategyUniverse]) –
wallet (SimulatedWallet) –
state (State) –
pricing_model (Optional[BacktestSimplePricingModel]) –
routing_model (Optional[BacktestRoutingModel]) –
execution_model (BacktestExecutionModel) –
sync_model (BacktestSyncModel) –
trading_strategy_engine_version (str) –
trade_routing (TradeRouting) –
reserve_currency (ReserveCurrency) –
decide_trades (DecideTradesProtocol) –
create_trading_universe (Optional[CreateTradingUniverseProtocol]) –
data_preload (bool) –
name (str) –
- Return type:
None