how do I Remove Closed orders from memory

Back to topics list To post a new topic, please log in or register
avatar
3
peteloaf 2015.01.15 00: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 

 

avatar
12985
WHRoeder 2015.01.15 14: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
avatar
3
peteloaf 2015.01.15 18: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.   
Back to topics list  

To add comments, please log in or register