Skip to content

UpdateOrderCommand

QuantConnect.Commands.UpdateOrderCommand

Bases: BaseCommand

Represents a command to update an order by id

order_id

order_id: int

Gets or sets the id of the order to update

quantity

quantity: Optional[float]

Gets or sets the new quantity, specify null to not update the quantity

limit_price

limit_price: Optional[float]

Gets or sets the new limit price, specify null to not update the limit price. This will only be used if the order has a limit price (Limit/StopLimit orders)

stop_price

stop_price: Optional[float]

Gets or sets the new stop price, specify null to not update the stop price. This will onky be used if the order has a stop price (StopLimit/StopMarket orders)

tag

tag: str

Gets or sets the new tag for the order, specify null to not update the tag

id

id: str

Unique command id

run

run(algorithm: IAlgorithm) -> CommandResultPacket

Runs this command against the specified algorithm instance

Parameters:

Name Type Description Default
algorithm IAlgorithm

The algorithm to run this command against

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