315 AFL alert not working - pls help

#1
hi

I've coded a simple 315 ema crossover AFL to send an email ALERT when the crossover happens to the upside/downside. And I have also changed the amibroker settings to send email alerts. I'm using NSE EOD data downloader for RT data. But still when the crossover happens the alerts are not generated. Please can somebody look at the afl below and suggest what's wrong.

Plot(EMA( Close,3), "3d-ema", colorRed );

Plot(EMA( Close,15), "15d-ema", colorBlue );

Buy = Cross(EMA(Close,3),(EMA(Close,15)));

Sell = Cross(EMA(Close,15),(EMA(Close,3)));

PlotShapes(shapeUpArrow*Buy,colorGreen);
PlotShapes(shapeDownArrow*Sell,colorBlack);

AlertIf( Buy, "EMAIL", "315 Crossover "+FullName(), 1 );

AlertIf( Sell, "EMAIL", "315 Crossover "+FullName(), 1 );

Thanks in advance
SR
 

hmsanil

Active Member
#2
CHECK IT OUT NOW,


Code:
Plot(EMA(Close,3),"3EMA",colorBlue,style=styleThick);
Plot(EMA(Close,15),"15EMA",colorRed,style=styleThick);
Buy=Cross(EMA(Close,3),EMA(Close,15));
Sell=Cross(EMA(Close,15),EMA(Close,3));
Short=Sell;
Cover=Buy;
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );


AlertIf( Buy, "EMAIL", "315 Crossover "+FullName(), 1 );

AlertIf( Sell, "EMAIL", "315 Crossover "+FullName(), 1 );
 
Last edited:
#3
Thanks for that hmsanil

It is sending real time alerts now. But it is sending RT alerts every 10 seconds, btw 10 seconds is the refresh interval for my RT data feed. For example ICICI bank had a 315 crossover today so every 10 seconds it sends an alert saying icici has crossed over, but I just want it to send once when the actual crossover happens. Do you think there is something wrong with the settings. Please suggest. Thanks for your help again.

SR
 

johnnypareek

Well-Known Member
#4
Thanks for that hmsanil

It is sending real time alerts now. But it is sending RT alerts every 10 seconds, btw 10 seconds is the refresh interval for my RT data feed. For example ICICI bank had a 315 crossover today so every 10 seconds it sends an alert saying icici has crossed over, but I just want it to send once when the actual crossover happens. Do you think there is something wrong with the settings. Please suggest. Thanks for your help again.

SR

Try this
HTML:
Plot(EMA(Close,3),"3EMA",colorBlue,style=styleThick);
Plot(EMA(Close,15),"15EMA",colorRed,style=styleThick);
Buy=Cross(EMA(Close,3),EMA(Close,15));
Sell=Cross(EMA(Close,15),EMA(Close,3));
Short=Sell;
Cover=Buy;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );


AlertIf( Buy, "EMAIL", "315 Crossover "+FullName(), 1 );

AlertIf( Sell, "EMAIL", "315 Crossover "+FullName(), 1 );
 

Similar threads