Skip to content

LiquidateCommand

QuantConnect.Commands.LiquidateCommand

Bases: BaseCommand

Represents a command that will liquidate the entire algorithm

ticker

ticker: str

Gets or sets the string ticker symbol

security_type

security_type: SecurityType

Gets or sets the security type of the ticker.

market

market: str

Gets or sets the market the ticker resides in

id

id: str

Unique command id

run

run(algorithm: IAlgorithm) -> CommandResultPacket

Submits orders to liquidate all current holdings in the algorithm

Parameters:

Name Type Description Default
algorithm IAlgorithm

The algorithm to be liquidated

required

get_symbol

get_symbol(
    ticker: str,
    security_type: SecurityType,
    market: str,
    symbol: Union[Symbol, str, BaseContract] = None,
) -> Symbol

Creats symbol using symbol properties.

This codeEntityType is protected.

Parameters:

Name Type Description Default
ticker str

The string ticker symbol

required
security_type SecurityType

The security type of the ticker. If security_type == Option, then a canonical symbol is created

required
market str

The market the ticker resides in

required
symbol Union[Symbol, str, BaseContract]

The algorithm to run this command against

None