Alert once for fresh condition(Help)
Posted: Feb 13 2015
I've written code to alert when MA9 corss MA18(for example)
but when I excute the alert in 10 minites time frame
the Alert keeps triggered every 10 minute.
What I need is that it triggered once only until next condition meet again.
Thanks
but when I excute the alert in 10 minites time frame
the Alert keeps triggered every 10 minute.
What I need is that it triggered once only until next condition meet again.
Thanks
Code: Select all
input:QQ(168), a1(9), a2(18);
var:ma1(0),ma2(0);
ma1=average(close,a1);
ma2=average(close,a2);
condition1= CurrentBar > 1 and ma1 cross over ma2;
condition2= CurrentBar > 1 and ma1 cross under ma2;
if condition1 or condition2 then
playsound("d:\sound\GC.wav") ;
Alert(GetSymbolName);