Skip to content

BaseCommandHandler

QuantConnect.Commands.BaseCommandHandler

Bases: Object, ICommandHandler

Base algorithm command handler

SETTINGS

SETTINGS: Any = ...

Command json settings

This codeEntityType is protected.

algorithm

algorithm: IAlgorithm

The algorithm instance

This codeEntityType is protected.

acknowledge

acknowledge(
    command: ICommand,
    command_result_packet: CommandResultPacket,
) -> None

Acknowledge a command that has been executed

This codeEntityType is protected.

Parameters:

Name Type Description Default
command ICommand

The command that was executed

required
command_result_packet CommandResultPacket

The result

required

dispose

dispose() -> None

Disposes of this instance

get_commands

get_commands() -> Iterable[ICommand]

Get the commands to run

This codeEntityType is protected.

initialize

initialize(
    job: AlgorithmNodePacket, algorithm: IAlgorithm
) -> None

Initializes this command queue for the specified job

Parameters:

Name Type Description Default
job AlgorithmNodePacket

The job that defines what queue to bind to

required
algorithm IAlgorithm

The algorithm instance

required

process_commands

process_commands() -> Iterable[CommandResultPacket]

Will consumer and execute any command in the queue

try_get_callback_command

try_get_callback_command(payload: str) -> ICommand

Helper method to create a callback command

This codeEntityType is protected.