Skip to content

LeanEngineAlgorithmHandlers

QuantConnect.Lean.Engine.LeanEngineAlgorithmHandlers

LeanEngineAlgorithmHandlers(
    results: IResultHandler,
    setup: ISetupHandler,
    data_feed: IDataFeed,
    transactions: ITransactionHandler,
    real_time: IRealTimeHandler,
    map_file_provider: IMapFileProvider,
    factor_file_provider: IFactorFileProvider,
    data_provider: IDataProvider,
    object_store: IObjectStore,
    data_permissions_manager: IDataPermissionManager,
    live_mode: bool,
    research_mode: bool = False,
    data_monitor: IDataMonitor = None,
)

Bases: Object, IDisposable

Provides a container for the algorithm specific handlers

Initializes a new instance of the LeanEngineAlgorithmHandlers class from the specified handlers

Parameters:

Name Type Description Default
results IResultHandler

The result handler for communicating results from the algorithm

required
setup ISetupHandler

The setup handler used to initialize algorithm state

required
data_feed IDataFeed

The data feed handler used to pump data to the algorithm

required
transactions ITransactionHandler

The transaction handler used to process orders from the algorithm

required
real_time IRealTimeHandler

The real time handler used to process real time events

required
map_file_provider IMapFileProvider

The map file provider used to retrieve map files for the data feed

required
factor_file_provider IFactorFileProvider

Map file provider used as a map file source for the data feed

required
data_provider IDataProvider

file provider used to retrieve security data if it is not on the file system

required
object_store IObjectStore

The object store used for persistence

required
data_permissions_manager IDataPermissionManager

The data permission manager to use

required
live_mode bool

True for live mode, false otherwise

required
research_mode bool

True for research mode, false otherwise. This has less priority than live_mode

False
data_monitor IDataMonitor

Optionally the data monitor instance to use

None

results

results: IResultHandler

Gets the result handler used to communicate results from the algorithm

setup

Gets the setup handler used to initialize the algorithm state

data_feed

data_feed: IDataFeed

Gets the data feed handler used to provide data to the algorithm

transactions

transactions: ITransactionHandler

Gets the transaction handler used to process orders from the algorithm

real_time

real_time: IRealTimeHandler

Gets the real time handler used to process real time events

map_file_provider

map_file_provider: IMapFileProvider

Gets the map file provider used as a map file source for the data feed

factor_file_provider

factor_file_provider: IFactorFileProvider

Gets the map file provider used as a map file source for the data feed

data_provider

data_provider: IDataProvider

Gets the data file provider used to retrieve security data if it is not on the file system

data_cache_provider

data_cache_provider: IDataCacheProvider

Gets the data file provider used to retrieve security data if it is not on the file system

object_store

object_store: IObjectStore

Gets the object store used for persistence

data_permissions_manager

data_permissions_manager: IDataPermissionManager

Entity in charge of handling data permissions

data_monitor

data_monitor: IDataMonitor

Monitors data requests and reports on missing data

dispose

dispose() -> None

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

from_configuration

from_configuration(
    composer: Composer, research_mode: bool = False
) -> LeanEngineAlgorithmHandlers

Creates a new instance of the LeanEngineAlgorithmHandlers class from the specified composer using type names from configuration

Parameters:

Name Type Description Default
composer Composer

The composer instance to obtain implementations from

required
research_mode bool

True for research mode, false otherwise

False

Returns:

Type Description
LeanEngineAlgorithmHandlers

A fully hydrates LeanEngineSystemHandlers instance.