Hi,
Can you please help me out with the AFL CODE for EMA CROSSOVER when EMA 13 CROSSES EMA 08 and vice versa and alert should be triggered for the same.
Buy = When Ema 13 crosses Ema 08 from below
sell = when ema 08 crosses ema 13from above
and alert should be generated for buy and sell signals.
Thanks a lot in advance
for the above given condition, check this amibroker afl for ema crossover
_SECTION_BEGIN(“Price”);
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(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() );
_SECTION_END();
_SECTION_BEGIN(“ema”);
Plot( EMA( Close, 8 ), colorRed, styleThick );
Plot( EMA( Close, 13 ), colorBlue, styleThick );
Buy = Cross (EMA( Close, 8 ), EMA( Close, 13 )) ;
Sell = Cross (MA( Close, 13), EMA( Close, 8));
PlotShapes (BuyshapeUpTriangle,colorGreen);
PlotShapes (SellshapeDownTriangle,colorRed);
_SECTION_END();