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

Progressive Scalper_v.2.821 EA



Progressive Scalper_v.2.821 EA可以设定同一信号发生时的最大开仓数量,在某些行情下也能够获得可观的利润。

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

 //+------------------------------------------------------------------+
//|                                   Progressive Scalper_v.2.821.mq4 |
//|                                                    WWW.SCALPER.RU |
//+------------------------------------------------------------------+
#property copyright "WWW.SCALPER.RU"
#property link      "http://www.125808047.com/"

extern int StopLoss = 74;
extern int TakeProfit = 14;
extern double Slippage = 5.0;
double gd_92 = 0.21;
extern int MaximumTrades = 4;
extern int TakePips = 9;
extern bool FixLotMM = FALSE;
extern double FixLotSize = 0.1;
extern double RiskPercent = 10.0;
extern int MA_Period = 32;
int gi_132 = 1;
extern double DeltaMA = 2.04;
extern string Comm = "Progressive Scalper";
bool gi_152 = TRUE;
double g_maxlot_156;
double g_minlot_164;
double g_lotstep_172;
double gd_180;
double g_price_188;
double g_price_196;
double gd_204;
double g_lots_212;
double g_ord_open_price_220;
int g_count_228;
int gi_232;
int g_pos_236;
int g_ticket_240;
int g_magic_244;
int gi_unused_248;
double gd_252 = 0.0;
bool gi_260 = TRUE;
double gd_264 = 0.0;
double g_ord_lots_272 = 0.0;
bool cg = False;
 

 
double setpoint() {
   double ld_ret_0;
   if (Digits <= 3) ld_ret_0 = 0.01;
   else ld_ret_0 = 0.0001;
   return (ld_ret_0);
}

int init() {
   gi_unused_248 = 0;
   g_magic_244 = 123456;
   g_maxlot_156 = MarketInfo(Symbol(), MODE_MAXLOT);
   g_minlot_164 = MarketInfo(Symbol(), MODE_MINLOT);
   g_lotstep_172 = MarketInfo(Symbol(), MODE_LOTSTEP);
   HideTestIndicators(TRUE);
   return (0);
}

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

