Won't try to understand your code, I'm not that bright...
But if you're trying to only make one trade at a time, you just need to read existing orders, and if there is a trade already, do something...
This function would tell me if there are any existing orders for the chart symbol. You might need to add in other stuff like pending orders, magicnumber etc.
int ticket; void OnTick(){ // other code getexistingticket(ticket); if(ticket!=-1)return; } void getexistingticket(int &ticket){ ticket=-1; for(int i=OrdersTotal()-1;i>=0;i--) if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)&&OrderSymbol()==_Symbol){ ticket=OrderTicket(); return;} }

- www.mql5.com
Won't try to understand your code, I'm not that bright...
But if you're trying to only make one trade at a time, you just need to read existing orders, and if there is a trade already, do something...
This function would tell me if there are any existing orders for the chart symbol. You might need to add in other stuff like pending orders, magicnumber etc.
Hi Andrew,
Thanks for you reply.
I will try to change it asap.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone,
I tried to code my EA but I meet differents problems,
I don't understand why this EA send many trade at the same time (I try to block the code with 1 trade by 1), also How can I add a pause of 5 mins by exemple after an orderclose ?
Thanks in advance for your time and your help.
Take care of you.