Hi,
Sorry to ask, but I'm not too sure what magic numbers are and how to use them, (they have always confused me). What do you mean by flag for next order?
with no. 3 (allow another order after defined timespan), do you mean using the Sleep () function after typing the Ordersend () Function.
Kind Regards,
Momo
Please read https://www.mql5.com/en/articles/1359

MagicNumber: "Magic" Identifier of the Order
- 2006.07.24
- Andrey Khatimlianskii
- www.mql5.com
The article deals with the problem of conflict-free trading of several experts on the same МТ 4 Client Terminal. It "teaches" the expert to manage only "its own" orders without modifying or closing "someone else's" positions (opened manually or by other experts). The article was written for users who have basic skills of working with the terminal and programming in MQL 4.
Using OrdersTotal directly and/or no Magic number filtering on your
OrderSelect loop means your code is incompatible with every EA (including
itself on other charts and manual trading.) Symbol Doesn't equal
Ordersymbol when another currency is added to another seperate chart . - 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
Summary of Problem/background:
I am trying to place a buy stop order when the price hits a certain price, but I only want this to happen once, however I keep producing pending orders.
For example if on "EURUSD" , the price reaches 1.06700 and then places a buy stop at 1.06725. How do I ensure this only happens once through the coding, as the problem I am experiencing is that
it keeps producing orders every time it touches 1.06700.
I am new at coding so any help would be much appreciated.
Kind Regards,
Momo