// Downloaded From https://www.WiseStockTrader.com _SECTION_BEGIN("10 DMA system"); // Long Set up: Close above 10 Day (default) Simple Moving average (default) // Long Entry: Close above the previous candle (which is above 10 Day SMA) // Long Exit: Short Entry // Short Set up: Close below 10 Day Simple Moving average // Short Entry: Close below the previous candle (which is above 10 Day SMA) // Short Exit: Long Entry //SetTradeDelays(0,0,0,0); //SetOption("CommissionMode",3); //SetOption("CommissionAmount",2.01); //SetOption("FuturesMode",True); //NumContracts=1; //PositionSize=NumContracts*MarginDeposit; //SetOption("MaxOpenPositions",4); procedure exit_proc(Buy,BuyPrice,Short,ShortPrice) { global BuyAdjusted; global BuyPriceAdjusted; global ShortAdjusted; global ShortPriceAdjusted; global SellAdjusted; global SellPriceAdjusted; global CoverAdjusted; global CoverPriceAdjusted; global LongStopTrail; global ShortStopTrail; BuyAdjusted=0; BuyPriceAdjusted=0; ShortAdjusted=0; ShortPriceAdjusted=0; SellAdjusted=0; SellPriceAdjusted=0; CoverAdjusted=0; CoverPriceAdjusted=0; LongStopTrail=Null; ShortStopTrail=Null; delay=1; for(i=1;iO,ColorRGB(0,75,0),IIf(C<=O,ColorRGB(75,0,0),colorLightGrey))); Plot(C,"\nPrice",IIf(C>O,ColorRGB(0,255,0),IIf(C<=O,ColorRGB(255,0,0),colorLightGrey)),64,0,0,0,0); Plot(sma,"\nSMA",colorBlue,1); Plot(triggerLong,"",colorGreen,styleDashed); Plot(triggerShort,"",colorRed,styleDashed); PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorDarkGreen,0,L,-15); PlotShapes(IIf(Buy,shapeSmallCircle,shapeNone),colorWhite,0,BuyPrice,0); PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,H,-15); PlotShapes(IIf(Sell,shapeSmallCircle,shapeNone),colorWhite,0,SellPrice,0); PlotShapes(IIf(Short,shapeSmallDownTriangle,shapeNone),colorRed,0,H,IIf(Short AND Sell,-30,-15)); PlotShapes(IIf(Short,shapeSmallCircle,shapeNone),colorWhite,0,ShortPrice,0); PlotShapes(IIf(Cover,shapeSmallUpTriangle,shapeNone),colorDarkGreen,0,L,IIf(Cover AND Buy,-30,-15)); PlotShapes(IIf(Cover,shapeSmallCircle,shapeNone),colorWhite,0,CoverPrice,0); _SECTION_END();