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
- Help close positions
- Only one trade open at once code
- Help with custom Lots
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 #:
How the code should look like i'm finished with the code i want only to add it in the end
Count the number of open orders in a OrderSelect loop, filter by Magic Number and Symbol.
Trade Functions - MQL4 Reference
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
How the code should look like i'm finished with the code i want only to add it in the end

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