Send a request to delete orders in MT5.

MT5.DeleteOrder(iTickets)

Arguments

int

int(); vector of tickets orders to delete.

Value

Returns TRUE if order was successful deleted, FALSE otherwise.

Details

For iTickers users can use MT5.ShowOrders() to obtain it.

(STOCKS ONLY) WARNING - Poor written MT5's servers

I had some problems running this function in some brokers and doesn't in others. All brokers that are winged by XP Investimentos (BR broker), the MT5's server try to close another nonexistent order (order #0) The same error don't occurs in Modal (BR broker) server. In all cases, the order is deleted anyway. Use this function very carefully if you notice that the MT5's server broker was poor written. I already tried to fix into MQL code in every way. All forms to remove the order result in the same outcome. For who is experiencing this problem, take note that the mt5R plataform takes approximately 3 minutes to recover itself. Poor fix: the trader can use MT5.ModifyOrder() to change fPrice to unviable levels and waits to order expire.

See also

Examples

if (FALSE) { # Delete pending order 832136429 MT5.DeleteOrder(832136429) }