/*[[ Name := moneymaker Author := www.keepthemoney.com Notes := eur/usd 1 hour works the best Lots := 1 Stop Loss := 30 Take Profit := 0 Trailing Stop := 25 ]]*/ defines: YY(2004),MM(1),DD(01),HH(00), K(7.5), Risk(0); var: pb(0),pts(10),tm(600),ls(0),sl(0),i(0), HD(0),LD(0); if TimeYear(time) < YY then exit; if TimeMonth(time) < MM and TimeYear(time) = YY then exit; if TimeDay(time) < DD and TimeMonth(time) = MM and TimeYear(time) = YY then exit; if TimeHour(time) < HH and TimeDay(time) = DD and TimeMonth(time) = MM and TimeYear(time) = YY then exit; if TimeMonth(time) > 12 and TimeYear(time) >= 2004 then K=1; if TotalTrades>0 and Ord(1,VAL_TYPE)=OP_BUY Then pb=1; if TotalTrades>0 and Ord(1,VAL_TYPE)=OP_SELL Then pb=0; HD=0; LD=0; for i=1 to pts { HD+=H[i-1]; LD+=L[i-1]; }; sl=k*sqrt((HD-LD)/pts/Point)*Point ; if CurTime>LastTradeTime+10 then { if TotalTrades<1 then { if risk<>0 then ls=Normalize(Balance*risk/100/10/5/sl*Point,1) else ls=Lots; if ls > 10 then ls=Floor(ls); if ls<1 then ls=1; if pb=0 then {SetOrder(OP_BUY,ls,bid,5,0,0,Blue); }; if pb=1 then {SetOrder(OP_SELL,ls,ask,5,0,0,Red); }; }; }; If TotalTrades<1 or (CurTime-LastTradeTime)Ask+sl+10*Point or Ord(1,VAL_StopLoss)=0 then {ModifyOrder(Ord(1,VAL_TICKET),Ord(1,VAL_OPENPRICE),Ask+sl,0,0); }; };