Help with EA to wait before last open position is closed before make a new one

 
Hello Im working on EA for MT4 and i cant figure out how to make the EA to wait before last open position is closed (finished) before looking for a signal to make a new one.Sorry for the question but Im new to Mql programing so any help will be appreciated.Regards
 
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
 
ivanskiq3232 i cant figure out how to make the EA to wait before last open position is closed

Count the number of open orders in a OrderSelect loop, filter by Magic Number and Symbol.
          Trade Functions - MQL4 Reference

 
William Roeder #:

Count the number of open orders in a OrderSelect loop, filter by Magic Number and Symbol.
          Trade Functions - MQL4 Reference

How the code should look like i'm finished with the code i want only to add it in the end
 
ivanskiq3232 #:
How the code should look like i'm finished with the code i want only to add it in the end
As it was said… search through all opened orders, and if None of the opened orders are opened by this EA ( MagicNumber) and from this chart ( Symbol) , and you can add timeframe, or whatever other filters you like , then open your orders 
Reason: