CancelOrder

Cancels a pending order.

Syntax

CancelOrder(orderTicket: number): boolean

Parameters

  • orderTicket: The ticket number of the pending order to cancel.

Return Value

Returns a boolean value indicating whether the order was successfully canceled.

  • true: Order was successfully canceled.

  • false: Order cancellation failed.

Description

The CancelOrder method cancels a pending order that has not yet been executed. Pending orders include limit orders, stop orders, and other conditional orders that are waiting for specific market conditions to be met before execution.

Example

Notes

  • If you attempt to cancel an order that has already been executed or does not exist, the method will return false.

Last updated