Download MetaTrader 5

How can I close all buying/selling order?

To add comments, please log in or register
Minh
140
Minh  
Let say I have 3 sell orders currently running. Which command should I use to close them all? OrderClose() ?
Ubzen
5390
Ubzen  
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  
But for Order Close, it ask for specific number of the opened ticket. how can I get this number?
Simon Gniadkowski
Moderator
18036
Simon Gniadkowski  
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
16099
whroeder1  
jabeen ali
14
jabeen ali  
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