BacktestTradingSession

class qf_lib.backtesting.trading_session.backtest_trading_session.BacktestTradingSession(contract_ticker_mapper: ContractTickerMapper, start_date, end_date, position_sizer: PositionSizer, orders_filters: Sequence[OrdersFilter], data_handler: DataHandler, timer: SettableTimer, notifiers: Notifiers, portfolio: Portfolio, events_manager: EventManager, monitor: BacktestMonitor, broker: BacktestBroker, order_factory: OrderFactory, frequency: Frequency, backtest_result: BacktestResult)[source]

Bases: TradingSession

Encapsulates the settings and components for carrying out a backtest session. Pulls for data every day.

Methods:

get_preloaded_data_checksum()

Returns the checksum value computed as a hexadecimal digest on the preloaded data bundle.

verify_preloaded_data(expected_checksum)

Verifies if the checksum computed on the preloaded data bundle is equal to the expected value.

get_preloaded_data_checksum() str[source]

Returns the checksum value computed as a hexadecimal digest on the preloaded data bundle.

Returns:

checksum of the preloaded data bundle

Return type:

str

verify_preloaded_data(expected_checksum: str)[source]

Verifies if the checksum computed on the preloaded data bundle is equal to the expected value. In case of differences ValueError is raised.

Parameters:

expected_checksum (str) – The expected checksum of the data bundle.