Can someone help me with the below EMA crossover alert ?
I used it on a 5 mins chart and it is generating alot of email alerts. How can i reduce it ?? Please help !!!!!! Thanks...
//---- input parameters
extern int FastEMA=3;
extern int SlowEMA=34;
extern int SlowEM2=89;
//| Custom indicator initialization function |
//| Custom indicator deinitialization function |
// EMA34 Crossover
if (FASTEMACURRENT > SLOWEMACURRENT && FASTEMAPREVIOUS < SLOWEMAPREVIOUS)
SendMail(Symbol()+" 34EMA Bullish",Symbol()+" 34EMA Cross Up");
if (FASTEMACURRENT SLOWEMAPREVIOUS)
SendMail(Symbol()+" 34EMA Bearish",Symbol()+" 34EMA Cross Down");
// EMA89 Crossover
if (FASTEMACURRENT > SLOWEMACURRENT2 && FASTEMAPREVIOUS < SLOWEMAPREVIOUS2)
SendMail(Symbol()+" 89EMA Bullish",Symbol()+" 89EMA Cross Up");
if (FASTEMACURRENT SLOWEMAPREVIOUS2)
SendMail(Symbol()+" 89EMA Bearish",Symbol()+" 89EMA Cross Down");
Add this at the end of your indicator
static datetime dt = 0;
if (dt != Time)
dt = Time; Sleep(100); // wait for tick
and change SendMail to this if (NewBar()) SendMail .........
How do i do that ? I am not so good in programming.
Kinda confused with the new add on. Will it works in 1hr chart too ?
Please help to piece up. Thanks you.
post it here as an attachment, I will correct it for u
I appreciate your kind help. For your information, i would be using this EA for 30mins and 1 hour chart.
I would like to get email alert when EMA3 crossover EMA34 and EMA3 crossover EMA89. I would not want any repeated alert. I know the repeated alerts was due to current bar moving up/down when price increases/decreases.
Thanks for the help again.
I just aded the code to prevent multiple alert/email. I didn't change the rest
Will there be any implication if the ema crossup and then quick reverse crossdown ?
Will it affect the alert ? Jus curious... based on yr programming experience.
if this will be in the same bar ( I mean if the cross up will start u will get an alert. If the bar will not close and a reverse apears, u will not get another alert. U right then.
I still got alot of repeated alerts within the same bar. Could u please help to see if there is any logic errors ? Thanks alot
Did u compile my version?
I noticed that this is not an indicator, its EA. I put it in my demo account and I will see what will be
Yes, it is an EA. I did compile it and get lot of alerts.
I made some indication in the outputs to show it is a new compiled version.