- You can NOT call OrderTicket() until you select a order with OrderSelect().
- Do a OrderSelect loop and find the open orders. See Loops and Closing or Deleting Orders - MQL4 forum
WHRoeder:
Thanks WH I am trying that now.
- You can NOT call OrderTicket() until you select a order with OrderSelect().
- Do a OrderSelect loop and find the open orders. See Loops and Closing or Deleting Orders - MQL4 forum
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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