Skip to content

BacktestingChainProvider

QuantConnect.Lean.Engine.DataFeeds.BacktestingChainProvider

BacktestingChainProvider()

Bases: Object

Base backtesting cache provider which will source symbols from local zip files

Initializes a new instance of the BacktestingChainProvider class

This codeEntityType is protected.

map_file_provider

map_file_provider: IMapFileProvider

The map file provider instance to use

This codeEntityType is protected.

history_provider

history_provider: IHistoryProvider

The history provider instance to use

This codeEntityType is protected.

get_symbols

get_symbols(
    canonical_symbol: Union[Symbol, str, BaseContract],
    date: Union[datetime, date],
) -> Iterable[Symbol]

Get the contract symbols associated with the given canonical symbol and date

This codeEntityType is protected.

Parameters:

Name Type Description Default
canonical_symbol Union[Symbol, str, BaseContract]

The canonical symbol

required
date Union[datetime, date]

The date to search for

required

initialize

initialize(
    parameters: ChainProviderInitializeParameters,
) -> None

Initializes a new instance of the BacktestingChainProvider class

Parameters:

Name Type Description Default
parameters ChainProviderInitializeParameters

The initialization parameters

required

is_contract_expired

is_contract_expired(
    symbol: Union[Symbol, str, BaseContract],
    date: Union[datetime, date],
) -> bool

Helper method to determine if a contract is expired for the requested date

This codeEntityType is protected.