/*[[ Name := Moneymaker Author := www.keepthemoney.com Notes := tested on EUR/USD 1 hour Lots := 1 Stop Loss := 20 Take Profit := 0 Trailing Stop := 20 //problems so far, EA waits about 15 min before setting stop, // EA has no direction, needs a trend direction to be made to work for top performance ]]*/ defines: YY(2004),MM(1),DD(01),HH(00), K(7.5), Slippage(2), Risk(0); var: pb(0),pts(10),tm(600),ls(0),sl(0),i(0), HD(0),LD(0),cnt(0); var: candle_time(0); var: Force(0), SAR(0),SAR1(0),SAR2(0),StohasticMain(0), StohasticSignal(0),StohasticMain1(0), StohasticSignal1(0),StohasticMain2(0), StohasticSignal2(0),StohasticMain3(0), StohasticSignal3(0); var: MaCurrent(0),MaPrevious(0),obv(0),obv1(0),obv2(0),obv3(0),obv4(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 timehour(time) < 6 then exit; //no trades in the first 6 hours of the day( waiting for the London open) //if candle_time = Time then Exit; // not a new candle candle_time = Time; 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); }; }; }; For cnt=1 to totaltrades { 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); }; };