Skip to content

ILeanManager

QuantConnect.Lean.Engine.Server.ILeanManager

Bases: IDisposable

Provides scope into Lean that is convenient for managing a lean instance

initialize

initialize(
    system_handlers: LeanEngineSystemHandlers,
    algorithm_handlers: LeanEngineAlgorithmHandlers,
    job: AlgorithmNodePacket,
    algorithm_manager: AlgorithmManager,
) -> None

Initialize the ILeanManager implementation

Parameters:

Name Type Description Default
system_handlers LeanEngineSystemHandlers

Exposes lean engine system handlers running LEAN

required
algorithm_handlers LeanEngineAlgorithmHandlers

Exposes the lean algorithm handlers running lean

required
job AlgorithmNodePacket

The job packet representing either a live or backtest Lean instance

required
algorithm_manager AlgorithmManager

The Algorithm manager

required

on_algorithm_end

on_algorithm_end() -> None

This method is called before algorithm termination

on_algorithm_start

on_algorithm_start() -> None

This method is called after algorithm initialization

on_securities_changed

on_securities_changed(changes: SecurityChanges) -> None

Callback fired each time that we add/remove securities from the data feed

set_algorithm

set_algorithm(algorithm: IAlgorithm) -> None

Sets the IAlgorithm instance in the ILeanManager

Parameters:

Name Type Description Default
algorithm IAlgorithm

The IAlgorithm instance being run

required

update

update() -> None

Update ILeanManager with the IAlgorithm instance