Download MetaTrader 5
To add comments, please log in or register
Register at MQL5.community and leave your comments!
Pete Haa
10
Pete Haa 2015.01.14 23:21 

Hello anyone,

I am having a problem in MT4 where I try to call OrderTicket() to determine the ticket number for any possible open orders.

the return from the OrderTicket() call is a ticket number from the last closed order.  I can see on the screen that that particular

ticket number has been closed and there is a newer open order with a subsequent higher ticket number.

 How do I identify the existing open order using code (mt4).  My intention is to use the ticket number to close the order if market conditions dictate.

 Thanks in advance.

 

--Peteloaf 

whroeder1
13644
whroeder1 2015.01.15 13:57  
  1. You can NOT call OrderTicket() until you select a order with OrderSelect().
  2. Do a OrderSelect loop and find the open orders. See Loops and Closing or Deleting Orders - MQL4 forum
Pete Haa
10
Pete Haa 2015.01.15 17:35  
WHRoeder:
  1. You can NOT call OrderTicket() until you select a order with OrderSelect().
  2. Do a OrderSelect loop and find the open orders. See Loops and Closing or Deleting Orders - MQL4 forum
Thanks  WH  I am trying that now.   
/
To add comments, please log in or register