Navigation:Home > Content >

SES_EU_v3.1Final~.mq4

Time: 2010-03-05 | Download file:SES_EU_v3.1Final~.mq4

/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : [email protected]
*/
extern double Lots = 0.01;
extern double ДОЛЯ_ДЕП = 0.08;
extern int TakeProfit = 500;
extern int Stop_Loss = 18;
extern double TrailingStopLoss = 18.0;
extern int TrailingStep = 3;
extern double TrailingStop = 0.33;
extern double Utral = 200.0;
extern double Klot = 2.0;
extern int Pforse = 1;
extern double UForce = 0.16;
extern double TimeStop = 120.0;
extern double TIME = 30.0;
extern double SPREAD = 17.0;
extern double STOP_level = 20.0;
extern int slip = 10;
extern bool DELETE = TRUE;
extern bool MARKET = FALSE;
extern int OP_STOP = 2;
extern bool modif = TRUE;
extern bool Sound = TRUE;
bool gi_204 = TRUE;
extern int BUY = 1;
extern int SELL = 1;
extern int MagicNumber = 4321;
extern int MagicNumber2 = 1234;
double gda_224[6];
double gda_228[6];
double gda_232[6];
double gda_236[6];

int deinit() {
   ObjectDelete("Liverage");
   ObjectDelete("Spead");
   ObjectDelete("StopLevel");
   ObjectDelete("BALANSE");
   ObjectDelete("EQUITY");
   return (0);
}

int start() {
   double l_ord_stoploss_36;
   double l_ord_stoploss_44;
   double l_free_magrin_52;
   double l_lotstep_60;
   double ld_68;
   int li_152;
   bool li_156;
   double l_ima_160;
   double l_ima_168;
   double l_ima_176;
   double l_iforce_184;
   double l_iforce_192;
   double l_iwpr_200;
   double l_iwpr_208;
   double l_ima_216;
   double l_ima_224;
   double l_ima_232;
   double l_iforce_240;
   double l_iforce_248;
   double l_iforce_256;
   double l_iforce_264;
   double l_iforce_272;
   double l_iforce_280;
   double l_iforce_288;
   double l_iforce_296;
   double l_iforce_304;
   double l_iforce_312;
   double l_iforce_320;
   double l_iforce_328;
   double l_lots_336;
   double ld_344;
   int li_352;
   int l_pos_356;
   int l_ord_total_360;
   string ls_0 = "2020.01.01 00:00";
   int l_str2time_8 = StrToTime(ls_0);
   if (TimeCurrent() >= l_str2time_8) {
      Alert("Время лицензии истекло, обратитесь к разработчику");
      return (0);
   }
   ArrayInitialize(gda_224, 0);
   ArrayInitialize(gda_228, 0);
   ArrayInitialize(gda_232, 0);
   ArrayInitialize(gda_236, 0);
   ObjectCreate("Liverage", OBJ_LABEL, 0, 0, 0, 0, 0);
   ObjectSet("Liverage", OBJPROP_CORNER, 2);
   ObjectSet("Liverage", OBJPROP_YDISTANCE, 15);
   ObjectSet("Liverage", OBJPROP_XDISTANCE, 10);
   ObjectSetText("Liverage", "Liverage " + AccountLeverage(), 8, "Tahoma", Yellow);
   ObjectCreate("Spead", OBJ_LABEL, 0, 0, 0, 0, 0);
   ObjectSet("Spead", OBJPROP_CORNER, 2);
   ObjectSet("Spead", OBJPROP_YDISTANCE, 30);
   ObjectSet("Spead", OBJPROP_XDISTANCE, 10);
   ObjectSetText("Spead", "Spead " + DoubleToStr((Ask - Bid) / Point, 0), 8, "Tahoma", Yellow);
   if ((Ask - Bid) / Point > SPREAD) ObjectSet("Spead", OBJPROP_COLOR, Red);
   ObjectCreate("StopLevel", OBJ_LABEL, 0, 0, 0, 0, 0);
   ObjectSet("StopLevel", OBJPROP_CORNER, 2);
   ObjectSet("StopLevel", OBJPROP_YDISTANCE, 45);
   ObjectSet("StopLevel", OBJPROP_XDISTANCE, 10);
   ObjectSetText("StopLevel", "StopLevel " + DoubleToStr(MarketInfo(Symbol(), MODE_STOPLEVEL), 0), 8, "Tahoma", Yellow);
   if (MarketInfo(Symbol(), MODE_STOPLEVEL) > STOP_level) ObjectSet("StopLevel", OBJPROP_COLOR, Red);
   ObjectCreate("BALANSE", OBJ_LABEL, 0, 0, 0, 0, 0);
   ObjectSet("BALANSE", OBJPROP_CORNER, 2);
   ObjectSet("BALANSE", OBJPROP_YDISTANCE, 60);
   ObjectSet("BALANSE", OBJPROP_XDISTANCE, 10);
   ObjectSetText("BALANSE", "BALANSE " + DoubleToStr(AccountBalance(), 2), 8, "Tahoma", Aqua);
   if (MarketInfo(Symbol(), MODE_STOPLEVEL) > STOP_level) ObjectSet("StopLevel", OBJPROP_COLOR, Red);
   ObjectCreate("EQUITY", OBJ_LABEL, 0, 0, 0, 0, 0);
   ObjectSet("EQUITY", OBJPROP_CORNER, 2);
   ObjectSet("EQUITY", OBJPROP_YDISTANCE, 75);
   ObjectSet("EQUITY", OBJPROP_XDISTANCE, 10);
   ObjectSetText("EQUITY", "EQUITY " + DoubleToStr(AccountEquity(), 2), 12, "Tahoma", Lime);
   if (AccountEquity() < AccountBalance()) ObjectSet("EQUITY", OBJPROP_COLOR, Red);
   if (AccountEquity() > AccountBalance()) ObjectSet("EQUITY", OBJPROP_COLOR, Aqua);
   bool li_12 = FALSE;
   bool li_16 = TRUE;
   bool li_20 = FALSE;
   bool li_24 = FALSE;
   double ld_unused_28 = 0;
   double ld_76 = 0;
   double ld_84 = 0;
   double ld_unused_92 = 1;
   double ld_unused_116 = 1;
   double ld_124 = 0;
   double ld_132 = 0;
   for (int l_pos_140 = 0; l_pos_140 < OrdersTotal(); l_pos_140++) {
      if (OrderSelect(l_pos_140, SELECT_BY_POS) && OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber || OrderMagicNumber() == MagicNumber2) {
         switch (OrderType()) {
         case OP_BUY:
            gda_224[0] = OrderTicket();
            gda_224[1] = OrderOpenPrice();
            gda_224[2] = OrderLots();
            gda_224[3] = OrderStopLoss();
            gda_224[4] = OrderProfit();
            gda_224[5] = OrderMagicNumber();
            break;
         case OP_SELL:
            gda_228[0] = OrderTicket();
            gda_228[1] = OrderOpenPrice();
            gda_228[2] = OrderLots();
            gda_228[3] = OrderStopLoss();
            gda_228[4] = OrderProfit();
            gda_228[5] = OrderMagicNumber();
            break;
         case OP_BUYSTOP:
            gda_232[0] = OrderTicket();
            gda_232[1] = OrderOpenPrice();
            gda_232[2] = OrderLots();
            gda_232[3] = OrderStopLoss();
            gda_232[4] = OrderProfit();
            gda_232[5] = OrderMagicNumber();
            break;
         case OP_SELLSTOP:
            gda_236[0] = OrderTicket();
            gda_236[1] = OrderOpenPrice();
            gda_236[2] = OrderLots();
            gda_236[3] = OrderStopLoss();
            gda_236[4] = OrderProfit();
            gda_236[5] = OrderMagicNumber();
         }
      }
   }
   if (gda_224[0] >= 1.0 && gda_224[4] < 0.0 && gda_224[5] == MagicNumber && gda_236[0] < 1.0 && OP_STOP == 1 || OP_STOP == 2) {
      OrderSend(Symbol(), OP_SELLSTOP, Klot * gda_224[2], Bid - Stop_Loss * Point, slip, Ask, Bid - Stop_Loss * Point - TakeProfit * Point, "", MagicNumber2, TimeCurrent() +
         60.0 * TIME, Red);
   }
   if (gda_228[0] >= 1.0 && gda_228[4] < 0.0 && gda_228[5] == MagicNumber && gda_232[0] < 1.0 && OP_STOP == 1 || OP_STOP == 2) {
      OrderSend(Symbol(), OP_BUYSTOP, Klot * gda_228[2], Ask + Stop_Loss * Point, slip, Bid, Ask + Stop_Loss * Point + TakeProfit * Point, "", MagicNumber2, TimeCurrent() +
         60.0 * TIME, Green);
   }
   for (int l_pos_148 = 0; l_pos_148 < OrdersTotal(); l_pos_148++) {
      if (OrderSelect(l_pos_148, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderSymbol() == Symbol()) {
            if (OrderMagicNumber() == MagicNumber || OrderMagicNumber() == MagicNumber2) {
               if (OrderType() == OP_BUY && OrderStopLoss() == 0.0) OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Stop_Loss * Point, Ask + TakeProfit * Point, OrderExpiration());
               if (OrderType() == OP_SELL && OrderStopLoss() == 0.0) OrderModify(OrderTicket(), OrderOpenPrice(), Ask + Stop_Loss * Point, Bid - TakeProfit * Point, OrderExpiration());
               if (OrderType() == OP_BUY && OrderStopLoss() > OrderOpenPrice() && OrderProfit() > 0.0) ld_76 = 1;
               if (OrderType() == OP_SELL && OrderStopLoss() < OrderOpenPrice() && OrderProfit() > 0.0) ld_84 = 1;
               if (DELETE == TRUE && OrderType() == OP_BUYSTOP && ld_84 == 1.0) OrderDelete(OrderTicket(), CLR_NONE);
               if (DELETE == TRUE && OrderType() == OP_SELLSTOP && ld_76 == 1.0) OrderDelete(OrderTicket(), CLR_NONE);
               if (Sound == TRUE && OrderType() == OP_BUY && OrderStopLoss() < OrderOpenPrice() && Bid <= OrderStopLoss() + Point) PlaySound("stops.wav");
               if (Sound == TRUE && OrderType() == OP_SELL && OrderStopLoss() > OrderOpenPrice() && Ask >= OrderStopLoss() - Point) PlaySound("stops.wav");
               if (modif == TRUE) {
                  if (OrderType() == OP_BUY) l_ord_stoploss_36 = OrderStopLoss();
                  if (OrderType() == OP_SELL) l_ord_stoploss_44 = OrderStopLoss();
                  if (OrderType() == OP_SELLSTOP && ld_76 == 1.0 && OrderOpenPrice() < l_ord_stoploss_36 || OrderOpenPrice() < Bid - Stop_Loss * Point) OrderModify(OrderTicket(), Bid - Stop_Loss * Point, Ask, OrderTakeProfit(), OrderExpiration(), CLR_NONE);
                  if (OrderType() == OP_BUYSTOP && ld_84 == 1.0 && OrderOpenPrice() > l_ord_stoploss_44 || OrderOpenPrice() > Ask + Stop_Loss * Point) OrderModify(OrderTicket(), Ask + Stop_Loss * Point, Bid, OrderTakeProfit(), OrderExpiration(), CLR_NONE);
               }
               if (OrdersTotal() > 0) {
                  if (OrderType() == OP_SELL && OrderOpenPrice() - Ask >= Utral * Point) {
                     if (TrailingStop <= 0.0) continue;
                     if (OrderOpenPrice() - Ask <= Utral * Point) continue;
                     if (OrderStopLoss() <= Ask + (OrderOpenPrice() * TrailingStop - Ask * TrailingStop)) continue;
                     OrderModify(OrderTicket(), OrderOpenPrice(), Ask + OrderOpenPrice() * TrailingStop - Ask * TrailingStop, OrderTakeProfit(), OrderMagicNumber(), CLR_NONE);
                     return (0);
                  }
                  if (OrderType() == OP_BUY && Bid - OrderOpenPrice() >= Utral * Point) {
                     if (TrailingStop > 0.0) {
                        if (Bid - OrderOpenPrice() > Utral * Point) {
                           if (OrderStopLoss() < Bid - (Bid - OrderOpenPrice()) * TrailingStop) {
                              OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Bid * TrailingStop + OrderOpenPrice() * TrailingStop, OrderTakeProfit(), OrderMagicNumber(), CLR_NONE);
                              return (0);
                           }
                        }
                     }
                  }
               }
            }
         }
      }
   }
   if (Lots > 0.0) {
      if (AccountFreeMargin() > AccountMargin()) l_free_magrin_52 = AccountFreeMargin();
      if (AccountFreeMargin() < AccountMargin()) l_free_magrin_52 = 0;
      l_lotstep_60 = MarketInfo(Symbol(), MODE_LOTSTEP);
      if (ДОЛЯ_ДЕП > 0.0) {
         li_152 = l_free_magrin_52 / MarketInfo(Symbol(), MODE_MARGINREQUIRED) * ДОЛЯ_ДЕП / l_lotstep_60;
         ld_68 = li_152 * l_lotstep_60;
         if (l_free_magrin_52 > 0.0 && ld_68 > MarketInfo(Symbol(), MODE_MAXLOT)) ld_68 = MarketInfo(Symbol(), MODE_MAXLOT);
         if (l_free_magrin_52 > 0.0 && ld_68 < Lots) ld_68 = Lots;
      }
   }
   if (ДОЛЯ_ДЕП == 0.0) ld_68 = Lots;
   if (li_16 == TRUE) {
      l_ima_160 = iMA(NULL, PERIOD_M1, 1, 0, MODE_EMA, PRICE_MEDIAN, 0);
      l_ima_168 = iMA(NULL, PERIOD_M1, 1, 0, MODE_EMA, PRICE_CLOSE, 0);
      l_ima_176 = iMA(NULL, PERIOD_M1, 1, 0, MODE_EMA, PRICE_CLOSE, 1);
      l_iforce_184 = iForce(NULL, PERIOD_M1, 1, MODE_SMA, PRICE_CLOSE, 0);
      l_iforce_192 = iForce(NULL, PERIOD_M1, 1, MODE_SMA, PRICE_CLOSE, 1);
      l_iwpr_200 = iWPR(NULL, PERIOD_M1, 1, 0);
      l_iwpr_208 = iWPR(NULL, PERIOD_M1, 1, 1);
      l_ima_216 = iMA(NULL, PERIOD_M1, 3, 0, MODE_SMA, PRICE_MEDIAN, 0);
      l_ima_224 = iMA(NULL, PERIOD_M1, 6, 0, MODE_SMA, PRICE_MEDIAN, 0);
      l_ima_232 = iMA(NULL, PERIOD_M1, 18, 0, MODE_SMA, PRICE_MEDIAN, 0);
      l_iforce_240 = iForce(NULL, PERIOD_M1, Pforse, MODE_SMA, PRICE_CLOSE, 0);
      l_iforce_248 = iForce(NULL, PERIOD_M1, Pforse, MODE_SMA, PRICE_CLOSE, 1);
      l_iforce_256 = iForce(NULL, PERIOD_M1, Pforse, MODE_SMA, PRICE_CLOSE, 2);
      l_iforce_264 = iForce(NULL, PERIOD_M1, Pforse, MODE_SMA, PRICE_CLOSE, 3);
      l_iforce_272 = iForce(NULL, PERIOD_M1, Pforse, MODE_SMA, PRICE_CLOSE, 4);
      l_iforce_280 = iForce(NULL, PERIOD_M1, Pforse, MODE_SMA, PRICE_CLOSE, 5);
      l_iforce_288 = iForce(NULL, PERIOD_M1, 13, MODE_SMA, PRICE_CLOSE, 0);
      l_iforce_296 = iForce(NULL, PERIOD_M1, 13, MODE_SMA, PRICE_CLOSE, 1);
      l_iforce_304 = iForce(NULL, PERIOD_M1, 13, MODE_SMA, PRICE_CLOSE, 2);
      l_iforce_312 = iForce(NULL, PERIOD_M1, 30, MODE_SMA, PRICE_CLOSE, 0);
      l_iforce_320 = iForce(NULL, PERIOD_M1, 30, MODE_SMA, PRICE_CLOSE, 1);
      l_iforce_328 = iForce(NULL, PERIOD_M1, 30, MODE_SMA, PRICE_CLOSE, 2);
      if (UForce > 0.0 && Ask < l_ima_216 && Ask < l_ima_224 && Ask < l_ima_232 && l_iforce_240 < (-UForce) || l_iforce_248 < (-UForce) || l_iforce_256 < (-UForce) || l_iforce_264 < (-UForce) ||
         l_iforce_272 < (-UForce) || l_iforce_280 < (-UForce)) ld_124 = 1;
      if (UForce > 0.0 && Bid > l_ima_216 && Bid > l_ima_224 && Bid > l_ima_232 && l_iforce_240 > UForce || l_iforce_248 > UForce || l_iforce_256 > UForce || l_iforce_264 > UForce ||
         l_iforce_272 > UForce || l_iforce_280 > UForce) ld_132 = 1;
      if (OrdersTotal() < 1) ObjectDelete("OrderStopline");
      if (l_lots_336 < ld_68) l_lots_336 = ld_68;
      if (l_lots_336 > MarketInfo(Symbol(), MODE_MAXLOT)) l_lots_336 = MarketInfo(Symbol(), MODE_MAXLOT);
      if (l_lots_336 < MarketInfo(Symbol(), MODE_MINLOT)) l_lots_336 = MarketInfo(Symbol(), MODE_MINLOT);
      if (Klot * l_lots_336 > MarketInfo(Symbol(), MODE_MAXLOT)) Klot = 1;
      ld_344 = MarketInfo(Symbol(), MODE_SPREAD) * Point;
      li_352 = MarketInfo(Symbol(), MODE_STOPLEVEL);
      if (li_352 < Stop_Loss) li_352 = Stop_Loss;
      if (li_352 > Stop_Loss) l_lots_336 = NormalizeDouble(l_lots_336 / 2.0, 2);
      l_pos_356 = 0;
      l_ord_total_360 = OrdersTotal();
      for (l_pos_356 = 0; l_pos_356 <= l_ord_total_360; l_pos_356++) {
         OrderSelect(l_pos_356, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber || OrderMagicNumber() == MagicNumber2) li_156 = TRUE;
      }
      if (gi_204) TrailingPositions(TrailingStopLoss, TrailingStep, MagicNumber, MagicNumber2);
      if (SPREAD * Point < Ask - Bid) {
         li_16 = FALSE;
         ld_unused_116 = 0;
      }
      if (STOP_level < MarketInfo(Symbol(), MODE_STOPLEVEL)) li_16 = FALSE;
      if (OrderType() == OP_BUY && OrderStopLoss() == 0.0 || li_16 == FALSE && OrderMagicNumber() == MagicNumber && Bid < OrderOpenPrice() - Stop_Loss * Point - MarketInfo(Symbol(), MODE_SPREAD) * Point) OrderClose(OrderTicket(), OrderLots(), Bid, slip, CLR_NONE);
      if (OrderType() == OP_SELL && OrderStopLoss() == 0.0 || li_16 == FALSE && OrderMagicNumber() == MagicNumber && Ask > OrderOpenPrice() + Stop_Loss * Point + MarketInfo(Symbol(), MODE_SPREAD) * Point) OrderClose(OrderTicket(), OrderLots(), Ask, slip, CLR_NONE);
      if (ДОЛЯ_ДЕП == 0.0) l_lots_336 = Lots;
      if (TimeStop > 0.0 && TimeCurrent() - OrderOpenTime() > TimeStop) li_12 = TRUE;
      if (li_156 == FALSE) li_12 = TRUE;
      if (OrdersTotal() == 0) li_12 = TRUE;
      if (li_12 == TRUE) {
         if (MARKET == FALSE && BUY == 1 && li_20 == FALSE && li_16 == TRUE && l_ima_176 < l_ima_168 && l_ima_168 > l_ima_160 && ld_124 == 1.0 && l_iforce_184 > 0.0 && l_iforce_192 < 0.0 &&
            l_iwpr_200 > -50.0 && l_iwpr_208 < -50.0) {
            OrderSend(Symbol(), OP_BUY, l_lots_336, Ask, slip, Bid - Stop_Loss * Point, Ask + TakeProfit * Point, "", MagicNumber, 0, Green);
            if (OP_STOP == 1) {
               OrderSend(Symbol(), OP_SELLSTOP, Klot * l_lots_336, Bid - Stop_Loss * Point, slip, Ask, Bid - Stop_Loss * Point - TakeProfit * Point, "", MagicNumber, TimeCurrent() +
                  60.0 * TIME, Red);
            }
            if (Sound == TRUE) PlaySound("alert2.wav");
            return (0);
         }
         if (MARKET == FALSE && SELL == 1 && li_24 == FALSE && li_16 == TRUE && l_ima_176 > l_ima_168 && l_ima_168 < l_ima_160 && ld_132 == 1.0 && l_iforce_184 < 0.0 && l_iforce_192 > 0.0 &&
            l_iwpr_200 < -50.0 && l_iwpr_208 > -50.0) {
            OrderSend(Symbol(), OP_SELL, l_lots_336, Bid, slip, Ask + Stop_Loss * Point, Bid - TakeProfit * Point, "", MagicNumber, 0, Red);
            if (OP_STOP == 1) {
               OrderSend(Symbol(), OP_BUYSTOP, Klot * l_lots_336, Ask + Stop_Loss * Point, slip, Bid, Ask + Stop_Loss * Point + TakeProfit * Point, "", MagicNumber, TimeCurrent() +
                  60.0 * TIME, Green);
            }
            if (Sound == TRUE) PlaySound("alert.wav");
            return (0);
         }
         if (MARKET == TRUE && BUY == 1 && li_20 == FALSE && li_16 == TRUE && l_ima_176 < l_ima_168 && l_ima_168 > l_ima_160 && ld_124 == 1.0 && l_iforce_184 > 0.0 && l_iforce_192 < 0.0 &&
            l_iwpr_200 > -50.0 && l_iwpr_208 < -50.0) {
            OrderSend(Symbol(), OP_BUY, l_lots_336, Ask, slip, 0, 0, "", MagicNumber, 0, Green);
            if (OP_STOP == 1) {
               OrderSend(Symbol(), OP_SELLSTOP, Klot * l_lots_336, Bid - Stop_Loss * Point, slip, Ask, Bid - Stop_Loss * Point - TakeProfit * Point, "", MagicNumber, TimeCurrent() +
                  60.0 * TIME, Red);
            }
            if (Sound == TRUE) PlaySound("alert2.wav");
            return (0);
         }
         if (MARKET == TRUE && SELL == 1 && li_24 == FALSE && li_16 == TRUE && l_ima_176 > l_ima_168 && l_ima_168 < l_ima_160 && ld_132 == 1.0 && l_iforce_184 < 0.0 && l_iforce_192 > 0.0 &&
            l_iwpr_200 < -50.0 && l_iwpr_208 > -50.0) {
            OrderSend(Symbol(), OP_SELL, l_lots_336, Bid, slip, 0, 0, "", MagicNumber, 0, Red);
            if (OP_STOP == 1) {
               OrderSend(Symbol(), OP_BUYSTOP, Klot * l_lots_336, Ask + Stop_Loss * Point, slip, Bid, Ask + Stop_Loss * Point + TakeProfit * Point, "", MagicNumber, TimeCurrent() +
                  60.0 * TIME, Green);
            }
            if (Sound == TRUE) PlaySound("alert.wav");
            return (0);
         }
      }
      return (0);
   }
   return (0);
}

void TrailingPositions(int ai_0, int ai_4, int a_magic_8, int a_magic_12) {
   double l_bid_16 = 0;
   double l_ask_24 = 0;
   double ld_32 = 1;
   for (int l_pos_40 = 0; l_pos_40 < OrdersTotal(); l_pos_40++) {
      if (!OrderSelect(l_pos_40, SELECT_BY_POS) || OrderSymbol() != Symbol()) continue;
      l_bid_16 = MarketInfo(OrderSymbol(), MODE_BID);
      l_ask_24 = MarketInfo(OrderSymbol(), MODE_ASK);
      if (OrderType() == OP_BUY && Bid - OrderOpenPrice() < Utral * Point && OrderMagicNumber() == a_magic_8 || OrderMagicNumber() == a_magic_12) {
         if (l_bid_16 - OrderOpenPrice() > ld_32 * ai_0 * Point) {
            if (OrderStopLoss() < l_bid_16 - (ld_32 * ai_0 + ai_4 - 1.0) * Point || OrderStopLoss() == 0.0) {
               OrderModify(OrderTicket(), OrderOpenPrice(), l_bid_16 - ld_32 * ai_0 * Point, OrderTakeProfit(), OrderExpiration());
               if (Sound == TRUE) PlaySound("ok.wav");
            }
         }
      } else {
         if (OrderType() == OP_SELL && OrderOpenPrice() - Ask < Utral * Point && OrderMagicNumber() == a_magic_8 || OrderMagicNumber() == a_magic_12) {
            if (OrderOpenPrice() - l_ask_24 > ld_32 * ai_0 * Point) {
               if (OrderStopLoss() > l_ask_24 + (ld_32 * ai_0 + ai_4 - 1.0) * Point || OrderStopLoss() == 0.0) {
                  OrderModify(OrderTicket(), OrderOpenPrice(), l_ask_24 + ld_32 * ai_0 * Point, OrderTakeProfit(), OrderExpiration());
                  if (Sound == TRUE) PlaySound("ok.wav");
               }
            }
         }
      }
   }
}

Recommend