Simple AFL code for 5 EMA(High-Low)
Buy = Cross(Close,EMA(High,5));
Sell = Cross(EMA(Low,5),Close);
PlotShapes(IIf(Sell==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-20);
PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-20);
_SECTION_BEGIN(“5 EMA High-Low”);
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( Close, “Close”, ParamColor(“Color”, colorBlack ), styleNoTitle | ParamStyle(“Style”) | GetPriceStyle() );
Buy = Cross(Close,EMA( High , 5 ));
Sell = Cross(EMA( Low , 5 ),Close);
PlotShapes(IIf(Sell==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-20);
PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-20);
Plot( EMA( Low,5), “5 EMA LOW”,ParamColor(“Color”, colorBlue ),styleNoRescale);
Plot( EMA( High,5), “5 EMA High”,ParamColor(“Color”, colorBlue ),styleNoRescale);
_SECTION_END();
Related Posts:
Most Commented Posts
Written by: Rajandran R















Little modification is required. Please draw the 5EMA (High Low) Band.
I had added in the coding part alone
Dear RajI have just modified your afl i.e.Buy = Cross(Close,EMA( Low , 5 ));Sell = Cross(EMA( High , 5 ),Close);and found more meaningful. Please do comment on this modification.
Its adds more value to the trading systemin minimizing the losses and producing avalueable system.
One more modification is required. Just open daily Nifty Chart and just watch 16-12-2009. it has given false signal. I do not know how to omit it but this type of false signal can be omitted.If possible then it will be great trading system.Thanks
Iam sorry iam not getting any false signal on 16-12-2009
More modification done in Buy sell.Buy = Cross(Close,EMA( Low , 5 ))OR Cross(Close,EMA( High , 5 )); Sell = Cross(EMA( High , 5 ),Close)OR Cross(EMA( Low , 5 ),Close);It works fine in hourly and daily chart. I have added your earlier Buy Sell signal conditionally because if turn around happened within the band then this conditional extension is required.
@ShyamWe should not try to create more buy/sell signals.As this would create a mess. The scope of creating a buy/sell signal is to identify turns earlier and to generate potential profits. If you include 5 EMA signals also then it would probably create a mess and finally ends in confusion(i.e should we have to believe this signal or not)
if the signal density is high then your profit potential is very low
hi thanks for afl. pls explain how to trade with help of this afl. on which scripts gives good results?
Dinesh,
I tried for hourly, Daily and Weekly yielding good results. to know how to trade this afl just visit this post Simple Rules to Trade Using 5 EMA(LOW-HIGH)