Sleep Function

 

Hi,


i found a really good ea but what i want is an sleepfunction.

I cant modify the ea hopefully someone can help me.


I want that after every open trade the ea wait for 15second to open a new one.

Can anyone do this for me please?

 
I dont know which file is need it
 

You could try this . . . .

Find this part of the code. It's in the SendOrder function . . .

   if (ticket < 0)
    {
      err = GetLastError();
      if (errorAlerts) Alert(symbol," ordermodify failed, error #",err,"");
      Print(symbol," ordermodify failed, error #",err,"");
     return(false);
    }//if (ticket < 0)

after it add . . .

Sleep(15000);
 
I will try this, thanks for you answer
 
Remember sleep won't work in the tester
int start(){
   static datetime nextTrade;
   if (tradeConditions && TimeCurrent() > nextTrade){
      nextTrade = TimeCurrent() + 15;
      orderSend(
   }
}
Reason: