AFL for 5 Day Momentum Method
//5 Day Momentum Method. Modify Accordingly
// Stop Loss set at 2%. Please follow the stop loss mentioned in post
Buy = ADX(14)>35 AND PDI(14)>MDI(14) AND Cross(StochK(8,3),StochD(8,3,3)) AND StochK(8,3)<30;
Sell = Ref(Close,4);
Short=ADX(14)>35 AND MDI(14)>PDI(14) AND Cross(StochD(8,3,3),StochK(8,3)) AND StochK(8,3)>70;
Cover=Ref(Close,4);
Filter = Buy OR Short;
AddColumn(IIf(Buy,High,Null),"Buy Only Above",1.3);
AddColumn(IIf(Buy,High*0.98,Null), "Buy Stop Price",1.2);
AddColumn(IIf(Short,Low,Null),"Short Only Below",1.2);
AddColumn(IIf(Short,Low*1.02,Null),"Short Stop Loss",1.2);
AddColumn(ADX(14),"ADX (14)", 1.2);
AddColumn(PDI(14),"PDI",1.2);
AddColumn(MDI(14),"MDI",1.2);
AddColumn(StochK(8,3),"StochK",1.2);
Sell = ExRem(Sell,Buy);
Cover = ExRem(Cover,Short);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-20);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-30);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-25);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);
//5 Day Momentum Method. Modify Accordingly
// Stop Loss set at 2%. Please follow the stop loss mentioned in post
Buy = ADX(14)>35 AND PDI(14)>MDI(14) AND Cross(StochK(8,3),StochD(8,3,3)) AND StochK(8,3)<30;
Sell = Ref(Close,4);
Short=ADX(14)>35 AND MDI(14)>PDI(14) AND Cross(StochD(8,3,3),StochK(8,3)) AND StochK(8,3)>70;
Cover=Ref(Close,4);
Filter = Buy OR Short;
AddColumn(IIf(Buy,High,Null),"Buy Only Above",1.3);
AddColumn(IIf(Buy,High*0.98,Null), "Buy Stop Price",1.2);
AddColumn(IIf(Short,Low,Null),"Short Only Below",1.2);
AddColumn(IIf(Short,Low*1.02,Null),"Short Stop Loss",1.2);
AddColumn(ADX(14),"ADX (14)", 1.2);
AddColumn(PDI(14),"PDI",1.2);
AddColumn(MDI(14),"MDI",1.2);
AddColumn(StochK(8,3),"StochK",1.2);
Sell = ExRem(Sell,Buy);
Cover = ExRem(Cover,Short);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-20);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-30);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-25);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);