Download MetaTrader 5

How can I close all buying/selling order?

To add comments, please log in or register
Do you know that MQL5 has classes?
Minh
140
Minh 2013.12.21 08:36 
Let say I have 3 sell orders currently running. Which command should I use to close them all? OrderClose() ?
Ubzen
5394
Ubzen 2013.12.21 08:54  
nguye235: Let say I have 3 sell orders currently running. Which command should I use to close them all? OrderClose() ?
Yes use OrderClose() x 3.
Minh
140
Minh 2013.12.23 04:14  
But for Order Close, it ask for specific number of the opened ticket. how can I get this number?
Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2013.12.23 09:29  
nguye235:
But for Order Close, it ask for specific number of the opened ticket. how can I get this number?
Loop through the Orders one by one, OrderSelect() each and then you can use OrderTicket() to get the ticket number.
whroeder1
14544
whroeder1 2013.12.23 13:01  
jabeen ali
14
jabeen ali 2013.12.24 06:33  
nguye235:
Let say I have 3 sell orders currently running. Which command should I use to close them all? OrderClose() ?

Use the order 3 to close the sell and buy.
To add comments, please log in or register