how to change indicator alert to trigger at the event tick but only once per bar

 

I am using an EA as an alert indicator, that also adds an arrow on chart, when conditions are met signal is given. 

I dont understand code about counting bars, i just want the alert given at the tick by tick instance, then not repeating, so wait to next bar or 1 signal per bar. 

 I can post the file if easier...Here is the code snippet containing about Bars and some info on orders that is irrelevant:

int start()

{

   double visualAddition= 3*_pipsMultiplyer*Point;

   int    counted_bars=IndicatorCounted();

   if(Bars<=100) {return(0);}

   int i=Bars-counted_bars-1;

   while(i>=0)

   {

      _buySignal[i]=EMPTY_VALUE;

      _sellSignal[i]=EMPTY_VALUE;

      _lotSize[i]=_lotSizeDefault;

      if(IsBuySignal(i)){

         _buySignal[i]=iLow(Symbol(),Period(),i)-visualAddition;

         if(_enableAlert){

            if(i==1){

               Alert("BUY "+Symbol()+" "+Period()+" bluebreeze");

               SendMail("bluebreeze Long"+Symbol()+" "+Period(),"bluebreeze Long"+Symbol()+" "+Period());

            }

         }

      }

      if(IsSellSignal(i)){

         _sellSignal[i]=iHigh(Symbol(),Period(),i)+visualAddition;

         if(_enableAlert){

            if(i==1){

               Alert("SELL "+Symbol()+" "+Period()+" bluebreeze");

               SendMail("bluebreeze Short"+Symbol()+" "+Period(),"bluebreeze Short"+Symbol()+" "+Period());

            }

         }

      }         

      i--;

   }

   return(0);

 

Please edit/re-write your post and use SRC button to post the code. That way you code is much easier to read.

 

Please use forum search and search for one per bar discussion in forum https://www.mql4.com/search#!keyword=one%20per%20bar&module=mql4_module_forum

 
winbig:

I am using an EA

I dont understand code about counting bars, i just want ..

   int    counted_bars=IndicatorCounted();
  1. Use SRC
  2. You can NOT use IndicatorCounted in an EA, only in a CI.
  3. Since there are no slaves here, there are only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt and the nature of your problem.