int start() {
   string ls_0;
   if (gi_152) {
      ls_0 = "峰汇在线www.125808047.com";
      Comment(ls_0);
   }
 
   bool li_8 = FALSE;
   if (!IsTradeAllowed()) {
      Comment("峰汇在线www.125808047.com");
      return (0);
   }
   Comment("");
   if (FixLotMM) gd_204 = FixLotSize;
   else gd_204 = AccountFreeMargin() / 1000.0 * (RiskPercent / 100.0);
   if (gd_204 < g_minlot_164) gd_204 = g_minlot_164;
   else {
      if (gd_204 > g_maxlot_156) gd_204 = g_maxlot_156;
      else {
         for (gd_180 = g_minlot_164; gd_180 <= gd_204; gd_180 += g_lotstep_172) {
         }
         gd_204 = gd_180 - g_lotstep_172;
      }
   }
   g_count_228 = 0;
   for (g_pos_236 = 0; g_pos_236 < OrdersTotal(); g_pos_236++) {
      cg = OrderSelect(g_pos_236, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_244) g_count_228++;
   }
   if (AccountEquity() > AccountBalance() + AccountBalance() / 10.0) {
      if (g_count_228 > 2) {
         for (g_pos_236 = OrdersTotal() - 1; g_pos_236 >= 0; g_pos_236--) {
            cg = OrderSelect(g_pos_236, SELECT_BY_POS);
            if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_244) cg = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), Slippage, CLR_NONE);
         }
      }
   }
   if (gi_232 > g_count_228) {
      for (g_pos_236 = OrdersTotal() - 1; g_pos_236 >= 0; g_pos_236--) {
         cg = OrderSelect(g_pos_236, SELECT_BY_POS);
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_244) cg = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), Slippage, CLR_NONE);
      }
      g_count_228 = 0;
   }
   gi_232 = g_count_228;
   if (g_count_228 >= MaximumTrades) gi_260 = FALSE;
   else gi_260 = TRUE;
   double l_ima_12 = iMA(NULL, PERIOD_M15, MA_Period, 0, MODE_SMA, PRICE_TYPICAL, gi_132 + 0);
   double l_ima_20 = iMA(NULL, PERIOD_M15, MA_Period, 0, MODE_SMA, PRICE_TYPICAL, gi_132 + 1);
   if (MathAbs(l_ima_12 - l_ima_20) / setpoint() > DeltaMA) li_8 = TRUE;
   if (g_count_228 < 1) {
      gd_252 = 0;
      if (li_8 == TRUE && l_ima_12 < l_ima_20) {
         g_ord_open_price_220 = 0;
         gd_252 = 1;
      }
      if (li_8 == TRUE && l_ima_12 > l_ima_20) {
         g_ord_open_price_220 = 0;
         gd_252 = 2;
      }
   }
   g_ticket_240 = 0;
   gd_264 = 0;
   g_ord_lots_272 = 0;
   for (g_pos_236 = 0; g_pos_236 < OrdersTotal(); g_pos_236++) {
      cg = OrderSelect(g_pos_236, SELECT_BY_POS);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_244) {
         g_ord_open_price_220 = OrderOpenPrice();
         if (OrderType() == OP_BUY) gd_252 = 2;
         if (OrderType() == OP_SELL) gd_252 = 1;
         g_ticket_240 = OrderTicket();
         gd_264 = OrderClosePrice();
         g_ord_lots_272 = OrderLots();
      }
   }
   if (gd_252 == 1.0 && gi_260) {
      if (Bid - g_ord_open_price_220 >= TakePips * setpoint() || g_count_228 < 1) {
         g_ord_open_price_220 = 0;
         if (TakeProfit == 0) g_price_196 = 0;
         else g_price_196 = Bid - TakeProfit * setpoint();
         if (StopLoss == 0) g_price_188 = 0;
         else g_price_188 = Bid + StopLoss * setpoint();
         if (g_count_228 != 0) {
            g_lots_212 = gd_204;
            for (g_pos_236 = 0; g_pos_236 < g_count_228; g_pos_236++) {
               if (MaximumTrades > 12) g_lots_212 = 1.5 * g_lots_212;
               else g_lots_212 = 2.0 * g_lots_212;
            }
         } else g_lots_212 = gd_204;
         if (g_count_228 == 0) g_lots_212 = 0.05 * g_lots_212;
         if (g_count_228 == 2) {
            gd_92 = 1;
            g_lots_212 = NormalizeDouble(AccountFreeMargin() / (10.0 * (1000.0 * gd_92)), 1);
         }
         if (g_count_228 == 3) {
            gd_92 = 1.6;
            g_lots_212 = NormalizeDouble(AccountFreeMargin() / (10.0 * (1000.0 * gd_92)), 1);
         }
         if (g_lots_212 < g_minlot_164) g_lots_212 = g_minlot_164;
         else {
            if (g_lots_212 > g_maxlot_156) g_lots_212 = g_maxlot_156;
            else {
               for (gd_180 = g_minlot_164; gd_180 <= g_lots_212; gd_180 += g_lotstep_172) {
               }
               g_lots_212 = gd_180 - g_lotstep_172;
            }
         }
         cg = OrderSend(Symbol(), OP_SELL, g_lots_212, Bid, Slippage, g_price_188, g_price_196, Comm, g_magic_244, 0, Red);
         return (0);
      }
   }
   if (gd_252 == 2.0 && gi_260) {
      if (g_ord_open_price_220 - Ask >= TakePips * setpoint() || g_count_228 < 1) {
         g_ord_open_price_220 = 0;
         if (TakeProfit == 0) g_price_196 = 0;
         else g_price_196 = Ask + TakeProfit * setpoint();
         if (StopLoss == 0) g_price_188 = 0;
         else g_price_188 = Ask - StopLoss * setpoint();
         if (g_count_228 != 0) {
            g_lots_212 = gd_204;
            for (g_pos_236 = 0; g_pos_236 < g_count_228; g_pos_236++) {
               if (MaximumTrades > 12) g_lots_212 = 1.5 * g_lots_212;
               else g_lots_212 = 2.0 * g_lots_212;
            }
         } else g_lots_212 = gd_204;
         if (g_count_228 == 0) g_lots_212 = 0.05 * g_lots_212;
         if (g_count_228 == 2) {
            gd_92 = 1;
            g_lots_212 = NormalizeDouble(AccountFreeMargin() / (10.0 * (1000.0 * gd_92)), 1);
         }
         if (g_count_228 == 3) {
            gd_92 = 1.6;
            g_lots_212 = NormalizeDouble(AccountFreeMargin() / (10.0 * (1000.0 * gd_92)), 1);
         }
         if (g_lots_212 < g_minlot_164) g_lots_212 = g_minlot_164;
         else {
            if (g_lots_212 > g_maxlot_156) g_lots_212 = g_maxlot_156;
            else {
               for (gd_180 = g_minlot_164; gd_180 <= g_lots_212; gd_180 += g_lotstep_172) {
               }
               g_lots_212 = gd_180 - g_lotstep_172;
            }
         }
         cg = OrderSend(Symbol(), OP_BUY, g_lots_212, Ask, Slippage, g_price_188, g_price_196, Comm, g_magic_244, 0, Blue);
         return (0);
      }
   }
   return (0);
}

 

如您喜欢此文章请点下面分享按钮↴峰汇在线 » Progressive Scalper_v.2.821 EA
上一篇:
下一篇:
分享到:更多 ()