/*[[ Name := 4HR VTrader Author := FAB4X Link := http://www.FAB4X.com Notes := Use on 4HR charts Lots := 1.00 Stop Loss := 0 Take Profit := 100 Trailing Stop := 0 ]]*/ Define: Slippage(5),MM(0),Risk(7.5); Var: cnt(0),Opentrades(0),lotsi(0); var: trend(""); var: vTime(0),mtsbC(0),mtssC(0); VAR: vol1(0),vol2(0); if Period != 240 then { Comment("This expert is for 4HR Charts"); Exit; } //If (DayOfWeek <2 or DayOfWeek >6 or hour <= 8 or hour >21) then exit; If TimeYear(time)<2005 then Exit; if Curtime - LastTradeTime < 5 then exit; vol1=volume[1]; vol2=volume[2]; if vol1vol2 then { trend ="SHORT"; }else{ if vol1=vol2 then { trend ="FLAT"; } } } comment("VOLUME TREND DIRECTION IS ",trend,"\nTime=",TimeToStr(curtime),"\nVolume Data -> ",volume); ////////////////////////////////////////////////// ///////////// Manage multiple trades ///////////// ////////////////////////////////////////////////// Opentrades=0; For cnt=1 to TotalTrades Begin If OrderValue(cnt,Val_Symbol)=Symbol then { Opentrades=Opentrades+1; }; End; ////////////////////////////////////////////////// ///////////// Money Manager ///////////// ////////////////////////////////////////////////// if mm<>0 then Lotsi=Ceil(Balance*risk/10000)/10 else Lotsi=Lots; //if Opentrades =! 0 then //{ for cnt=1 to TotalTrades { If Ord(cnt,VAL_TYPE)=OP_BUY and Ord(cnt,VAL_SYMBOL)=Symbol then { If vol1>vol2 or vol1==vol2 then { CloseOrder(OrderValue(cnt,VAL_TICKET),Ord(cnt,VAL_LOTS),bid,0,BlueViolet); // Exit; }; }; If Ord(cnt,VAL_TYPE)=OP_SELL and Ord(cnt,VAL_SYMBOL)=Symbol then { If vol1=StartHour and Minute>=StartMinute) then //{ if vol1=vol2 then exit; if opentrades < 1 then { //if vTime != Time[0] then //{ if hour == 8 or hour == 12 or hour == 16 or hour == 20 then { IF vol1vol2 THEN { if bid = open then { SetOrder(OP_SELL,Lotsi,bid,slippage,0,bid-takeprofit*point,Red); // vTime = Time[0]; Exit; } } } } //}