Thread: Robot Scalper
View Single Post
  #2 (permalink)  
Old 11-03-2005, 08:20 AM
BrunoFX's Avatar
BrunoFX BrunoFX is offline
Senior Member
 
Join Date: Sep 2005
Posts: 811
BrunoFX will become famous soon enough
hello Traders,

This is the code of :Scalper_V1[1].35_MC.mql:

Code:
/*[[
        Name := Robot_Scalper-V1.35-MC
        Author := Copyright © 2005, Metex Invest Inc.
        Link := http://www.metexinvest.com/
        Notes := 
        Lots := 1.00
        Stop Loss := 17
        Take Profit := 50
        Trailing Stop := 5
]]*/

Var:    pos1pre(0);
Var:    pos2cur(0);
Var:    cnt(0);
Var:    mode(0);
Var:    openpozprice(0);
Var:    bull(0);
Var:    bear(0);
Define: slippage(2);
Var:    sl(0);
Var:    tp(0);
Define: ProfitMade(3);
Var:    OpenTrades(0);
Var:    i(0);
Var:    AcountNum(75807);

pos1pre = iBullsPower(13,0,1);
pos2cur = iBullsPower(13,0,0);
bull = iBullsPower(5,0,1);
bear = iBearsPower(5,0,1);

for cnt = 1 to TotalTrades
   { // else gotoLine 38;
   if OrderValue(cnt,VAL_SYMBOL) == Symbol then OpenTrades++;
   } // next - 38

if TimeYear(Time[0]) >= 2005 and TimeMonth(Time[0]) >= 8 and TimeDay(Time[0]) >= 7 then
   { // else gotoLine 63;
   Comment("\n","\n"," Your License Has Expired ","\n"," Please Contact Customer Support ","\n"," The Robot Will Trade ","\n"," For 2 Days Then Cease To Operate ");
   } // next - 63

if TimeYear(Time[0]) >= 2005 and TimeMonth(Time[0]) >= 8 and TimeDay(Time[0]) >= 7 then
   { // else gotoLine 176;
   if OrderValue(cnt,VAL_SYMBOL) == Symbol then
      { // else gotoLine 164;
      if OrderValue(cnt,VAL_TYPE) == OP_BUYLIMIT then
         { // else gotoLine 95;
         DeleteOrder(OrderValue(cnt,VAL_TICKET),Red);
         Exit;
         } // next - 95
      if OrderValue(cnt,VAL_TYPE) == OP_SELLLIMIT then
         { // else gotoLine 106;
         DeleteOrder(OrderValue(cnt,VAL_TICKET),Red);
         Exit;
         } // next - 106
      if OrderValue(cnt,VAL_TYPE) == OP_BUYSTOP then
         { // else gotoLine 117;
         DeleteOrder(OrderValue(cnt,VAL_TICKET),Red);
         Exit;
         } // next - 117
      if OrderValue(cnt,VAL_TYPE) == OP_SELLSTOP then
         { // else gotoLine 128;
         DeleteOrder(OrderValue(cnt,VAL_TICKET),Red);
         Exit;
         } // next - 128
      if OrderValue(cnt,VAL_TYPE) == OP_BUY then
         { // else gotoLine 146;
         CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),OrderValue(cnt,VAL_CLOSEPRICE),3,Red);
         Exit;
         } // next - 146
      if OrderValue(cnt,VAL_TYPE) == OP_SELL then
         { // else gotoLine 164;
         CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),OrderValue(cnt,VAL_CLOSEPRICE),3,Red);
         Exit;
         }
      } // next - 164
   if OpenTrades <= 0 then
      { // else gotoLine 176;
      Alert(" Your License Has Expired ","\n"," The Robot Has Ceased To Operate ","\n"," Please Contact Customer Support ","\n"," For A New Subscription ");
      Exit;
      }
   } // next - 176

if TimeYear(Time[0]) >= 2005 and TimeMonth(Time[0]) >= 9 and CurTime > 11080540800 then
   { // else gotoLine 200;
   Alert(" Your License Has Expired ");
   Comment(" Please Contact Customer Support ","\n"," The Expert will Manage Open Trades ","\n"," For 2 Days ","\n"," Then Cease To Operate ");
   Exit;
   } // next - 200

if TimeYear(Time[0]) >= 2005 and TimeMonth(Time[0]) >= 9 and TimeDay(Time[0]) >= 6 then Exit;

OpenTrades = 0;
for i = 1 to TotalTrades
   { // else gotoLine 232;
   if OrderValue(i,VAL_SYMBOL) == Symbol then OpenTrades++;
   } // next - 232

if OpenTrades < 1 then
   { // else gotoLine 294;
   if pos1pre > pos2cur and pos2cur > 0 and bull + bear > 0 then
      { // else gotoLine 266;
      sl = Ask - StopLoss * Point;
      tp = Bid + TakeProfit * Point;
      SetOrder(OP_BUY,Lots,Bid,slippage,sl,tp,Blue);
      Exit;
      } // next - 266
   if pos2cur < 0 and bull + bear > 0 then
      { // else gotoLine 294;
      sl = Bid + StopLoss * Point;
      tp = Ask - TakeProfit * Point;
      SetOrder(OP_SELL,Lots,Ask,slippage,sl,tp,Red);
      Exit;
      }
   } // next - 294

for cnt = 1 to TotalTrades
   { // else gotoLine 362;
   if Ord(cnt,VAL_TYPE) == OP_BUY and Ord(cnt,VAL_SYMBOL) == Symbol then
      { // else gotoLine 330;
      if Bid - Ord(cnt,VAL_OPENPRICE) >= ProfitMade * Point then
         { // else gotoLine 330;
         CloseOrder(OrderValue(cnt,VAL_TICKET),Ord(cnt,VAL_LOTS),Bid,0,BlueViolet);
         Exit;
         }
      } // next - 330
   if Ord(cnt,VAL_TYPE) == OP_SELL and Ord(cnt,VAL_SYMBOL) == Symbol then
      { // else gotoLine 360;
      if Ord(cnt,VAL_OPENPRICE) - Ask >= ProfitMade * Point then
         { // else gotoLine 360;
         CloseOrder(OrderValue(cnt,VAL_TICKET),Ord(cnt,VAL_LOTS),Ask,0,Violet);
         Exit;
         }
      } // next - 360
   } // next - 362

Last edited by newdigital : 11-03-2005 at 03:28 PM.
Reply With Quote