Alert Timing

 

I want to be alerted when a variable is met in the LAST time frame. Right now I'm alerted at the end of EVERY time frame because this criteria was met sometime in the past intervals. Not sure how else to explain it. Here is the relevant code.

if (bCountdown==13) ~~~Should something go here referring to the previous interval?~~~



{if(Alerts==True && last_alert!=Time[1])

{

last_alert = Time[1];

Alert(Symbol(), " ", Period()," You Have A 13");

}

if(Text==True && last_sendmail!=Time[1])

{last_sendmail = Time[1];

string subject = StringConcatenate (Symbol(), " ", Period());

string some_text = " You Have A 13";


SendMail( subject, some_text);}

}

Thank You Very Much

Mark

 

As before . . .

1. Post your code with SRC button please

https://www.mql5.com/en/forum/139518

 
You need to use an additional bool and set and reset it to control the alerting . . .
Reason: