Navigation:Home > Content >

Ea_iFxJambi_V4_LexLmod_Build_830.mq4

Time: 2016-01-08 | Download file:Ea_iFxJambi_V4_LexLmod_Build_830.mq4

#property copyright "Copyright © 2012, www.ifxjambi.com"
#property link      "http://www.ifxjambi.com"
#property strict

bool Gi_80 = FALSE;
bool Gi_84 = TRUE;
extern string q1;                //************************************************************      
int    Gi_76 = 1;         //Если 0 - Постоянный лот, 1- исп. шаг увелич.лота 2 - ...
extern double Gd_88 = 2.0;       //Шаг увеличения лота при выставлении следующего колена
extern double Lots = 0.01;       //Лот
extern double G_pips_120 = 10.0; //Тейк профит
extern double G_pips_128 = 0.0;  //Стоп лосс
extern string q2;                //************************************************************      
extern bool Gi_176 = FALSE;      //Использовать Тралл
extern double Gd_136 = 20.0;     //Трейлинг стоп
extern double Gd_144 = 5.0;      //Дистанция тралла до цены
extern string q3;                //************************************************************      
extern double G_pips_152 = 5.0;  //Шаг между ордерами
extern int MaxTrades = 10;       //Максимальное количество ордеров
extern int G_slippage_96 = 3;    //Проскальзывание
extern string q4;                //************************************************************      
extern bool Gi_164 = TRUE;       //Мани Менеджмент
extern double TotalEquityRisk = 19.0;//Риск в %
extern string q5;                //************************************************************      
extern bool Gi_180 = FALSE;      //Закрывать ордера по истечении времени
extern double MaxTradeOpenHours = 1000.0;//Через сколько часов закрыть сетку ордеров
extern string q6;                //************************************************************      
extern bool   PrPoint = False;   //Если сетка не выставлена, закрыть 1-й ордер если он в профите
extern int    ProfitPoint  = 5;  //Сколько пунктов до профита
extern string q7;                //************************************************************      
extern bool Gi_192 = FALSE;      //Торговля по времени
extern int Gi_196 = 2;           //Начало торговли
extern int Gi_200 = 16;          //Конец торговли 
extern int G_magic_204 = 9999;   //Магический номер
int Gd_112 = Digits;
double G_price_208;
double Gd_216;
double Gd_unused_224;
double Gd_unused_232;
double G_price_240;
double G_bid_248;
double G_ask_256;
double Gd_264;
double Gd_272;
double Gd_280;
bool Gi_288;
extern string Creator = "www.ifxjambi.com";
extern string Modifator = "LexLampardMod";
datetime G_time_308 = 0;
double Gi_312;
int Gi_316 = 0;
double Gd_320;
int G_pos_328 = 0;
int Gi_332;
double Gd_336 = 0.0;
bool Gi_344 = FALSE;
bool Gi_348 = FALSE;
bool Gi_352 = FALSE;
int Gi_356;
bool Gi_360 = FALSE;
datetime G_datetime_364 = 0;
datetime G_datetime_368 = 0;
double Gd_372;
double Gd_380;
bool orderr = true;

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   Gd_280 = MarketInfo(Symbol(), MODE_SPREAD) * Point;
   if(Digits == 5 || Digits == 3)
     {
      G_pips_120      = G_pips_120     * 10;
      G_pips_128      = G_pips_128     * 10;
      Gd_136          = Gd_136         * 10;
      Gd_144          = Gd_144         * 10;
      G_pips_152      = G_pips_152     * 10;
      G_slippage_96   = G_slippage_96  * 10;
      ProfitPoint     = ProfitPoint    * 10;
     } 
   if (IsTesting() == TRUE) f0_8();
   if (IsTesting() == FALSE) f0_8();
   return (0);
}

// 52D46093050F38C27267BCE42543EF60
int deinit() {
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   double order_lots_0 = 0;
   double order_lots_8 = 0;
   double iclose_16;
   double iclose_24;
   string Ls_32 = "false";
   string Ls_40 = "false";
   if (PrPoint)CloseProfitNow();
   if (Gi_192 == FALSE || ((Gi_192 && Gi_200 > Gi_196 && (Hour() >= Gi_196 && Hour() <= Gi_200)) || (Gi_196 > Gi_200 && (Hour() >= Gi_200 && Hour() <= Gi_196)))) Ls_32 = "true";
   if ((Gi_192 && Gi_200 > Gi_196 && (Hour() >= Gi_196 && Hour() <= Gi_200)) || (Gi_196 > Gi_200 && (Hour() >= Gi_200 && Hour() <= Gi_196))) Ls_40 = "true";
   if (Gi_176) f0_15(Gd_136, Gd_144, G_price_240);
   if (Gi_180) {
      if (TimeCurrent() >= Gi_312) {
         f0_3();
         Print("Closed All due to TimeOut");
      }
   }
   if (G_time_308 == Time[0]) return (0);
   G_time_308 = Time[0];
   double Ld_48 = f0_5();
   if (Gi_164) {
      if (Ld_48 < 0.0 && MathAbs(Ld_48) > TotalEquityRisk / 100.0 * f0_7()) {
         f0_3();
         Print("Closed All due to Stop Out");
         Gi_360 = FALSE;
      }
   }
   Gi_332 = f0_13();
   if (Gi_332 == 0) Gi_288 = FALSE;
   for (G_pos_328 = OrdersTotal() - 1; G_pos_328 >= 0; G_pos_328--) {
      orderr = OrderSelect(G_pos_328, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_204) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204) {
         if (OrderType() == OP_BUY) {
            Gi_348 = TRUE;
            Gi_352 = FALSE;
            order_lots_0 = OrderLots();
            break;
         }
      }
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204) {
         if (OrderType() == OP_SELL) {
            Gi_348 = FALSE;
            Gi_352 = TRUE;
            order_lots_8 = OrderLots();
            break;
         }
      }
   }
   if (Gi_332 > 0 && Gi_332 <= MaxTrades) {
      RefreshRates();
      Gd_264 = f0_2();
      Gd_272 = f0_6();
      if (Gi_348 && Gd_264 - Ask >= G_pips_152 * Point) Gi_344 = TRUE;
      if (Gi_352 && Bid - Gd_272 >= G_pips_152 * Point) Gi_344 = TRUE;
   }
   if (Gi_332 < 1) {
      Gi_352 = FALSE;
      Gi_348 = FALSE;
      Gi_344 = TRUE;
      Gd_216 = AccountEquity();
   }
   if (Gi_344) {
      Gd_264 = f0_2();
      Gd_272 = f0_6();
      if (Gi_352) {
         if (Gi_80 || Ls_40 == "true") {
            f0_1(0, 1);
            Gd_320 = NormalizeDouble(Gd_88 * order_lots_8, Gd_112);
         } else Gd_320 = f0_11(OP_SELL);
         if (Gi_84 && Ls_32 == "true") {
            Gi_316 = Gi_332;
            if (Gd_320 > 0.0) {
               RefreshRates();
               Gi_356 = f0_12(1, Gd_320, Bid, G_slippage_96, Ask, 0, 0, Creator + "-" + IntegerToString(Gi_316,Digits), G_magic_204, 0, HotPink);
               if (Gi_356 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               Gd_272 = f0_6();
               Gi_344 = FALSE;
               Gi_360 = TRUE;
            }
         }
      } else {
         if (Gi_348) {
            if (Gi_80 || Ls_40 == "true") {
               f0_1(1, 0);
               Gd_320 = NormalizeDouble(Gd_88 * order_lots_0, Gd_112);
            } else Gd_320 = f0_11(OP_BUY);
            if (Gi_84 && Ls_32 == "true") {
               Gi_316 = Gi_332;
               if (Gd_320 > 0.0) {
                  Gi_356 = f0_12(0, Gd_320, Ask, G_slippage_96, Bid, 0, 0, Creator + "-" + IntegerToString(Gi_316,Digits), G_magic_204, 0, Lime);
                  if (Gi_356 < 0) {
                     Print("Error: ", GetLastError());
                     return (0);
                  }
                  Gd_264 = f0_2();
                  Gi_344 = FALSE;
                  Gi_360 = TRUE;
               }
            }
         }
      }
   }
   if (Gi_344 && Gi_332 < 1) {
      iclose_16 = iClose(Symbol(), 0, 2);
      iclose_24 = iClose(Symbol(), 0, 1);
      G_bid_248 = Bid;
      G_ask_256 = Ask;
      if ((!Gi_352) && (!Gi_348) && Ls_32 == "true") {
         Gi_316 = Gi_332;
         if (iclose_16 > iclose_24) {
            Gd_320 = f0_11(OP_SELL);
            if (Gd_320 > 0.0) {
               Gi_356 = f0_12(1, Gd_320, G_bid_248, G_slippage_96, G_bid_248, 0, 0, Creator + "-" + IntegerToString(Gi_316,Digits), G_magic_204, 0, HotPink);
               if (Gi_356 < 0) {
                  Print(Gd_320, "Error: ", GetLastError());
                  return (0);
               }
               Gd_264 = f0_2();
               Gi_360 = TRUE;
            }
         } else {
            Gd_320 = f0_11(OP_BUY);
            if (Gd_320 > 0.0) {
               Gi_356 = f0_12(0, Gd_320, G_ask_256, G_slippage_96, G_ask_256, 0, 0, Creator + "-" + IntegerToString(Gi_316,Digits), G_magic_204, 0, Lime);
               if (Gi_356 < 0) {
                  Print(Gd_320, "Error: ", GetLastError());
                  return (0);
               }
               Gd_272 = f0_6();
               Gi_360 = TRUE;
            }
         }
      }
      if (Gi_356 > 0) Gi_312 = TimeCurrent() + 60.0 * (60.0 * MaxTradeOpenHours);
      Gi_344 = FALSE;
   }
   Gi_332 = f0_13();
   G_price_240 = 0;
   double Ld_56 = 0;
   for (G_pos_328 = OrdersTotal() - 1; G_pos_328 >= 0; G_pos_328--) {
      orderr = OrderSelect(G_pos_328, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_204) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204) {
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
            G_price_240 += OrderOpenPrice() * OrderLots();
            Ld_56 += OrderLots();
         }
      }
   }
   if (Gi_332 > 0) G_price_240 = NormalizeDouble(G_price_240 / Ld_56, Digits);
   if (Gi_360) {
      for (G_pos_328 = OrdersTotal() - 1; G_pos_328 >= 0; G_pos_328--) {
         orderr = OrderSelect(G_pos_328, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_204) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204) {
            if (OrderType() == OP_BUY) {
               G_price_208 = G_price_240 + G_pips_120 * Point;
               Gd_unused_224 = G_price_208;
               Gd_336 = G_price_240 - G_pips_128 * Point;
               Gi_288 = TRUE;
            }
         }
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204) {
            if (OrderType() == OP_SELL) {
               G_price_208 = G_price_240 - G_pips_120 * Point;
               Gd_unused_232 = G_price_208;
               Gd_336 = G_price_240 + G_pips_128 * Point;
               Gi_288 = TRUE;
            }
         }
      }
   }
   if (Gi_360) {
      if (Gi_288 == TRUE) {
         for (G_pos_328 = OrdersTotal() - 1; G_pos_328 >= 0; G_pos_328--) {
            orderr = OrderSelect(G_pos_328, SELECT_BY_POS, MODE_TRADES);
            if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_204) continue;
            if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204) orderr = OrderModify(OrderTicket(), G_price_240, OrderStopLoss(), G_price_208, 0, Yellow);
            Gi_360 = FALSE;
         }
      }
   }
   return (0);
}

// 9A116C50D133C8648404081885194300
double f0_9(double Ad_0) {
   return (NormalizeDouble(Ad_0, Digits));
}

// 169720DB8C7DA7F48F483E787B4A2725
int f0_1(bool Ai_0 = TRUE, bool Ai_4 = TRUE) {
   int Li_ret_8 = 0;
   for (int pos_12 = OrdersTotal() - 1; pos_12 >= 0; pos_12--) {
      if (OrderSelect(pos_12, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204) {
            if (OrderType() == OP_BUY && Ai_0) {
               RefreshRates();
               if (!IsTradeContextBusy()) {
                  if (!OrderClose(OrderTicket(), OrderLots(), f0_9(Bid), 5, CLR_NONE)) {
                     Print("Error close BUY " + IntegerToString(OrderTicket(),Digits));
                     Li_ret_8 = -1;
                  }
               } else {
                  if (G_datetime_364 == iTime(NULL, 0, 0)) return (-2);
                  G_datetime_364 = iTime(NULL, 0, 0);
                  Print("Need close BUY " + IntegerToString(OrderTicket(),Digits) + ". Trade Context Busy");
                  return (-2);
               }
            }
            if (OrderType() == OP_SELL && Ai_4) {
               RefreshRates();
               if (!IsTradeContextBusy()) {
                  if (!(!OrderClose(OrderTicket(), OrderLots(), f0_9(Ask), 5, CLR_NONE))) continue;
                  Print("Error close SELL " + IntegerToString(OrderTicket(),Digits));
                  Li_ret_8 = -1;
                  continue;
               }
               if (G_datetime_368 == iTime(NULL, 0, 0)) return (-2);
               G_datetime_368 = iTime(NULL, 0, 0);
               Print("Need close SELL " + IntegerToString(OrderTicket(),Digits) + ". Trade Context Busy");
               return (-2);
            }
         }
      }
   }
   return (Li_ret_8);
}

// BD1F338B493E3233DF78411E167716E8
double f0_11(int A_cmd_0) {
   double lots_4 = 0;
   datetime datetime_12;
   switch (Gi_76) {
   case 0:
      lots_4 = Lots;
      break;
   case 1:
      lots_4 = NormalizeDouble(Lots * MathPow(Gd_88, Gi_316), Gd_112);
      break;
   case 2:
      datetime_12 = 0;
      lots_4 = Lots;
      for (int pos_20 = OrdersHistoryTotal() - 1; pos_20 >= 0; pos_20--) {
         if (OrderSelect(pos_20, SELECT_BY_POS, MODE_HISTORY)) {
            if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204) {
               if (datetime_12 < OrderCloseTime()) {
                  datetime_12 = OrderCloseTime();
                  if (OrderProfit() < 0.0) {
                     lots_4 = NormalizeDouble(OrderLots() * Gd_88, Gd_112);
                     continue;
                  }
                  lots_4 = Lots;
               }
            }
         } else return (-3);
      }
   }
   if (AccountFreeMarginCheck(Symbol(), A_cmd_0, lots_4) <= 0.0) return (-1);
   if (GetLastError() == 134/* NOT_ENOUGH_MONEY */) return (-2);
   return (lots_4);
}

// CBBD1151F6D49BC6C817A0B96D15036D
int f0_13() {
   int count_0 = 0;
   for (int pos_4 = OrdersTotal() - 1; pos_4 >= 0; pos_4--) {
      orderr = OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_204) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204)
         if (OrderType() == OP_SELL || OrderType() == OP_BUY) count_0++;
   }
   return (count_0);
}

// 41BB59E8D36C416E4C62910D9E765220
void f0_3() {
   for (int pos_0 = OrdersTotal() - 1; pos_0 >= 0; pos_0--) {
      orderr = OrderSelect(pos_0, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol()) {
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204) {
            if (OrderType() == OP_BUY) orderr = OrderClose(OrderTicket(), OrderLots(), Bid, G_slippage_96, Blue);
            if (OrderType() == OP_SELL) orderr = OrderClose(OrderTicket(), OrderLots(), Ask, G_slippage_96, Red);
         }
         Sleep(1000);
      }
   }
}

// C159FD8BED695B6E6A109D3B72C199C3
int f0_12(int Ai_0, double A_lots_4, double A_price_12, int A_slippage_20, double Ad_24, int Ai_unused_32, int Ai_36, string A_comment_40, int A_magic_48, int A_datetime_52, color A_color_56) {
   int ticket_60 = 0;
   int error_64 = 0;
   int count_68 = 0;
   int Li_72 = 100;
   switch (Ai_0) {
   case 2:
      for (count_68 = 0; count_68 < Li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_BUYLIMIT, A_lots_4, A_price_12, A_slippage_20, f0_10(Ad_24, G_pips_128), f0_14(A_price_12, Ai_36), A_comment_40, A_magic_48, A_datetime_52,
            A_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(1000);
      }
      break;
   case 4:
      for (count_68 = 0; count_68 < Li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_BUYSTOP, A_lots_4, A_price_12, A_slippage_20, f0_10(Ad_24, G_pips_128), f0_14(A_price_12, Ai_36), A_comment_40, A_magic_48, A_datetime_52,
            A_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 0:
      for (count_68 = 0; count_68 < Li_72; count_68++) {
         RefreshRates();
         ticket_60 = OrderSend(Symbol(), OP_BUY, A_lots_4, Ask, A_slippage_20, f0_10(Bid, G_pips_128), f0_14(Ask, Ai_36), A_comment_40, A_magic_48, A_datetime_52, A_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 3:
      for (count_68 = 0; count_68 < Li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_SELLLIMIT, A_lots_4, A_price_12, A_slippage_20, f0_0(Ad_24, G_pips_128), f0_4(A_price_12, Ai_36), A_comment_40, A_magic_48, A_datetime_52,
            A_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 5:
      for (count_68 = 0; count_68 < Li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_SELLSTOP, A_lots_4, A_price_12, A_slippage_20, f0_0(Ad_24, G_pips_128), f0_4(A_price_12, Ai_36), A_comment_40, A_magic_48, A_datetime_52,
            A_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
      break;
   case 1:
      for (count_68 = 0; count_68 < Li_72; count_68++) {
         ticket_60 = OrderSend(Symbol(), OP_SELL, A_lots_4, Bid, A_slippage_20, f0_0(Ask, G_pips_128), f0_4(Bid, Ai_36), A_comment_40, A_magic_48, A_datetime_52, A_color_56);
         error_64 = GetLastError();
         if (error_64 == 0/* NO_ERROR */) break;
         if (!((error_64 == 4/* SERVER_BUSY */ || error_64 == 137/* BROKER_BUSY */ || error_64 == 146/* TRADE_CONTEXT_BUSY */ || error_64 == 136/* OFF_QUOTES */))) break;
         Sleep(5000);
      }
   }
   return (ticket_60);
}

// A04259EF619300E271488B8ABD9DF8A9
double f0_10(double Ad_0, double Ai_8) {
   if (Ai_8 == 0) return (0);
   return (Ad_0 - Ai_8 * Point);
}

// 0D578CA46072792DE50D5B9F5F5F8784
double f0_0(double Ad_0, double Ai_8) {
   if (Ai_8 == 0) return (0);
   return (Ad_0 + Ai_8 * Point);
}

// CE75B31DDDC1519B313C4C612EF22D86
double f0_14(double Ad_0, double Ai_8) {
   if (Ai_8 == 0) return (0);
   return (Ad_0 + Ai_8 * Point);
}

// 4347D7B92E8469B198EAA742F66BBE62
double f0_4(double Ad_0, int Ai_8) {
   if (Ai_8 == 0) return (0);
   return (Ad_0 - Ai_8 * Point);
}

// 4A186EA1A04A05E39FD2E7A94BB28576
double f0_5() {
   double Ld_ret_0 = 0;
   for (G_pos_328 = OrdersTotal() - 1; G_pos_328 >= 0; G_pos_328--) {
      orderr = OrderSelect(G_pos_328, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_204) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204)
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) Ld_ret_0 += OrderProfit();
   }
   return (Ld_ret_0);
}

// FDD5E0C68EEEAC73C07299767285F173
void f0_15(double Ai_0, double Ai_4, double A_price_8) {
   double Li_16;
   double order_stoploss_20;
   double price_28;
   if (Ai_4 != 0) {
      for (int pos_36 = OrdersTotal() - 1; pos_36 >= 0; pos_36--) {
         if (OrderSelect(pos_36, SELECT_BY_POS, MODE_TRADES)) {
            if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_204) continue;
            if (OrderSymbol() == Symbol() || OrderMagicNumber() == G_magic_204) {
               if (OrderType() == OP_BUY) {
                  Li_16 = NormalizeDouble((Bid - A_price_8) / Point, 0);
                  if (Li_16 < Ai_0) continue;
                  order_stoploss_20 = OrderStopLoss();
                  price_28 = Bid - Ai_4 * Point;
                  if (order_stoploss_20 == 0.0 || (order_stoploss_20 != 0.0 && price_28 > order_stoploss_20)) orderr = OrderModify(OrderTicket(), A_price_8, price_28, OrderTakeProfit(), 0, Aqua);
               }
               if (OrderType() == OP_SELL) {
                  Li_16 = NormalizeDouble((A_price_8 - Ask) / Point, 0);
                  if (Li_16 < Ai_0) continue;
                  order_stoploss_20 = OrderStopLoss();
                  price_28 = Ask + Ai_4 * Point;
                  if (order_stoploss_20 == 0.0 || (order_stoploss_20 != 0.0 && price_28 < order_stoploss_20)) orderr = OrderModify(OrderTicket(), A_price_8, price_28, OrderTakeProfit(), 0, Red);
               }
            }
            Sleep(1000);
         }
      }
   }
}

// 91C97865111C4DD6B44C584F4B9358BB
double f0_7() {
   if (f0_13() == 0) Gd_372 = AccountEquity();
   if (Gd_372 < Gd_380) Gd_372 = Gd_380;
   else Gd_372 = AccountEquity();
   Gd_380 = AccountEquity();
   return (Gd_372);
}

// 262336F736ADFEEC641C03BB3514631C
double f0_2() {
   double order_open_price_0 = 0;
   int ticket_8;
   double Ld_unused_12 = 0;
   int ticket_20 = 0;
   for (int pos_24 = OrdersTotal() - 1; pos_24 >= 0; pos_24--) {
      orderr = OrderSelect(pos_24, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_204) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204 && OrderType() == OP_BUY) {
         ticket_8 = OrderTicket();
         if (ticket_8 > ticket_20) {
            order_open_price_0 = OrderOpenPrice();
            Ld_unused_12 = order_open_price_0;
            ticket_20 = ticket_8;
         }
      }
   }
   return (order_open_price_0);
}

// 599A26C25DF2561FBAA884F47E1B315C
double f0_6() {
   double order_open_price_0 = 0;
   int ticket_8;
   double Ld_unused_12 = 0;
   int ticket_20 = 0;
   for (int pos_24 = OrdersTotal() - 1; pos_24 >= 0; pos_24--) {
      orderr = OrderSelect(pos_24, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_204) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_204 && OrderType() == OP_SELL) {
         ticket_8 = OrderTicket();
         if (ticket_8 > ticket_20) {
            order_open_price_0 = OrderOpenPrice();
            Ld_unused_12 = order_open_price_0;
            ticket_20 = ticket_8;
         }
      }
   }
   return (order_open_price_0);
}

// 938363B042E987609BD8B876255B9679
void f0_8() {
   Comment("Ea iFxJambi V4\n", "Add : www.facebook.com/ekocintamama\n", "Kunjungi: www.ifxjambi.com\n", "Salam Profit by => Eko Rafael <=\n", "Forex Account Server:", AccountServer(), 
      "\n", "Lots:  ", Lots, 
      "\n", "Symbol: ", Symbol(), 
      "\n", "Price:  ", NormalizeDouble(Bid, 4), 
      "\n", "Date: ", Month(), "-", Day(), "-", Year(), " Server Time: ", Hour(), ":", Minute(), ":", Seconds(), 
   "\n");
}
void CloseProfitNow()
{
   double PN;
   if(OrdersTotal()==1)
   {  if (OrderSymbol()==Symbol())
         {
            PN = NormalizeDouble(OrderOpenPrice(),Digits);
            if (!IsTradeContextBusy()) 
            {
               if (OrderType()==OP_BUY && NormalizeDouble(Bid-ProfitPoint*Point,Digits)>=PN)
                  bool close1 = OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Bid,Digits),3,Blue);
                  
               if (OrderType()==OP_SELL && NormalizeDouble(Ask+ProfitPoint*Point,Digits)<=PN)
                  bool close2 = OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Ask,Digits),3,Red);
            }
         }  
      }  
}

Recommend