Alert Once Per Day

 

Hello, i have a multicurrency Pivot Dashboard and i would like to add a funcion that send an Alert once per day if the pivot is touched.

I have created a Pivot Touch Function that return me True if pivot is tested and False if not.

bool PivotTouch(double _high, double _low, double pivot)
   {
      if(pivot<=_high && pivot>=_low)
      {
         return 1==1;
      }
      else
         return 0==1;
   } 

I tried to code a onetimealert function but it doesnt work properly because it continues to send me alert every tick.


i would like to have it only one the pivot is touched and no more for the rest of the day. The next day the pivot will change and the alert has to reset.

Thanks for the Help

 void onetimealertDaily(string Symbol_,bool Allert)
 {
   if (Allerta==True)
   {
   static datetime = oggi;
      if(oggi != iTime(Symbol_,PERIOD_M1,0);
      {
         Alert("Daily Pivot "+ Symbol_ + " Touched.");
         oggi = iTime(Symbol_,PERIOD_M1,0);
          
      }
      }
 }
 
  1. Your code
    Simplified
    if(pivot<=_high && pivot>=_low)
    {
       return 1==1;
    }
    else
       return 0==1;
    return pivot<=_high && pivot>=_low;

  2. Albrin Memedi: it continues to send me alert every tick.

    You are looking at a signal. Act on a change of signal.
              MQL4 (in Strategy Tester) - double testing of entry conditions - MQL5 programming forum #1 (2017)