下载MetaTrader 5

大家好!帮忙看看这个EA的代码为什么不会开仓?

要添加评论,请登录注册
他们已经从他们的信号获利。发布您的信号并加入他们!
yongjun wu
374
yongjun wu 2014.07.27 11:04 

放便的话,请求高手修复一下 .非常感谢!

这个EA的代码来自网络,据说有人测试10年无一单亏损,超级完美EA。

 若有侵权,本人愿意删除止贴.

 

//+------------------------------------------------------------------+

//|                                                  Combo_Right.mq4 |
//|                               Copyright ?2008, Yury V. Reshetov |
//|                               http://bigforex.biz/load/2-1-0-171 |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2008, Yury V. Reshetov"
#property link      "http://bigforex.biz/load/2-1-0-171"

//---- input parameters
extern double       tp1 = 50;
extern double       sl1 = 50;
extern int          p1 = 10;
extern int          x12 = 100;
extern int          x22 = 100;
extern int          x32 = 100;
extern int          x42 = 100;
extern double       tp2 = 50;
extern double       sl2 = 50;
extern int          p2 = 20;
extern int          x13 = 100;
extern int          x23 = 100;
extern int          x33 = 100;
extern int          x43 = 100;
extern double       tp3 = 50;
extern double       sl3 = 50;
extern int          p3 = 20;
extern int          x14 = 100;
extern int          x24 = 100;
extern int          x34 = 100;
extern int          x44 = 100;
extern int          p4 = 20;
extern int          pass = 1;
extern double       lots = 0.01;
extern int          mn = 888;
static int          prevtime = 0;
static double       sl = 10;
static double       tp = 10;



//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
   if (Time[0] == prevtime) return(0);
   prevtime = Time[0];
   
   if (! IsTradeAllowed()) {
      again();
      return(0);
   }
//----
   int total = OrdersTotal();
   for (int i = 0; i < total; i++) {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == mn) {
         return(0);
      } 
   }
   
   sl = sl1;
   tp = tp1;
   
   int ticket = -1;
   
   RefreshRates();
   
   if (Supervisor() > 0) {
      ticket = OrderSend(Symbol(), OP_BUY, lots, Ask, 1, Bid - sl * Point, Bid + tp * Point, WindowExpertName(), mn, 0, Blue); 
      if (ticket < 0) {
         again();      
      }
   } else {
      ticket = OrderSend(Symbol(), OP_SELL, lots, Bid, 1, Ask + sl * Point, Ask - tp * Point, WindowExpertName(), mn, 0, Red); 
      if (ticket < 0) {
         again();
      }
   }
//-- Exit --
   return(0);
}
//+--------------------------- getLots ----------------------------------+


double Supervisor() {
   if (pass == 4) {
      if (perceptron3() > 0) {
         if (perceptron2() > 0) {
            sl = sl3;
            tp = tp3;
            return(1);
         }
       } else {
         if (perceptron1() < 0) {
            sl = sl2;
            tp = tp2;
            return(-1);
         }
      }
      return(basicTradingSystem());
   }

   if (pass == 3) {
      if (perceptron2() > 0) {
         sl = sl3;
         tp = tp3;
         return(1);
       } else {
         return(basicTradingSystem());
       }
   }

   if (pass == 2) {
      if (perceptron1() < 0) {
         sl = sl2;
         tp = tp2;
         return(-1);
       } else {
         return(basicTradingSystem());
       }

   }
   return(basicTradingSystem());
}

double perceptron1()   {
   double       w1 = x12 - 100;
   double       w2 = x22 - 100;
   double       w3 = x32 - 100;
   double       w4 = x42 - 100;
   double a1 = Close[0] - Open[p2];
   double a2 = Open[p2] - Open[p2 * 2];
   double a3 = Open[p2 * 2] - Open[p2 * 3];
   double a4 = Open[p2 * 3] - Open[p2 * 4];
   return(w1 * a1 + w2 * a2 + w3 * a3 + w4 * a4);
}

double perceptron2()   {
   double       w1 = x13 - 100;
   double       w2 = x23 - 100;
   double       w3 = x33 - 100;
   double       w4 = x43 - 100;
   double a1 = Close[0] - Open[p3];
   double a2 = Open[p3] - Open[p3 * 2];
   double a3 = Open[p3 * 2] - Open[p3 * 3];
   double a4 = Open[p3 * 3] - Open[p3 * 4];
   return(w1 * a1 + w2 * a2 + w3 * a3 + w4 * a4);
}

double perceptron3()   {
   double       w1 = x14 - 100;
   double       w2 = x24 - 100;
   double       w3 = x34 - 100;
   double       w4 = x44 - 100;
   double a1 = Close[0] - Open[p4];
   double a2 = Open[p4] - Open[p4 * 2];
   double a3 = Open[p4 * 2] - Open[p4 * 3];
   double a4 = Open[p4 * 3] - Open[p4 * 4];
   return(w1 * a1 + w2 * a2 + w3 * a3 + w4 * a4);
}

double basicTradingSystem() {
   return(iCCI(Symbol(), 0, p1, PRICE_OPEN, 0));
}

void again() {
   prevtime = Time[1];
   Sleep(30000);
}

insane007
824
insane007 2014.07.27 11:33  
这么牛...围观..
weiliang Li
2237
weiliang Li 2014.07.27 13:03  
insane007:
这么牛...围观..
网络这个东西大多是吹牛,不可信,即使有好代码,有些作者都把关键部分隐藏或删除了,目的是让你找他购买!或是在向你推销什么信息。你这个代码明显是没有给出下单条件和下单规则,我只知道这么多,不会修改,我一般这类代码会忽略它。其实有许多的缺陷,只是执行的纪律比人机动性强,如果你在操作时也能机动化些,盈利率估计会提高!
Jian Chen
版主
3621
Jian Chen 2014.07.27 17:16  

10年无一单亏损,还不是小手数死扛,这个EA逻辑也比较简单,不会那么神的。。

没有开仓,你可以查查日志里面有什么错误没有。

从这个EA目前的默认参数来看,走的是简单的 pass=1,走的最基本交易条件路线,默认止损和获利都只有10个点,如果是5位小数点平台,就会太小了,把那个sl和tp改成100看,能否正常开仓。

Jinsong Zhang
15606
Jinsong Zhang 2014.07.28 07:27  
不开仓就不会亏损了哈!赚钱的EA是不会公开的,真公开也就失效了。另:贴代码请点击“SRC”钮
bingbing zhang
322
bingbing zhang 2014.08.06 13:49  
这个EA里面有未来函数,所以EA测试可以盈利,实际开盘不会开仓。
要添加评论,请登录注册