// Downloaded From https://www.WiseStockTrader.com procedure exit_proc(Buy,BuyPrice,TrailLevel,StopLevel,MaxNumberOfBars) { global BuyHelpArray; global BuyPriceHelpArray; global SellHelpArray; global SellPriceHelpArray; global LongStopTrailArray; global FlagStorageArray; global exitTrigger; BuyHelpArray=0; BuyPriceHelpArray=0; SellHelpArray=0; SellPriceHelpArray=0; LongStopTrailArray=Null; FlagStorageArray=0; exitTrigger=0; delay=1; slip=TickSize*0; for(i=1;i=MaxNumberOfBars) { SellHelpArray[j]=1; SellPriceHelpArray[j]=O[j]-slip; i=j; break; } else if(FlagStorageArray[j]==1 AND L[j]70,7,10); StopLevel=Param("Stop loss %",5,5,20,1); MaxNumberOfBars=Param("Max Bars",50,1,200,1); BuyTrigger=Cross(EMA(Close,10),EMA(Close,25)); Buy=Ref(BuyTrigger,-1);BuyPrice=Open; exit_proc(Buy,BuyPrice,TrailLevel,StopLevel,MaxNumberOfBars); Buy=BuyHelpArray; BuyPrice=BuyPriceHelpArray; Sell=SellHelpArray; SellPrice=SellPriceHelpArray; BuyTrigger=ExRem(BuyTrigger,Sell); GraphXSpace=5;SetChartBkColor(ColorRGB(0,0,0));SetChartOptions(0,chartShowDates); SetBarFillColor(IIf(C>O,colorGreen,IIf(C<=O,colorRed,colorLightGrey))); Plot(C,"Price",IIf(C>O,colorDarkGreen,IIf(C<=O,colorDarkRed,colorLightGrey)),64,0,0,0,0); PlotShapes(IIf(BuyTrigger,shapeSmallCircle,shapeNone),colorBrightGreen,0,L,-15); PlotShapes(IIf(ExitTrigger,shapeSmallCircle,shapeNone),colorOrange,0,H,15); PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorDarkGreen,0,L,-15); PlotShapes(IIf(Buy,shapeSmallCircle,shapeNone),colorLightBlue,0,BuyPrice,0); PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,H,-15); PlotShapes(IIf(Sell,shapeSmallCircle,shapeNone),colorYellow,0,SellPrice,0); Plot(LongStopTrailArray,"",IIf(FlagStorageArray==1,colorRed,colorBlue),1);