Call a function every 6 minutes in a 1 Hour TimeFrame EA

To add comments, please log in or register
Network Guru
13
Network Guru  
How do i call a function in an EA that runs on H1 timeframe. Since the Start() or OnStart() runs once per H1 Bar but I want to call the below function every 6 minutes  . Using OnTick() does not work for me , i don't want to call it on every tick. Just every 6 minutes   . Any help will be welll appreciated .    


     void myEverySixMinutes()

  {

      //Reset functionCalled boolean

      if(MathMod(Minute(),6)) {

         functionCalled = false;

      }

            

      if(functionCalled == false) {

         if(MathMod(Minute(),6)) {

             

         }

         else {

            // refresh the market info

            Log("Random Timer: = ", 6);

            RefreshRates();

                        

            Dosomethingfunction();

                      

            //Stop Function being called again

            functionCalled = true;

 

         }

      }

       

  }

Eleni Anna Branou
Moderator
6684
Eleni Anna Branou  

Please use the </> button to post your code.


Alain Verleyen
36171
Alain Verleyen  
Network Guru:
How do i call a function in an EA that runs on H1 timeframe. Since the Start() or OnStart() runs once per H1 Bar but I want to call the below function every 6 minutes  . Using OnTick() does not work for me , i don't want to call it on every tick. Just every 6 minutes   . Any help will be welll appreciated .    

What about OnTimer() ?

To add comments, please log in or register