Skip to content

CachingFutureChainProvider

QuantConnect.Lean.Engine.DataFeeds.CachingFutureChainProvider

CachingFutureChainProvider(
    future_chain_provider: IFutureChainProvider,
)

Bases: Object, IFutureChainProvider

An implementation of IFutureChainProvider that will cache by date future contracts returned by another future chain provider.

Initializes a new instance of the CachingFutureChainProvider class

Parameters:

Name Type Description Default
future_chain_provider IFutureChainProvider
required

get_future_contract_list

get_future_contract_list(
    symbol: Union[Symbol, str, BaseContract],
    date: Union[datetime, date],
) -> Iterable[Symbol]

Gets the list of future contracts for a given underlying symbol

Parameters:

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

The underlying symbol

required
date Union[datetime, date]

The date for which to request the future chain (only used in backtesting)

required

Returns:

Type Description
Iterable[Symbol]

The list of future contracts.