need help in creating AFL

vssoma

Well-Known Member
#1
dear,
i need help in creating AFL for stock alert with pop-up window.

conditions: 13 EMA is above 34 EMA, 55 EMA is above 144 EMA and
RSI & Stochastic is below 20 and headed upwards.......
then to give buy alert with pop-up window.

and

13 EMA is Below 34 EMA,55 EMA is Below 144 EMA, RSI & Stochastic is above 80 and
Headed Downward
then to give sell alert with pop-up window.

cause, i am getting buy/sell signal with symbol with another afls. so if get symbols with this alert it is not possible to identify which one is from which.that's why i am asking pop-up window.

thank you in advance.
 
#2
U have not specifically given the values for RSI and Stoch. U have also not mentioned abt Stoch crossing over the signal line.

Actually u can write simple stmts like this

Buy=Cross(ema(c,13),ema(c,34))
and Ema(c,55) > ema(c,144)
and RSI(14)<20
and Stoch(15)<20;

Sell=Cross(ema(c,34),ema(c,13))
and Ema(c,55) < ema(c,144)
and RSI(14)>80
and StochK(15)>80;

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

I dont have idea abt Pop-up window and Rising/Falling RSI. So i have omitted those in the above code.

But if u have many indicators on the chart and u want to have a different Buy/Sell symbol for the above code then, change the "shapeUpArrow" in the below code:-

shape=Buy*shapeUpArrow+Sell*shapeDownArrow;

U can change to any of these as given below:-

shapeNone, shapeUpArrow, shapeDownArrow, shapeHollowUpArrow, shapeHollowDownArrow, shapeSmallUpTriangle, shapeSmallDownTriangle, shapeHollowSmallUpTriangle, shapeHollowSmallDownTriangle, shapeUpTriangle, shapeDownTriangle, shapeHollowUpTriangle, shapeHollowDownTriangle, shapeSmallSquare, shapeHollowSmallSquare, shapeSquare, shapeHollowSquare, shapeSmallCircle, shapeHollowSmallCircle, shapeCircle,

Hope this helps

And plz be specific whenever u raise a query again

Happy trading

Rgds
 

Similar threads