Skip to content

FileCommandHandler

QuantConnect.Commands.FileCommandHandler

FileCommandHandler()

Bases: BaseCommandHandler

Represents a command handler that sources it's commands from a file on the local disk

Initializes a new instance of the FileCommandHandler class using the 'command-json-file' configuration value for the command json file

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

get_command_files

get_command_files() -> Iterable[FileInfo]

Gets all the available command files

Returns:

Type Description
Iterable[FileInfo]

Sorted enumerator of all the available command files.

get_commands

get_commands() -> Iterable[ICommand]

Gets the next command in the queue

This codeEntityType is protected.

Returns:

Type Description
Iterable[ICommand]

The next command in the queue, if present, null if no commands present.

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

dispose

dispose() -> None

Disposes of this instance

try_get_callback_command

try_get_callback_command(payload: str) -> ICommand

Helper method to create a callback command

This codeEntityType is protected.