Need help in ema afl

#1
Hello Seniors,

Can somebody help me with this AFL.

I need 30 EMA in Green & 200 EMA in Red,

If 30 EMA crosses below 200 then "SELL" has 2 be displayed in Amibroker
same way if 30 EMA crosses above 200 then "BUY" has to be displayed in Amibroker.

I use Live Feeds and look at 1 Mint, 5 Mint & 15 Mints charts for my Intraday Trading.

Hope some seniors will help me Out.

Thanking you ALL Seniors in Advance
 

sudris

Well-Known Member
#2
here you go ....
(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
EMA30 = EMA(C,30);
EMA200 = EMA(C,200);
Plot(EMA30, "EMA 30", colorGreen);
Plot(EMA200, "EMA 200", colorRed);
Buy = Cross(EMA30,EMA200);
Sell = Cross(EMA200,EMA30);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone), colorGreen, 0, L, Offset = -15);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone), colorRed, 0, H, Offset = -15);
 
Last edited:
#3
Thanks Sudris,

Now can u pls tell me how to enter the above said in Amibroker.
Everybody is talking about AFL but nobody actually showing a newcomer like me how to enter that in amibroker and how it will reflect in live charts.

Thanks in advance
 

sudris

Well-Known Member
#4
Hi Aman,

If you are new to Amibroker, I'd suggest you to first get well acquainted with the software.

you can refer the below links

  1. http://www.amibroker.com/guide/tutorial.html

  2. http://www.amibroker.com/guide/h_indbuilder.html
link no.2 is a shortcut for you. open the formula editor as per instructions in the link no.2 and paste the above code written in my earlier post as is. choose a name to save the code.


for other things, link no.1 should take you through.
 

Similar threads