/*[[ Name := Victory Author := Aborigen © 2003, MechanicalTrade Co. Link := http://www.mechanicaltrade.ru Lots := 0.10 Stop Loss := 0 Take Profit := 0 Trailing Stop := 0 ]]*/ Define: Line_Break(2),Gann_HiLo(2),NRTR_ATR(1.4),TrendSig(12), StopBar(3); Var: cnt(0),GannHilo(0),LineBreak(0),GannTrend(0),,ttime(0),Target(0),LineBreakOld(0),GannHiloOld(0); Var: Trailing(0),TrendUp(false); Var: NRTR_UP1(0),NRTR_DOWN1(0),SAR(0),Lo(0),Hi(0),Bye(0),Sell(0); If time=ttime then exit; ttime=time; //-----------------------------------Indicators Setting----------------------------- GannHilo=iCustom("Gann_HiLo",Gann_HiLo,MODE_FIRST,0); LineBreak=iCustom("3Line_Break",Line_Break,MODE_first,0); Bye =iCustom("GannTrendSig",TrendSig,MODE_FIRST,0); Sell=iCustom("GannTrendSig",TrendSig,MODE_SECOND,0); NRTR_UP1= iCustom("#NRTR_ATR_STOP",10,NRTR_ATR,MODE_FIRST,0); NRTR_DOWN1=iCustom("#NRTR_ATR_STOP",10,NRTR_ATR,MODE_SECOND,0); //Print (NRTR_DOWN1); //-----------------------------------Trailing Stop----------------------------- if Totaltrades>0 then Begin For cnt=1 to TotalTrades Begin If Ord(cnt,VAL_TYPE)=OP_BUY and Ord(cnt,VAL_SYMBOL)=Symbol and Ord(cnt,VAL_STOPLOSS)NRTR_DOWN1 and NRTR_DOWN1>0 then Begin ModifyOrder(Ord(cnt,VAL_TICKET),Ord(cnt,VAL_OPENPRICE),NRTR_DOWN1,Ord(cnt,VAL_TAKEPROFIT),Red); Exit; end; end; end; //------------------------------Close posicions--------------------------------- if Totaltrades>0 then Begin for cnt=1 to TotalTrades Begin if OrderValue(cnt,VAL_TYPE)=OP_BUY and OrderValue(cnt,VAL_SYMBOL)=Symbol and (GannHilo=0 or LineBreak=L[0] or NRTR_DOWN1>0 ) Then Begin CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),Bid,6,LightBlue); exit; end; if OrderValue(cnt,VAL_TYPE)=OP_SELL and OrderValue(cnt,VAL_SYMBOL)=Symbol and (GannHilo>0 or LineBreak=H[0] or NRTR_UP1>0 ) Then Begin CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),Ask,6,LightPink); exit; end; end; end; //------------------------------Open posicions---------------------------------- if Totaltrades<6 then Begin For cnt=1 to TotalTrades Begin if OrderValue(cnt,VAL_SYMBOL)=Symbol then exit; end; If GannHilo>0 and LineBreak>L[0] and Bye>0 and NRTR_UP1>0 then Begin // lt=floor((Balance-200)/200)/10; if lt<0.1 then exit; SetOrder(op_Buy,lots,PriceAsk,5,NRTR_UP1,0,blue); exit; end; If GannHilo=0 and LineBreak0 and NRTR_DOWN1>0 then Begin // lt=floor((Balance-200)/200)/10; if lt<0.1 then exit; SetOrder(op_Sell,lots,PriceBid,5,NRTR_DOWN1,0,red); exit; end; end; //-------------------------------------------------------------------------------