老大,请帮忙加入亏损加注的程序!谢谢你!!

楼主  收藏   举报   帖子创建时间:  2019-05-05 10:26 回复:0 关注量:615
//+------------------------------------------------------------------+
  //|                                                      GBPJPYD.mq4 |
  //|                                                         David Wu |
  //|                                          13138689894; qq:7968159 |
  //+------------------------------------------------------------------+
  #property copyright "David Wu (GBPJPY) 13138689894; qq:7968159"
  #property link      "13138689894; qq:7968159"
  
  
  
  
  extern string Header = "David Wu (GBPJPY)";
  
  extern int MagicNo = 4399;
  extern bool UseAutoLot = false;                                                                              
  extern double MaxLots = 3;
  extern int MaxOrder = 1;
  extern double StopTime = 0.0;
  extern double MaximumRisk = 50.0;
  extern double TakeProfit = 25.0;
  extern double StopLoss = 500.0;
  extern double TrailingStop = 5.0;
  extern double DecreaseFactor = 3.0;
  extern bool HighRisk = TRUE;
  double gd_164;
  double g_period_172 = 10.0;
  int lots=1;
  
   
  
  double Predict() {
     double l_ima_0;
     double l_istddev_8;
     double ld_ret_16;
     double ld_24 = 0;
     double ld_32 = 0;
     double ld_40 = 0;
     double ld_48 = 0;
     double ld_unused_56 = 0;
     double ld_unused_64 = 0;
     double ld_72 = 0;
     double ld_80 = 0;
     double ld_88 = 0;
     double ld_96 = 0;
     double ld_104 = 0;
     double ld_unused_112 = 0;
     double ld_120 = 0;
     double ld_128 = 0;
     double ld_136 = 0;
     double l_ima_144 = iMA(NULL, 0, g_period_172, 0, MODE_SMA, PRICE_CLOSE, 0);
     for (int li_152 = 1; li_152  0.0 && l_ima_144 > ld_88 && ld_128 > 0.0 && Open[0] < l_ima_144 + ld_104 && Open[0] > l_ima_144) {
        ld_ret_16 = 1;
        gd_164 = 10000.0 * (3.0 * ld_104) + 10.0;
     }
     if (ld_136 < 0.0 && l_ima_144 < ld_88 && ld_128 < 0.0 && Open[0] > l_ima_144 - ld_104 && Open[0] < l_ima_144) {
        ld_ret_16 = 2;
        gd_164 = 10000.0 * (3.0 * ld_104) + 10.0;
     }
     return (ld_ret_16);
  }
  
  int start() {
     int l_ticket_0;
     int li_4;
     bool li_8;
     bool li_12;
     bool li_16;
     bool li_20;
     bool li_24;
     bool li_28;
     bool li_32;
     bool li_36;
     if (Bars < 100) {
        Print("bars less than 100");
        return (0);
     }
     double l_ima_40 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_HIGH, 0);
     double l_ima_48 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_HIGH, 1);
     double l_ima_56 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_LOW, 0);
     double l_ima_64 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_LOW, 1);
     double l_ima_72 = iMA(NULL, 0, 22, 0, MODE_SMA, PRICE_CLOSE, 0);
     double l_ima_80 = iMA(NULL, 0, 22, 0, MODE_SMA, PRICE_CLOSE, 5);
     double l_ima_88 = iMA(NULL, 0, 22, 0, MODE_SMA, PRICE_CLOSE, 1);
     double l_ima_96 = iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, 0);
     double l_ima_104 = iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, 1);
     double l_ima_112 = iMA(NULL, 0, 10, 0, MODE_EMA, PRICE_CLOSE, 1);
     double l_ima_120 = iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, 5);
     double l_ima_128 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, 0);
     double l_ima_136 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, 1);
     double l_istddev_144 = iStdDev(NULL, 0, 20, 0, MODE_EMA, PRICE_CLOSE, 0);
     double l_istddev_152 = iStdDev(NULL, 0, 20, 0, MODE_EMA, PRICE_CLOSE, 1);
     double l_iwpr_160 = iWPR(NULL, 0, 26, 0);
     double l_iwpr_168 = iWPR(NULL, 0, 26, 1);
     double l_iwpr_176 = iWPR(NULL, 0, 26, 2);
     double l_idemarker_184 = iDeMarker(NULL, 0, 13, 0);
     double l_idemarker_192 = iDeMarker(NULL, 0, 13, 1);
     double l_istochastic_200 = iStochastic(NULL, 0, 15, 6, 7, MODE_EMA, 0, MODE_MAIN, 0);
     double l_istochastic_208 = iStochastic(NULL, 0, 15, 6, 7, MODE_EMA, 0, MODE_MAIN, 1);
     double l_istochastic_216 = iStochastic(NULL, 0, 15, 6, 7, MODE_EMA, 0, MODE_SIGNAL, 0);
     double l_istochastic_224 = iStochastic(NULL, 0, 15, 6, 7, MODE_EMA, 0, MODE_SIGNAL, 1);
     if (l_istochastic_208 < l_istochastic_224 - 5.0 && l_istochastic_200 >= l_istochastic_216) li_8 = TRUE;
     if (l_istochastic_208 > l_istochastic_224 + 5.0 && l_istochastic_200  l_istochastic_224 && l_istochastic_200 > l_istochastic_216) li_16 = TRUE;
     if (l_istochastic_208 < l_istochastic_224 && l_istochastic_200 < l_istochastic_216) li_20 = TRUE;
     double l_istochastic_232 = iStochastic(NULL, 0, 10, 5, 5, MODE_SMA, 0, MODE_MAIN, 0);
     double l_istochastic_240 = iStochastic(NULL, 0, 10, 5, 5, MODE_SMA, 0, MODE_MAIN, 1);
     double l_istochastic_248 = iStochastic(NULL, 0, 10, 5, 5, MODE_SMA, 0, MODE_SIGNAL, 0);
     double l_istochastic_256 = iStochastic(NULL, 0, 10, 5, 5, MODE_SMA, 0, MODE_SIGNAL, 1);
     if (l_istochastic_240 < l_istochastic_256 && l_istochastic_232 >= l_istochastic_248) li_24 = TRUE;
     if (l_istochastic_240 > l_istochastic_256 && l_istochastic_232  l_istochastic_256 && l_istochastic_232 > l_istochastic_248) li_32 = TRUE;
     if (l_istochastic_240 < l_istochastic_256 && l_istochastic_232 < l_istochastic_248) li_36 = TRUE;
     
   
     
     double ld_264 = AccountBalance();
     double l_price_272 = 150;
     if (l_price_272  l_iwpr_168 + 9.0 && l_istochastic_232 > l_istochastic_240 && li_32) || (l_iwpr_160 > l_iwpr_168 + 18.0 && l_istochastic_200 > l_istochastic_208 &&
           li_16) && l_iwpr_160 < -15.0 && l_idemarker_184 > l_idemarker_192 && l_ima_104 > l_ima_88 && l_ima_72 > l_ima_88) || (l_istochastic_200 < 40.0 && Open[1] > l_ima_64 &&
           l_ima_96 < l_ima_120) || (l_istochastic_240 < 40.0 && l_ima_72 > l_ima_88 && l_ima_112 > l_ima_104) || (Open[1] < Close[1] && Open[0] > Close[1] && li_16 && l_iwpr_160 > l_iwpr_168 + 7.0 && l_idemarker_184 > l_idemarker_192 + 0.1)) {
           if (l_price_272 > 0.0) l_price_272 = Ask - 160 * Point;
           l_ticket_0 = OrderSend(Symbol(), OP_BUY, lots, Ask, 3, l_price_272, Ask + 0.03, "Magic Scalper", MagicNo, 0, Green);
           if (l_ticket_0 > 0) {
              if (OrderSelect(l_ticket_0, SELECT_BY_TICKET, MODE_TRADES)) Print("BUY order opened : ", OrderOpenPrice());
           } else Print("Error opening BUY order : ", GetLastError());
           return (0);
        }
        if ((l_ima_128 > l_ima_136 && l_ima_72 > l_ima_88 + 0.0002 && Open[0]  l_istochastic_240 && l_istochastic_248 > l_istochastic_256) ||
           (l_istochastic_200 > l_istochastic_208 && l_istochastic_216 > l_istochastic_224) && l_iwpr_160 < -15.0 && l_iwpr_160 > l_iwpr_168 + 3.0 && li_16 && l_ima_96 > l_ima_72 && Open[0] > l_ima_128) ||
           (l_ima_128 > l_ima_136 && l_ima_96 > l_ima_104 && l_ima_72 > l_ima_88 && l_ima_72 > l_ima_80 + 0.0005 && l_ima_96 - l_ima_104 > l_ima_72 - l_ima_88 && l_ima_128 - l_ima_72 > l_ima_136 - l_ima_88 &&
           li_16 && l_iwpr_160 < -15.0 && l_iwpr_160 > l_iwpr_168 + 15.0 && l_ima_128 > l_ima_96 && l_ima_96 > l_ima_72 && Open[0] > l_ima_128) || (li_24 && l_istochastic_240 < 25.0 && l_ima_72 > l_ima_88 + 0.0002 && l_ima_112 > l_ima_104) ||
           (li_8 && l_istochastic_200 < 30.0 && Open[1] > l_ima_64 && Close[1] > l_ima_120 && Open[0] > l_ima_40 && l_ima_96 < l_ima_120) || (li_8 && Open[1] > l_ima_64 && Open[0] > l_ima_40 &&
           Open[1] < Close[1] && l_iwpr_160 > l_iwpr_168 + 7.0 && l_idemarker_184 > l_idemarker_192 + 0.08 && l_istddev_144 > l_istddev_152)) {
           if (l_price_272 > 0.0) l_price_272 = Ask - 160 * Point;
           l_ticket_0 = OrderSend(Symbol(), OP_BUY, lots, Ask, 3, l_price_272, Ask + 30 * Point, "Magic Scalper", MagicNo, 0, Green);
           if (l_ticket_0 > 0) {
              if (OrderSelect(l_ticket_0, SELECT_BY_TICKET, MODE_TRADES)) Print("BUY order opened : ", OrderOpenPrice());
           } else Print("Error opening BUY order : ", GetLastError());
           return (0);
        }
        if (Predict() == 2.0 && ((l_iwpr_160 < l_iwpr_168 - 9.0 && l_istochastic_232 < l_istochastic_240 && li_36) || (l_iwpr_160 < l_iwpr_168 - 18.0 && l_istochastic_200 < l_istochastic_208 &&
           li_20) && l_iwpr_160 > -85.0 && l_idemarker_184 < l_idemarker_192 && l_ima_104 < l_ima_88 && l_ima_72 < l_ima_88) || (l_istochastic_200 > 60.0 && Open[1] < l_ima_48 &&
           l_ima_96 > l_ima_120) || (l_istochastic_240 > 60.0 && l_ima_72 < l_ima_88 && l_ima_112 < l_ima_104) || (Open[1] > Close[1] && Open[0] < Close[1] && li_20 && l_iwpr_160 < l_iwpr_168 - 7.0 && l_idemarker_184 < l_idemarker_192 - 0.1)) {
           if (l_price_272 > 0.0) l_price_272 = Bid + 160 * Point;
           l_ticket_0 = OrderSend(Symbol(), OP_SELL, lots, Bid, 3, l_price_272, Bid - 0.03, "Magic Scalper Pro", MagicNo, 0, Red);
           if (l_ticket_0 > 0) {
              if (OrderSelect(l_ticket_0, SELECT_BY_TICKET, MODE_TRADES)) Print("SELL order opened : ", OrderOpenPrice());
           } else Print("Error opening SELL order : ", GetLastError());
           return (0);
        }
        if ((l_ima_128 < l_ima_136 && l_ima_72 < l_ima_88 - 0.0002 && Open[0] >= l_ima_72 - l_istddev_144 && (l_istochastic_232 < l_istochastic_240 && l_istochastic_248 < l_istochastic_256) ||
           (l_istochastic_200 < l_istochastic_208 && l_istochastic_216 < l_istochastic_224) && l_iwpr_160 > -85.0 && l_iwpr_160 < l_iwpr_168 - 3.0 && li_20 && l_ima_96 < l_ima_72 && Open[0] < l_ima_128) ||
           (l_ima_128 < l_ima_136 && l_ima_96 < l_ima_104 && l_ima_72 < l_ima_88 && l_ima_72 < l_ima_80 - 0.0005 && l_ima_104 - l_ima_96 > l_ima_88 - l_ima_72 && l_ima_72 - l_ima_128 > l_ima_88 - l_ima_136 &&
           li_20 && l_iwpr_160 > -85.0 && l_iwpr_160 < l_iwpr_168 - 15.0 && l_ima_128 < l_ima_96 && l_ima_96 < l_ima_72 && Open[0] < l_ima_128) || (li_28 && l_istochastic_240 > 75.0 && l_ima_72 < l_ima_88 - 0.0002 && l_ima_112 < l_ima_104) ||
           (li_12 && l_istochastic_200 > 70.0 && Open[1] < l_ima_48 && Close[1] < l_ima_120 && Open[0] < l_ima_56 && l_ima_96 > l_ima_120) || (li_12 && Open[1] < l_ima_48 && Open[0] < l_ima_56 &&
           Open[1] > Close[1] && l_iwpr_160 < l_iwpr_168 - 7.0 && l_idemarker_184 < l_idemarker_192 - 0.08 && l_istddev_144 > l_istddev_152)) {
           if (l_price_272 > 0.0) l_price_272 = Bid + 160 * Point;
           l_ticket_0 = OrderSend(Symbol(), OP_SELL, lots, Bid, 3, l_price_272, Bid - 30 * Point, "Magic Scalper Pro", MagicNo, 0, Red);
           if (l_ticket_0 > 0) {
              if (OrderSelect(l_ticket_0, SELECT_BY_TICKET, MODE_TRADES)) Print("SELL order opened : ", OrderOpenPrice());
           } else Print("Error opening SELL order : ", GetLastError());
           return (0);
        }
        return (0);
     }
  
               
            
           }
  
  
  
  
  上一次单是亏损的话,就加1手!麻烦你!
打赏