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

智能交易系统 eu_15m_Lucky5_Hao Liao EA



eu_15m_Lucky5_Hao Liao EA根据均线及CCI信号进行超短交易。从名称上面就能看出交易周期为欧美15分钟图表。

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

//+------------------------------------------------------------------+
//|                                       eu_15m_Lucky5_Hao Liao.mq4 |
//|                                                Copyright Aitrade |
//+------------------------------------------------------------------+
#property copyright "Aitrade"
#property link      "www.Aitrader.org"

extern int MAGIC = 20090725;
extern double MinLot = 0.1;
double gd_88 = 9999.0;
extern double Lots = 1.0;
extern double LotsPercent = 0.5;
extern int MaxTradesPerSymbol = 3;
int g_slippage_116 = 2;
int gi_120 = 10;
double g_period_124 = 14.0;
extern double MAp1 = 68.0;
extern double MAp2 = 226.0;
extern double MAp3 = 588.0;
extern double k2 = 0.47;
extern double k3 = 0.26;
extern double ccilmt = 130.0;
extern double SL = 194.0;
extern double TP = 107.0;
extern int dp = 14;
extern int dpstp = 22;
int gi_204 = 0;

int init() {
   HideTestIndicators(TRUE);
   return (0);
}

void deinit() {
   Comment("www.125808047.com");
}

int start() {
   int li_88;
   int l_ticket_92;
   if (Time[0] == gi_204) return (0);
   gi_204 = Time[0];

   double l_point_0 = Point;
   double l_icci_8 = iCCI(NULL, 0, g_period_124, PRICE_CLOSE, 0);
   double l_icci_16 = iCCI(NULL, 0, 14, PRICE_CLOSE, 1);
   double l_ima_24 = iMA(NULL, 0, MAp1, 0, MODE_SMA, PRICE_MEDIAN, 0);
   double l_ima_32 = iMA(NULL, 0, MAp1, 0, MODE_SMA, PRICE_MEDIAN, 1);
   double l_ima_40 = iMA(NULL, 0, MAp2, 0, MODE_SMA, PRICE_MEDIAN, 0);
   double l_ima_48 = iMA(NULL, 0, MAp2, 0, MODE_SMA, PRICE_MEDIAN, 1);
   double l_ima_56 = iMA(NULL, 0, MAp3, 0, MODE_SMA, PRICE_MEDIAN, 0);
   double l_ima_64 = iMA(NULL, 0, MAp3, 0, MODE_SMA, PRICE_MEDIAN, 1);
   int l_count_72 = 0;
   double l_ord_open_price_76 = 0;
   for (int l_pos_84 = 0; l_pos_84 < OrdersTotal(); l_pos_84++) {
      if (OrderSelect(l_pos_84, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderMagicNumber() == MAGIC) {
            if (StringFind(OrderSymbol(), Symbol(), 0) != -1) {
               l_count_72++;
               l_ord_open_price_76 = OrderOpenPrice();
               if (OrderType() == OP_BUY && l_icci_16 > ccilmt && l_icci_8 < l_icci_16 && Bid - l_ima_24 > dpstp * l_point_0) {
                  bool cg = OrderClose(OrderTicket(), OrderLots(), Bid, g_slippage_116, DodgerBlue);
                  return (0);
               }
               if (OrderType() == OP_SELL && l_icci_16 < (-ccilmt) && l_icci_8 > l_icci_16 && Ask - l_ima_24 < (-dpstp) * l_point_0) {
                  cg = OrderClose(OrderTicket(), OrderLots(), Ask, g_slippage_116, DodgerBlue);
                  return (0);
               }
            }
         }
      }
   }
   if (l_count_72 < MaxTradesPerSymbol) {
      if (LotsPercent > 0.0) {
         if (MinLot == 0.1) li_88 = 1;
         if (MinLot == 0.01) li_88 = 2;
         Lots = NormalizeDouble(MathCeil(AccountFreeMargin() * LotsPercent / 100.0) / 100.0, li_88);
      } else Lots = Lots;
      if (Lots < MinLot) Lots = MinLot;
      if (Lots > gd_88) Lots = gd_88;
      l_ticket_92 = -10;
      if ((l_ima_40 - l_ima_48 > k2 * l_point_0 && l_ima_56 - l_ima_64 > k3 * l_point_0 && l_ima_24 > l_ima_40 && l_icci_16 < (-ccilmt) && l_icci_8 > l_icci_16 && Ask - l_ima_24 < (-dp) * l_point_0 &&
         l_ord_open_price_76 == 0.0) || Ask - l_ord_open_price_76 < (-gi_120) * l_point_0) {
         l_ticket_92 = OrderSend(Symbol(), OP_BUY, Lots, Ask, g_slippage_116, Ask - SL * l_point_0, Ask + TP * l_point_0, "Lucky5@fxautotrade", MAGIC, 0, Green);
         if (l_ticket_92 < 0) Print("buy",GetLastError());
      }
      if ((l_ima_40 - l_ima_48 < (-k2) * l_point_0 && l_ima_56 - l_ima_64 < (-k3) * l_point_0 && l_ima_24 < l_ima_40 && l_icci_16 > ccilmt && l_icci_8 < l_icci_16 && Bid - l_ima_24 > dp * l_point_0 &&
         l_ord_open_price_76 == 0.0) || Bid - l_ord_open_price_76 > gi_120 * l_point_0) {
         l_ticket_92 = OrderSend(Symbol(), OP_SELL, Lots, Bid, g_slippage_116, Bid + SL * l_point_0, Bid - TP * l_point_0, "Lucky5@fxautotrade", MAGIC, 0, Red);
         if (l_ticket_92 > 0) Print("sell",GetLastError());
      }
   }
   return (0);
}

 

如您喜欢此文章请点下面分享按钮↴峰汇在线 » 智能交易系统 eu_15m_Lucky5_Hao Liao EA
上一篇:
下一篇:
分享到:更多 ()