Skip to content

LocalLeanManager

QuantConnect.Lean.Engine.Server.LocalLeanManager

Bases: Object, ILeanManager

NOP implementation of the ILeanManager interface

algorithm

algorithm: IAlgorithm

The current algorithm

This codeEntityType is protected.

system_handlers

system_handlers: LeanEngineSystemHandlers

The system handlers

This codeEntityType is protected.

algorithm_handlers

algorithm_handlers: LeanEngineAlgorithmHandlers

The algorithm handlers

This codeEntityType is protected.

dispose

dispose() -> None

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

initialize

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

Empty implementation of the ILeanManager interface

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

set_command_handler

set_command_handler() -> None

Set the command handler to use, protected for testing purposes

This codeEntityType is protected.

update

update() -> None

Execute the commands using the IAlgorithm instance