Amibroker afl code required

buy signal alert when candle close above 10sma and rsi 14 above 40 or 60 and macd crossover (12,26,9)
sell signal alert when candle close below 10 sma and rsi 14 below 60 or 40 and macd crossover (26,12,9) on malti timeframe

For the above given condition check this Amibroker AFL

_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”, colorDefault ), styleNoTitle | ParamStyle(“Style”) | GetPriceStyle() );

r1 = Param( “Fast avg”, 3, 2, 200, 1 );
r2 = Param( “Slow avg”, 10, 2, 200, 1 );
r3 = Param( “Signal avg”, 16, 2, 200, 1 );
ml = MACD(r1, r2);
sl = Signal(r1,r2,r3);
Buy=((( ml>sl)AND Cross( RSI(14),45)) OR (Cross(ml,sl)AND RSI(14)>45));
Sell =((Cross(sl,ml) AND 45> RSI(14)) OR ((sl>ml) AND Cross(45, RSI(14))));

_SECTION_END();

2 Likes

buy signal alert when candle close above 10sma and rsi 14 above 40 or 60 and macd crossover (12,26,9)
sell signal alert when candle close below 10 sma and rsi 14 below 60 or 40 and macd crossover (26,12,9) on also PI SCANNER CODE