有您的持续关注
我们会做得更好

终极动态趋势网格EA



网格类型的EA都需要大资金支持轻仓跑,而且都有死亡图,在死亡之前能赚多少利润也只能看造化了。

本网收集整理智能交易EA仅为MQL4编程爱好者提供语法及相关编程技巧的学习研究之用,智能交易存在极高的风险测试请用模拟盘,请勿用于实盘。终极动态趋势网格EA源码如下:

//+------------------------------------------------------------------+
//|                                           终极动态趋势网格EA.mq4 |
//|                                     Copyright 2016, QQ:125808047 |
//+------------------------------------------------------------------+
#property copyright "峰汇在线 QQ:125808047" 
#property link"http://www.125808047.com/"

extern double lots = 0.1;
extern int profitDot = 15;

int init() {
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   double ima_16;
   double ima_24;
   double ima_32;
   double ima_40;
   double order_lots_56;
   int order_total_64;
   double order_open_price_68;
   double order_open_price_76;
   int li_84;
   int li_0 = 1;
   int period_4 = 1;
   int period_8 = 5;
   int li_12 = -1055241112;
      ima_16 = iMA(NULL, PERIOD_M5, period_4, 0, MODE_SMA, PRICE_CLOSE, li_0);
      ima_24 = iMA(NULL, PERIOD_M5, period_8, 0, MODE_SMA, PRICE_CLOSE, li_0);
      ima_32 = iMA(NULL, PERIOD_M5, period_4, 0, MODE_SMA, PRICE_CLOSE, li_0 + 1);
      ima_40 = iMA(NULL, PERIOD_M5, period_8, 0, MODE_SMA, PRICE_CLOSE, li_0 + 1);
      order_lots_56 = 0;
      order_total_64 = OrdersTotal();
      if (order_total_64 < 1) {
         bool cg = OrderSend(Symbol(), OP_SELL, lots, Bid, 2, 0, 0);
         cg = OrderSend(Symbol(), OP_BUY, lots, Ask, 2, 0, 0);
         for (int li_52 = 1; li_52 <= 5; li_52++) {
            cg = OrderSend(Symbol(), OP_BUYLIMIT, lots, Bid - profitDot * li_52 * Point, 2, 0, 0);
            cg = OrderSend(Symbol(), OP_SELLLIMIT, lots, Ask + profitDot * li_52 * Point, 2, 0, 0);
            cg = OrderSend(Symbol(), OP_BUYSTOP, lots, Bid + profitDot * li_52 * Point, 2, 0, 0);
            cg = OrderSend(Symbol(), OP_SELLSTOP, lots, Ask - profitDot * li_52 * Point, 2, 0, 0);
         }
     }
      order_total_64 = OrdersTotal();
      order_open_price_68 = 0;
      order_open_price_76 = 1000;
      for (int pos_48 = 0; pos_48 < order_total_64; pos_48++) {
         cg = OrderSelect(pos_48, SELECT_BY_POS);
         if (OrderType() <= OP_SELL && OrderSymbol() == Symbol()) if (OrderLots() > order_lots_56) 
order_lots_56 = OrderLots();
      }
      if (5.0 * lots >= order_lots_56) {
         for (pos_48 = 0; pos_48 < order_total_64; pos_48++) { cg = OrderSelect(pos_48, SELECT_BY_POS);
 if (OrderOpenPrice() > order_open_price_68) order_open_price_68 = OrderOpenPrice();
            if (OrderOpenPrice() < order_open_price_76) order_open_price_76 = OrderOpenPrice(); 
if (ima_16 > ima_24 && ima_32 <= ima_40) {
               if (OrderType() <= OP_SELL && OrderSymbol() == Symbol()) { if (OrderType() == OP_BUY) 
{ if (Bid - OrderOpenPrice() >= profitDot * Point) {
                        if (OrderClose(OrderTicket(), OrderLots(), Bid, 1)) {
                           Alert("金叉获利");
                           cg = OrderSend(Symbol(), OP_BUYLIMIT, lots, OrderOpenPrice(), 2, 0, 0);
                        }
                     }
                  }
                  if (OrderType() == OP_SELL) {
                     if (OrderOpenPrice() - Ask >= profitDot * Point) {
                        if (OrderClose(OrderTicket(), OrderLots(), Ask, 1)) {
                           Alert("金叉获利");
                           cg = OrderSend(Symbol(), OP_SELLLIMIT, lots, OrderOpenPrice(), 2, 0, 0);
                        }
                     }
                  }
               }
            } else {
               if (ima_16 < ima_24 && ima_32 >= ima_40) {
                  if (OrderType() <= OP_SELL && OrderSymbol() == Symbol()) { if (OrderType() == OP_BUY) 
{ if (Bid - OrderOpenPrice() >= profitDot * Point) {
                           if (OrderClose(OrderTicket(), OrderLots(), Bid, 1)) {
                              Alert("死叉获利");
                              cg = OrderSend(Symbol(), OP_BUYLIMIT, lots, OrderOpenPrice(), 2, 0, 0);
                           }
                        }
                     }
                     if (OrderType() == OP_SELL) {
                        if (OrderOpenPrice() - Ask >= profitDot * Point) {
                           if (OrderClose(OrderTicket(), OrderLots(), Ask, 1)) {
                              Alert("死叉获利");
                              cg = OrderSend(Symbol(), OP_SELLLIMIT, lots, OrderOpenPrice(), 2, 0, 0);
                           }
                        }
                     }
                  }
               }
            }
         }
      }
      li_84 = (order_open_price_68 - Ask) / (profitDot * Point);
      li_84 /= 1;
      if (li_84 < 5) {
         for (pos_48 = 1; pos_48 <= 5 - li_84; pos_48++) {
      cg = OrderSend(Symbol(), OP_SELLLIMIT, lots, order_open_price_68 + pos_48 * profitDot * Point, 2, 0, 0);
       cg = OrderSend(Symbol(), OP_BUYSTOP, lots, order_open_price_68 + pos_48 * profitDot * Point - (Ask - Bid), 
2, 0, 0);
         }
      }
      li_84 = (Bid - order_open_price_76) / (profitDot * Point);
      li_84 /= 1;
      if (li_84 < 5) {
         for (pos_48 = 1; pos_48 <= 5 - li_84; pos_48++) {
            cg = OrderSend(Symbol(), OP_BUYLIMIT, lots, order_open_price_76 - pos_48 * profitDot * Point, 2, 0, 0);
            cg = OrderSend(Symbol(), OP_SELLSTOP, lots, order_open_price_76 - pos_48 * profitDot * Point +
 (Ask - Bid), 2, 0, 0);
         }
      }
         return (0);
   }

如您喜欢此文章请点下面分享按钮↴峰汇在线 » 终极动态趋势网格EA
上一篇:
下一篇:
分享到:更多 ()