How to change the alerts to the selected timeframe?

To add comments, please log in or register
Martijn Rikkert
449
Martijn Rikkert  

Hello, 

I have an indicator,it is very helpfull, but if creates alerts all the time. And this is spamming my mailbox. I want only alerts on the selected timeframes. So when I have the indicator on a 4 H chart then it should create an alerts every 4 hours etc.. 

Can anybody help me with this? I tried to do it myself, but I am not a good coder. 

Files:
Martijn Rikkert
449
Martijn Rikkert  
Anyone???
Keith Watford
Moderator
20312
Keith Watford  

You shouldn't be so impatient. Your 2nd post will put some people off trying to help you.

   bool newBar=false;
   static datetime barTime=0;
   datetime thisBarTime=Time[0];
   if(barTime!=thisBarTime)
     {
      barTime=thisBarTime;
      newBar=true;
     }

//various approaches from here....
//one being
   
   if(newBar)
     {
      //Do Alert Check
     }
      
To add comments, please log in or register