How to delete an order in MQL5?

To add comments, please log in or register
scotteza
614
scotteza  

Hello everyone

Is there some example code someone can post on deleting sell stop and/or buy stop orders please?

I'm sure there must be an MQL5 library function to do this, but I can't seem to find it in the documentation.

Thanks!

-Scott

scotteza
614
scotteza  

Ah, just found my answer! Finally! 

You use TRADE_ACTION_REMOVE to do this.

More info here: https://www.mql5.com/en/docs/constants/tradingconstants/enum_trade_request_actions

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types
  • www.mql5.com
Trading is done by sending orders to open positions using the OrderSend() function, as well as to place, modify or delete pending orders. Each trade order refers to the type of the requested operation. Trading operations are described in the ENUM_TRADE_REQUEST_ACTIONS enumeration...
To add comments, please log in or register