How to set a timer ?

To add comments, please log in or register
thomas2004
337
thomas2004  

Hi,

I use normally the 5-min, 10-min charts in the EA. But I want to update or modify the StopLoss or the TakeProfit every minute. How to?


Here are codes in my EA but this is for Bar-Begin. This means, if I use the 15-min chart, it will update/modify very 15 minutes.


void checkTrailingStop(){
   // Überprüfen ob neuer Periodebeginn vorliegt
   if (datePeriodeStartZeit != Time[0])   // Time[0] -> aktuelle Zeit
   {
      bNeuePeriodeBegonnen = true;
      datePeriodeStartZeit = Time[0];
   }
   else
     {
      bNeuePeriodeBegonnen = false;
     }

   if((bNeuePeriodeBegonnen == true) && (OrdersTotal() > 0)){
      updateTrailingStop();
   }   
}
Marco vd Heijden
Moderator
8148
Marco vd Heijden  
EventSetTimer(1000);
thomas2004
337
thomas2004  
So easy, many thanks!
To add comments, please log in or register