Navigation:Home > Content >

FX-Shock_Classic_v4.20edu.mq4

Time: 2018-10-19 | Download file:FX-Shock_Classic_v4.20edu.mq4

/*
   Generated by EX4-TO-MQ4 decompiler FREEWARE V4.0.451.1 [-]
   Website: http://www.metaquotes.net
   E-mail : support@metaquotes.net
*/
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://fx-investor.com.ua"

//#include 
#import "stdlib.ex4"
   string ErrorDescription(int a0); // DA69CBAFF4D38B87377667EEC549DE5A
#import

int g_acc_number_76 = 0;
string gs_80 = " FX-Shock v4.20 -";
extern string _1_ = "Настройки советника FX-Shock v4.20";
extern double Slip = 3.0;
extern double Lots = 0.1;
extern string _2_ = "Настройки первой стороны";
extern int DefaultPipsA = 15;
extern double LotExponentA = 1.4;
extern double TPSeriesA = 10.0;
extern int Ogr_A = 5;
extern double TPAloneA = 10.0;
extern string _3_ = "Настройки второй стороны";
extern int DefaultPipsB = 15;
extern double LotExponentB = 1.4;
extern double TPSeriesB = 10.0;
extern int Ogr_B = 5;
extern double TPAloneB = 10.0;
extern int MaxDopTrades = 20;
extern int MaxTrades = 30;
extern int MagicNumber = 100;
extern string _4_ = "Использовать звуковое оповещение открытия ордеров";
extern bool UseSound = FALSE;
extern string _5_ = "Инфопанель";
extern bool ShowInfo = TRUE;
extern string _6_ = "Включение классических настроек";
extern bool ClassicMode = FALSE;
extern string _7_ = "Начальный лот true - постоянный, false - в % от депо";
extern bool LotConst_or_not = TRUE;
extern double RiskPercent = 10.0;
extern string _8_ = "Использовать динамический пипстеп";
extern bool DynamicPips = TRUE;
extern string _9_ = "С какого колена уменьшать TP";
extern int iCountKol = 20;
extern string _10_ = "На сколько пп уменьшать ТР";
extern int iDelta = 2;
extern string _11_ = "С какого колена увеличивать пипстеп";
extern int CountKolPipStep = 20;
extern string _12_ = "Множитель увеличения пипстепа";
extern double LotExponentCountKol = 1.2;
extern string _13_ = "Использование увеличенного LotExponent true - да; false - нет";
extern bool BigLotExponent = TRUE;
extern double dBigLotExponent = 2.0;
extern string _14_ = "Время выключения открытия новой серии в пятницу (час)";
extern int TimeToStop = 20;
extern string _15_ = "Открытие первого ордера с 0 ТП и объемом последнего ордера другой стороны";
extern bool First0 = FALSE;
extern string _16_ = "Задержка 5 минут между сторонами (работа согласно регламенту InstaForex.com";
extern bool gi_376 = TRUE;
extern string _17_ = "Дополнительный контроль серий, переворот лока в основную";
extern bool RollOver = FALSE;
extern string _18_ = "Настройка сетки локирования";
extern string _19_ = "AgroLock - true - Локирование после каждого ордера, после 1го в сетке";
extern bool UseLock = TRUE;
extern bool AgroLock = FALSE;
extern int LTP = 1;
extern string _20_ = "Настройка сетки локирования";
extern int L1 = 7;
extern int L2 = 9;
extern int L3 = 11;
extern int L4 = 13;
extern int L5 = 15;
extern int L6 = 17;
extern int L7 = 19;
extern int L8 = 21;
extern int L9 = 23;
extern int L10 = 25;
extern double k0 = 1.0;
extern double k1 = 1.0;
extern double k2 = 1.0;
extern double k3 = 1.0;
extern double k4 = 1.0;
extern double k5 = 1.0;
extern double k6 = 1.0;
extern double k7 = 1.0;
extern double k8 = 1.0;
extern double k9 = 1.0;
extern double k10 = 1.0;
extern double k11 = 1.0;
extern double k12 = 1.0;
extern double k13 = 1.0;
extern double k14 = 1.0;
extern double k15 = 1.0;
extern double k16 = 1.0;
extern double k17 = 1.0;
extern double k18 = 1.0;
extern double k19 = 1.0;
extern double k20 = 1.0;
extern double k21 = 1.0;
extern double k22 = 1.0;
extern double k23 = 1.0;
extern double k24 = 1.0;
extern double k25 = 1.0;
extern double k26 = 1.0;
extern double k27 = 1.0;
extern double k28 = 1.0;
extern double k29 = 1.0;
extern bool LockClose = TRUE;
extern bool LockControl = TRUE;
int gi_716;
double g_maxlot_736;
double gd_unused_744 = 0.0;
double gd_unused_752 = 100.0;
double gd_760;
int gi_unused_768 = 2;
double gd_772;
double gd_780;
int g_time_788 = 0;
int gia_792[4];
int gia_796[4];
int gia_unused_800[4];
double gda_804[4];
double gda_808[4];
int gia_812[4];
int gia_816[10];
int gia_820[4];
int gia_824[4];
int gia_828[4];
int gia_832[4];
double gda_836[4];
int gia_840[4] = {0, 0, 0, 0};
int gia_844[4] = {0, 0, 0, 0};
int gi_unused_848;
string gs_dummy_868;
string gs_dummy_876;
string gs_dummy_884;
string gs_dummy_892;
string gs_dummy_900;
string gs_dummy_908;
bool gi_916;
bool gi_920;
int gi_932 = 13882323;
int gi_936 = 0;
int gi_940 = 16760576;
int gi_944 = 0;
int gi_948 = 16760576;
int gi_952 = 0;
int gi_956 = 65535;
int gi_960 = 65535;
int gi_964 = 9125192;
int gi_968 = 9125192;
double gda_972[30];
extern string _21_ = "Настройки линии БУ";
double gd_984 = 0.0;
int gi_992 = 0;
extern string NameBuy = "LineBuy";
extern string NameSell = "LineSell";
extern color ColorBuy = DarkBlue;
extern color ColorSell = FireBrick;
double gd_unused_1020;
double gd_unused_1028;
extern string _22_ = "Настройки индикации ордеров";
extern bool history = TRUE;
int g_pos_1056;
string gs_unused_1060 = "------------------------------------------------------------";
int g_magic_1068 = -1;
int g_magic_1072 = -1;
int g_magic_1076 = -1;
int g_magic_1080 = -1;
int g_magic_1084 = -1;
int g_magic_1088 = -1;
int g_magic_1092 = -1;
int g_magic_1096 = -1;
int g_magic_1100 = -1;
int g_magic_1104 = -1;
string gs_unused_1108 = "------------------------------------------------------------";
int gi_1116 = -1;
int gi_1120 = -1;
int gi_1124 = -1;
int gi_1128 = -1;
int gi_1132 = -1;
int gi_1136 = -1;
int gi_1140 = -1;
int gi_1144 = -1;
int gi_1148 = -1;
int gi_1152 = -1;
extern color TOB_Color = Red;
extern color TOS_Color = Blue;
extern color OOB_Color = Pink;
extern color OOS_Color = PowderBlue;
double gd_1172;
double gd_1180;
double gd_1188;
double gd_1196;
string gs_1204 = "FX-Shock v.4.20";
string gs_unused_1212 = "FXS";
string gs_unused_1220 = "FXShock";
string gs_unused_1228 = "FXShock";
string gs_dummy_1244;

// F7BD616B6C841D2538735F76D1E02B57
void f0_123861(string as_0, int a_window_8) {
   string text_12 = "decompile protected";
   string name_20 = WindowExpertName() + "_" + as_0;
   if (ObjectFind(name_20) == -1) ObjectCreate(name_20, OBJ_LABEL, a_window_8, 0, 0);
   ObjectSetText(name_20, text_12, 7, "Tahoma", Red);
   ObjectSet(name_20, OBJPROP_CORNER, 3);
   ObjectSet(name_20, OBJPROP_BACK, FALSE);
   ObjectSet(name_20, OBJPROP_XDISTANCE, 5);
   ObjectSet(name_20, OBJPROP_YDISTANCE, 5);
   ObjectSet(name_20, OBJPROP_COLOR, Red);
}

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   int li_unused_0 = 0;
   gd_760 = MarketInfo(Symbol(), MODE_SPREAD) * Point;
   gia_840[0] = MagicNumber * 2 + 0;
   gia_840[1] = MagicNumber * 2 + 1;
   gia_840[2] = MagicNumber * 4 + 2;
   gia_840[3] = MagicNumber * 4 + 3;
   if (Digits == 4 || Digits == 2) gi_716 = 1;
   else gi_716 = 10;
   gia_832[0] = DefaultPipsA * gi_716;
   gia_832[1] = DefaultPipsB * gi_716;
   gia_832[2] = DefaultPipsA * gi_716;
   gia_832[3] = DefaultPipsB * gi_716;
   TPAloneA *= gi_716;
   TPAloneB *= gi_716;
   TPSeriesA *= gi_716;
   TPSeriesB *= gi_716;
   gia_796[0] = f0_101952(0);
   gia_796[1] = f0_101952(1);
   gia_796[2] = f0_101952(2);
   gia_796[3] = f0_101952(3);
   gia_816[0] = L1;
   gia_816[1] = L2;
   gia_816[2] = L3;
   gia_816[3] = L4;
   gia_816[4] = L5;
   gia_816[5] = L6;
   gia_816[6] = L7;
   gia_816[7] = L8;
   gia_816[8] = L9;
   gia_816[9] = L10;
   if (ClassicMode) {
      gia_820[0] = 1;
      gia_820[1] = 1;
   } else {
      gia_820[0] = Ogr_A;
      gia_820[1] = Ogr_B;
   }
   gia_824[0] = TPSeriesA;
   gia_824[1] = TPSeriesB;
   gia_828[0] = TPAloneA;
   gia_828[1] = TPAloneB;
   gia_824[2] = TPSeriesA;
   gia_824[3] = TPSeriesB;
   gia_828[2] = TPAloneA;
   gia_828[3] = TPAloneB;
   gda_836[0] = LotExponentA;
   gda_836[1] = LotExponentB;
   gda_836[2] = LotExponentA;
   gda_836[3] = LotExponentB;
   gda_972[0] = k0;
   gda_972[1] = k1;
   gda_972[2] = k2;
   gda_972[3] = k3;
   gda_972[4] = k4;
   gda_972[5] = k5;
   gda_972[6] = k6;
   gda_972[7] = k7;
   gda_972[8] = k8;
   gda_972[9] = k9;
   gda_972[10] = k10;
   gda_972[11] = k11;
   gda_972[12] = k12;
   gda_972[13] = k13;
   gda_972[14] = k14;
   gda_972[15] = k15;
   gda_972[16] = k16;
   gda_972[17] = k17;
   gda_972[18] = k18;
   gda_972[19] = k19;
   gda_972[20] = k20;
   gda_972[21] = k21;
   gda_972[22] = k22;
   gda_972[23] = k23;
   gda_972[24] = k24;
   gda_972[25] = k25;
   gda_972[26] = k26;
   gda_972[27] = k27;
   gda_972[28] = k28;
   gda_972[29] = k29;
   return (0);
}

// 52D46093050F38C27267BCE42543EF60
int deinit() {
   ObjectDelete("y_MainInfoBack1");
   ObjectDelete("y_MainInfoBack2");
   ObjectDelete("y_MainInfoBack3");
   ObjectDelete("y_MainInfoBack4");
   ObjectDelete("y_MainInfoBack5");
   ObjectDelete("z_MainInfo_1");
   ObjectDelete("z_MainInfo_2");
   ObjectDelete("z_MainInfo_3");
   ObjectDelete("z_MainInfo_4");
   ObjectDelete("z_MainInfo_5");
   ObjectDelete("z_MainInfo_6");
   ObjectDelete("z_MainInfo_7");
   if (ObjectFind(NameBuy) != -1) ObjectDelete(NameBuy);
   if (ObjectFind(NameSell) != -1) ObjectDelete(NameSell);
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   if (IsTesting() == FALSE)
      if (IsDemo() == FALSE && AccountNumber() != AccountNumber()) return (0);
   g_maxlot_736 = MarketInfo(Symbol(), MODE_MAXLOT);
   double minlot_0 = MarketInfo(Symbol(), MODE_MINLOT);
   if (!LockControl) f0_12193();
   if (g_time_788 != Time[0]) {
      g_time_788 = Time[0];
      if (LockControl) f0_12193();
      if (LotConst_or_not == FALSE) Lots = AccountBalance() * RiskPercent / 100.0 / 10000.0;
      if (gi_376) {
         if (Minute() == 5 || Minute() == 15 || Minute() == 25 || Minute() == 35 || Minute() == 45 || Minute() == 55) {
            f0_78482(1);
            f0_119459(0);
         }
         if (Minute() == 0 || Minute() == 10 || Minute() == 20 || Minute() == 30 || Minute() == 40 || Minute() == 50) {
            f0_78482(0);
            f0_119459(1);
         }
      } else {
         f0_78482(1);
         f0_119459(0);
         f0_78482(0);
         f0_119459(1);
      }
      f0_69202(0);
      f0_69202(1);
      f0_90721();
      f0_73988();
      f0_127919();
      f0_75770();
      if (ShowInfo) f0_34142();
      f0_121269();
      f0_123861("protected", 0);
   }
   return (0);
}

// 184D556B2265DD916CF13B127125842B
void f0_12193() {
   bool li_0;
   int li_4;
   int li_8;
   int li_12;
   int li_16;
   if (RollOver) {
      li_0 = FALSE;
      li_4 = f0_101952(0);
      li_8 = f0_101952(2);
      if (LockClose) {
         if (f0_37353(2) > 0.0 && li_8 > 0 && li_4 == 0) f0_51342(2);
         if (f0_37353(0) > 0.0 && li_4 > 0 && li_8 == 0) f0_51342(0);
         if (f0_37353(2) > 0.0 && f0_37353(0) > 0.0) {
            f0_51342(2);
            f0_51342(0);
         }
      }
      li_4 = f0_101952(0);
      li_8 = f0_101952(2);
      if (li_4 == 0 && li_8 > 0 && f0_80364(1) != f0_80364(2)) {
         li_0 = gia_840[0];
         gia_840[0] = gia_840[2];
         gia_840[2] = li_0;
         Print("Перевернули 1ю сторону");
      }
      li_0 = FALSE;
      li_12 = f0_101952(1);
      li_16 = f0_101952(3);
      if (LockClose) {
         if (f0_37353(3) > 0.0 && li_16 > 0 && li_12 == 0) f0_51342(3);
         if (f0_37353(1) > 0.0 && li_12 > 0 && li_16 == 0) f0_51342(1);
         if (f0_37353(3) > 0.0 && f0_37353(1) > 0.0) {
            f0_51342(3);
            f0_51342(1);
         }
      }
      li_12 = f0_101952(1);
      li_16 = f0_101952(3);
      if (li_12 == 0 && li_16 > 0 && f0_80364(0) != f0_80364(3)) {
         li_0 = gia_840[1];
         gia_840[1] = gia_840[3];
         gia_840[3] = li_0;
         Print("Перевернули 2ю сторону");
      }
   }
}

// EEBCD74603B4958E9CABCB22EC07FD91
void f0_119459(int ai_0) {
   double ld_4;
   double high_76;
   double low_84;
   double lots_92;
   int li_unused_12 = 0;
   int li_unused_16 = 0;
   int li_unused_52 = 100;
   bool li_56 = FALSE;
   bool li_60 = FALSE;
   int li_64 = f0_101952(ai_0);
   int li_68 = f0_89399(ai_0);
   int li_72 = f0_101952(li_68);
   gi_916 = FALSE;
   gi_920 = FALSE;
   if (DynamicPips) {
      high_76 = High[iHighest(NULL, 0, MODE_HIGH, 36, 1)];
      low_84 = Low[iLowest(NULL, 0, MODE_LOW, 36, 1)];
      gd_780 = NormalizeDouble((high_76 - low_84) / 3.0 / Point, 2);
      if (gd_780 < gia_832[ai_0] / 2) gd_780 = gia_832[ai_0] / 2;
      if (gd_780 > gia_832[ai_0] * 2) gd_780 = gia_832[ai_0] * 2;
   } else gd_780 = gia_832[ai_0];
   if (BigLotExponent) {
      if (li_64 == 1) ld_4 = dBigLotExponent;
      if (li_64 == 2) ld_4 = dBigLotExponent;
      if (li_64 == 3) ld_4 = dBigLotExponent;
      if (li_64 >= 4) ld_4 = gda_836[ai_0];
   }
   if (li_64 == 0) lots_92 = Lots;
   else lots_92 = NormalizeDouble(f0_59599(ai_0) * ld_4, 2);
   if (li_64 == 0 && li_72 == 0 && f0_42382()) {
      if (ai_0 == 0) {
         if (!First0) f0_31612(ai_0, 0, lots_92, li_64);
         else f0_81804(ai_0, 0, f0_59599(f0_94111(ai_0)), li_64);
         li_56 = TRUE;
         li_64++;
         gia_792[ai_0] = li_64;
         if (UseSound) PlaySound("alert2.wav");
      } else {
         if (ai_0 == 1) {
            if (!First0) f0_31612(ai_0, 1, lots_92, li_64);
            else f0_81804(ai_0, 1, f0_59599(f0_94111(ai_0)), li_64);
            li_56 = TRUE;
            li_64++;
            gia_792[ai_0] = li_64;
            if (UseSound) PlaySound("alert2.wav");
         }
      }
   } else {
      if (li_64 <= MaxTrades) {
         for (int pos_20 = OrdersTotal() - 1; pos_20 >= 0; pos_20--) {
            if (OrderSelect(pos_20, SELECT_BY_POS, MODE_TRADES)) {
               if (OrderSymbol() != Symbol() || OrderMagicNumber() != gia_840[ai_0]) continue;
               if (OrderType() == OP_BUY) {
                  li_56 = TRUE;
                  break;
               }
               if (OrderType() == OP_SELL) {
                  li_60 = TRUE;
                  break;
               }
            }
         }
      }
   }
   if (CountKolPipStep <= li_64) gd_780 += CountKolPipStep * LotExponentCountKol;
   if (li_56 && f0_19101(ai_0) - Ask >= gd_780 * Point) {
      f0_31612(ai_0, 0, lots_92, li_64);
      li_64++;
      gi_916 = TRUE;
      gia_792[ai_0] = li_64;
      if (UseSound) PlaySound("alert2.wav");
   } else {
      if (li_60 && Bid - f0_45210(ai_0) >= gd_780 * Point) {
         f0_31612(ai_0, 1, lots_92, li_64);
         li_64++;
         gia_792[ai_0] = li_64;
         gi_920 = TRUE;
         if (UseSound) PlaySound("alert2.wav");
      }
   }
   f0_69202(ai_0);
}

// 9C95CA1374D709ACBF78ED2FCA7DB42A
void f0_78482(int ai_0) {
   int li_unused_4 = 0;
   int li_unused_8 = 0;
   int li_unused_44 = 100;
   bool li_48 = FALSE;
   bool li_52 = FALSE;
   int li_56 = f0_89399(ai_0);
   int li_60 = f0_101952(li_56);
   int li_64 = f0_101952(ai_0);
   if (UseLock) {
      if (f0_37353(li_56) > 0.0 && li_60 > 0 && li_64 < gia_816[0]) f0_51342(li_56);
      if (li_60 > 0 && li_60 <= MaxTrades) {
         for (int pos_12 = OrdersTotal() - 1; pos_12 >= 0; pos_12--) {
            if (OrderSelect(pos_12, SELECT_BY_POS, MODE_TRADES)) {
               if (OrderSymbol() != Symbol() || OrderMagicNumber() != gia_840[li_56]) continue;
               if (OrderType() == OP_BUY) {
                  li_48 = TRUE;
                  break;
               }
               if (OrderType() == OP_SELL) {
                  li_52 = TRUE;
                  break;
               }
            }
         }
      }
      if (CountKolPipStep <= li_60) gd_780 += CountKolPipStep * LotExponentCountKol;
      if (li_48 && f0_19101(li_56) - Ask >= gd_780 * Point && li_64 == 0) {
         gd_772 = NormalizeDouble(f0_59599(li_56) * gda_836[ai_0], 2);
         f0_101672(li_56, 0, gd_772, li_60);
         li_60++;
         gia_792[li_56] = li_60;
         if (UseSound) PlaySound("alert2.wav");
         f0_69202(li_56);
      } else {
         if (li_52 && Bid - f0_45210(li_56) >= gd_780 * Point && li_64 == 0) {
            gd_772 = NormalizeDouble(f0_59599(li_56) * gda_836[ai_0], 2);
            f0_101672(li_56, 1, gd_772, li_60);
            li_60++;
            gia_792[li_56] = li_60;
            if (UseSound) PlaySound("alert2.wav");
            f0_69202(li_56);
         }
      }
      if (CountKolPipStep <= li_60) gd_780 += CountKolPipStep * LotExponentCountKol;
      if (gi_916) {
         gd_772 = NormalizeDouble(f0_59599(ai_0) * (gda_972[li_64 - 1]), 2);
         if (AgroLock && li_64 >= gia_816[0]) f0_101672(li_56, 1, gd_772, li_64);
         else {
            for (pos_12 = 9; pos_12 >= 0; pos_12--) {
               if (li_64 == gia_816[pos_12] && li_60 < pos_12 + 1) {
                  f0_101672(li_56, 1, gd_772, li_64);
                  Print(f0_19101(ai_0) + "  " + ((gda_972[li_64 - 1])) + "   " + gd_772);
                  break;
               }
            }
         }
      }
      if (gi_920) {
         gd_772 = NormalizeDouble(f0_59599(ai_0) * (gda_972[li_64 - 1]), 2);
         if (AgroLock && li_64 >= gia_816[0]) f0_101672(li_56, 0, gd_772, li_64);
         else {
            for (pos_12 = 9; pos_12 >= 0; pos_12--) {
               if (li_64 == gia_816[pos_12] && li_60 < pos_12 + 1) {
                  f0_101672(li_56, 0, gd_772, li_64);
                  Print(f0_45210(ai_0) + "  " + ((gda_972[li_64 - 1])) + "   " + gd_772);
                  break;
               }
            }
         }
      }
      gi_920 = FALSE;
      gi_916 = FALSE;
   }
}

// 89F99879667B3325C4B214B6EFA37778
void f0_69202(int ai_0) {
   double price_20;
   double ld_60;
   double ld_68;
   double price_76;
   int li_unused_4 = 0;
   int error_8 = 0;
   int li_44 = 100;
   bool li_48 = FALSE;
   bool li_52 = FALSE;
   int li_56 = f0_101952(ai_0);
   if (li_56 > 0 && li_56 != gia_844[ai_0] && li_56 >= gia_820[ai_0]) {
      gia_844[ai_0] = li_56;
      ld_60 = 0;
      ld_68 = 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() != gia_840[ai_0]) continue;
            if (OrderType() == OP_BUY) li_48 = TRUE;
            if (OrderType() == OP_SELL) li_52 = TRUE;
            ld_60 += OrderOpenPrice() * OrderLots();
            ld_68 += OrderLots();
         }
      }
      if (ld_68 > 0.0) ld_60 = NormalizeDouble(ld_60 / ld_68, Digits);
      price_76 = 0;
      if (li_48) {
         if (ld_60 > 0.0) price_76 = NormalizeDouble(ld_60 + gia_824[ai_0] * Point, Digits);
         if (li_56 > iCountKol) price_76 = NormalizeDouble(price_76 - (li_56 - iCountKol) * iDelta * Point, Digits);
         if (li_56 > MaxDopTrades) price_76 = ld_60;
      } else {
         if (li_52) {
            if (ld_60 > 0.0) price_76 = NormalizeDouble(ld_60 - gia_824[ai_0] * Point, Digits);
            if (li_56 > iCountKol) price_76 = NormalizeDouble(price_76 - (li_56 - iCountKol) * iDelta * Point, Digits);
            if (li_56 > MaxDopTrades) price_76 = ld_60;
         }
      }
      for (pos_12 = OrdersTotal() - 1; pos_12 >= 0; pos_12--) {
         if (OrderSelect(pos_12, SELECT_BY_POS, MODE_TRADES)) {
            if (OrderSymbol() != Symbol() || OrderMagicNumber() != gia_840[ai_0]) continue;
            if (OrderTakeProfit() - price_76 == 0.0 || price_76 == 0.0) continue;
            for (int count_16 = 0; count_16 < li_44; count_16++) {
               OrderModify(OrderTicket(), OrderOpenPrice(), 0, price_76, 0, Green);
               error_8 = GetLastError();
               if (error_8 == 0/* NO_ERROR */) break;
               if (!((error_8 == 4/* SERVER_BUSY */ || error_8 == 137/* BROKER_BUSY */ || error_8 == 146/* TRADE_CONTEXT_BUSY */ || error_8 == 136/* OFF_QUOTES */))) break;
               Sleep(1000);
               RefreshRates();
            }
            price_20 = price_76;
            gda_804[ai_0] = price_20;
         }
      }
   }
}

// 4A186EA1A04A05E39FD2E7A94BB28576
double f0_37353(int ai_0) {
   double ld_ret_8 = 0;
   for (int pos_4 = OrdersTotal() - 1; pos_4 >= 0; pos_4--) {
      OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != gia_840[ai_0]) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == gia_840[ai_0])
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) ld_ret_8 += OrderProfit();
   }
   return (ld_ret_8);
}

// 661D6B0D377293A18F5C902C8EC6F23F
void f0_51342(int ai_0) {
   for (int pos_4 = OrdersTotal() - 1; pos_4 >= 0; pos_4--) {
      OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol()) {
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == gia_840[ai_0]) {
            if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, Slip, Blue);
            if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, Slip, Red);
         }
         Sleep(3000);
      }
   }
}

// CBBD1151F6D49BC6C817A0B96D15036D
int f0_101952(int ai_0) {
   int count_4 = 0;
   for (int pos_8 = OrdersTotal() - 1; pos_8 >= 0; pos_8--) {
      if (OrderSelect(pos_8, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != gia_840[ai_0]) continue;
         count_4++;
      }
   }
   gia_792[ai_0] = count_4;
   return (count_4);
}

// 262336F736ADFEEC641C03BB3514631C
double f0_19101(int ai_0) {
   for (int pos_4 = OrdersTotal() - 1; pos_4 >= 0; pos_4--) {
      if (OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != gia_840[ai_0] || OrderType() != OP_BUY) continue;
         return (OrderOpenPrice());
      }
   }
   return (0);
}

// 599A26C25DF2561FBAA884F47E1B315C
double f0_45210(int ai_0) {
   for (int pos_4 = OrdersTotal() - 1; pos_4 >= 0; pos_4--) {
      if (OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != gia_840[ai_0] || OrderType() != OP_SELL) continue;
         return (OrderOpenPrice());
      }
   }
   return (0);
}

// A05D812685803C94B440E85178F97A11
double f0_80364(int ai_0) {
   for (int pos_8 = OrdersTotal() - 1; pos_8 >= 0; pos_8--) {
      if (OrderSelect(pos_8, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != gia_840[ai_0]) continue;
         return (OrderType());
      }
   }
   return (OrderType());
}

// 769805F56E7BD0B95CFBD361E6E24B25
double f0_59599(int ai_0) {
   for (int pos_8 = OrdersTotal() - 1; pos_8 >= 0; pos_8--) {
      if (OrderSelect(pos_8, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != gia_840[ai_0]) continue;
         return (OrderLots());
      }
   }
   return (0);
}

// 3ED4137FCCCAF209812ED7B28A787689
int f0_31612(int ai_0, int ai_4, double ad_8, string as_16) {
   int ticket_24 = 0;
   int error_28 = 0;
   int li_36 = 100;
   switch (ai_4) {
   case 0:
      for (int count_32 = 0; count_32 < li_36; count_32++) {
         if (f0_60350(2, 0, NormalizeDouble(Ask, Digits), 0, 0, 0, 0, 0)) {
            ticket_24 = OrderSend(Symbol(), OP_BUY, f0_28283(ad_8), NormalizeDouble(Ask, Digits), Slip, 0, NormalizeDouble(Bid + gia_828[ai_0] * Point, Digits), "Buy - " + gs_80 +
               as_16, gia_840[ai_0], 0, Lime);
            error_28 = GetLastError();
            if (error_28 == 0/* NO_ERROR */) {
               gda_804[ai_0] = NormalizeDouble(Ask, Digits);
               gda_808[ai_0] = f0_28283(ad_8);
               gia_812[ai_0] = ai_4;
               break;
            }
            if (!((error_28 == 4/* SERVER_BUSY */ || error_28 == 137/* BROKER_BUSY */ || error_28 == 146/* TRADE_CONTEXT_BUSY */ || error_28 == 136/* OFF_QUOTES */))) break;
            Sleep(1000);
            RefreshRates();
         }
      }
      break;
   case 1:
      for (count_32 = 0; count_32 < li_36; count_32++) {
         if (f0_60350(2, 1, NormalizeDouble(Bid, Digits), 0, 0, 0, 0, 0)) {
            ticket_24 = OrderSend(Symbol(), OP_SELL, f0_28283(ad_8), NormalizeDouble(Bid, Digits), Slip, 0, NormalizeDouble(Ask - gia_828[ai_0] * Point, Digits), "Sell - " + gs_80 +
               as_16, gia_840[ai_0], 0, HotPink);
            error_28 = GetLastError();
            if (error_28 == 0/* NO_ERROR */) {
               gda_804[ai_0] = NormalizeDouble(Bid, Digits);
               gda_808[ai_0] = f0_28283(ad_8);
               gia_812[ai_0] = ai_4;
               break;
            }
            if (!((error_28 == 4/* SERVER_BUSY */ || error_28 == 137/* BROKER_BUSY */ || error_28 == 146/* TRADE_CONTEXT_BUSY */ || error_28 == 136/* OFF_QUOTES */))) break;
            Sleep(1000);
            RefreshRates();
         }
      }
   }
   return (ticket_24);
}

// CB365A6413B5C4E7270A4161E0FD4B7F
int f0_101672(int ai_0, int ai_4, double ad_8, string as_16) {
   int ticket_24 = 0;
   int error_28 = 0;
   int li_36 = 100;
   switch (ai_4) {
   case 0:
      for (int count_32 = 0; count_32 < li_36; count_32++) {
         if (f0_60350(2, 0, NormalizeDouble(Ask, Digits), 0, 0, 0, 0, 0)) {
            ticket_24 = OrderSend(Symbol(), OP_BUY, f0_28283(ad_8), NormalizeDouble(Ask, Digits), Slip, 0, 0, "Buy - " + gs_80 + as_16, gia_840[ai_0], 0, Gold);
            error_28 = GetLastError();
            if (error_28 == 0/* NO_ERROR */) {
               gda_804[ai_0] = NormalizeDouble(Ask, Digits);
               gda_808[ai_0] = f0_28283(ad_8);
               gia_812[ai_0] = ai_4;
               Print("Лок серии " + as_16 + " Sell открыт! Magic = " + gia_840[ai_0]);
               break;
            }
            if (!((error_28 == 4/* SERVER_BUSY */ || error_28 == 137/* BROKER_BUSY */ || error_28 == 146/* TRADE_CONTEXT_BUSY */ || error_28 == 136/* OFF_QUOTES */))) break;
            Sleep(1000);
            RefreshRates();
         }
      }
      break;
   case 1:
      for (count_32 = 0; count_32 < li_36; count_32++) {
         if (f0_60350(2, 1, NormalizeDouble(Bid, Digits), 0, 0, 0, 0, 0)) {
            ticket_24 = OrderSend(Symbol(), OP_SELL, f0_28283(ad_8), NormalizeDouble(Bid, Digits), Slip, 0, 0, "Sell - " + gs_80 + as_16, gia_840[ai_0], 0, Gold);
            error_28 = GetLastError();
            if (error_28 == 0/* NO_ERROR */) {
               gda_804[ai_0] = NormalizeDouble(Bid, Digits);
               gda_808[ai_0] = f0_28283(ad_8);
               gia_812[ai_0] = ai_4;
               Print("Лок серии Buy открыт! Magic = " + gia_840[ai_0]);
               break;
            }
            if (!((error_28 == 4/* SERVER_BUSY */ || error_28 == 137/* BROKER_BUSY */ || error_28 == 146/* TRADE_CONTEXT_BUSY */ || error_28 == 136/* OFF_QUOTES */))) break;
            Sleep(1000);
            RefreshRates();
         }
      }
   }
   return (ticket_24);
}

// A335DB0AC7F98E70AE1E8487A2791837
int f0_81804(int ai_0, int ai_4, double ad_8, string as_16) {
   int ticket_24 = 0;
   int error_28 = 0;
   int li_36 = 100;
   switch (ai_4) {
   case 0:
      for (int count_32 = 0; count_32 < li_36; count_32++) {
         if (f0_60350(2, 0, NormalizeDouble(Ask, Digits), 0, 0, 0, 0, 0)) {
            ticket_24 = OrderSend(Symbol(), OP_BUY, f0_28283(ad_8), NormalizeDouble(Ask, Digits), Slip, 0, 0, "Buy - " + gs_80 + as_16, gia_840[ai_0], 0, Lime);
            error_28 = GetLastError();
            if (error_28 == 0/* NO_ERROR */) {
               gda_804[ai_0] = NormalizeDouble(Ask, Digits);
               gda_808[ai_0] = f0_28283(ad_8);
               gia_812[ai_0] = ai_4;
               break;
            }
            if (!((error_28 == 4/* SERVER_BUSY */ || error_28 == 137/* BROKER_BUSY */ || error_28 == 146/* TRADE_CONTEXT_BUSY */ || error_28 == 136/* OFF_QUOTES */))) break;
            Sleep(1000);
            RefreshRates();
         }
      }
      break;
   case 1:
      for (count_32 = 0; count_32 < li_36; count_32++) {
         if (f0_60350(2, 1, NormalizeDouble(Bid, Digits), 0, 0, 0, 0, 0)) {
            ticket_24 = OrderSend(Symbol(), OP_SELL, f0_28283(ad_8), NormalizeDouble(Bid, Digits), Slip, 0, 0, "Sell - " + gs_80 + as_16, gia_840[ai_0], 0, HotPink);
            error_28 = GetLastError();
            if (error_28 == 0/* NO_ERROR */) {
               gda_804[ai_0] = NormalizeDouble(Bid, Digits);
               gda_808[ai_0] = f0_28283(ad_8);
               gia_812[ai_0] = ai_4;
               break;
            }
            if (!((error_28 == 4/* SERVER_BUSY */ || error_28 == 137/* BROKER_BUSY */ || error_28 == 146/* TRADE_CONTEXT_BUSY */ || error_28 == 136/* OFF_QUOTES */))) break;
            Sleep(1000);
            RefreshRates();
         }
      }
   }
   return (ticket_24);
}

// B28172B985EED2521384A01A3B31E3F0
int f0_89399(int ai_0) {
   switch (ai_0) {
   case 0:
      return (2);
   case 1:
      return (3);
   }
   return (0);
}

// 38350FE142782EF0E6BB82AC5D70CEFB
double f0_28283(double ad_0) {
   double lotstep_8 = MarketInfo(Symbol(), MODE_LOTSTEP);
   double ld_16 = MarketInfo(Symbol(), MODE_MINLOT);
   double ld_24 = MarketInfo(Symbol(), MODE_MAXLOT);
   ad_0 = MathRound(ad_0 / lotstep_8) * lotstep_8;
   if (ad_0 < ld_16) {
      Print("Расчетный лот  " + ad_0 + "  меньше минимально допустимого для торговли  " + ld_16);
      ad_0 = ld_16;
   }
   if (ad_0 > ld_24 && ld_24 > 0.0) {
      Print("Расчетный лот  " + ad_0 + "  больше максимально допустимого для торговли  " + ld_24);
      ad_0 = ld_24;
   }
   return (ad_0);
}

// 43DD9EACAB5241C757822E6454492171
void f0_34142() {
   int li_0 = NormalizeDouble(AccountBalance(), 0);
   int li_4 = NormalizeDouble(AccountEquity(), 0);
   if (li_4 >= 5 * (li_0 / 6)) gi_unused_848 = 16748574;
   if (li_4 >= li_0 / 6 * 4 && li_4 < 5 * (li_0 / 6)) gi_unused_848 = 16760576;
   if (li_4 >= 3 * (li_0 / 6) && li_4 < li_0 / 6 * 4) gi_unused_848 = 55295;
   if (li_4 >= li_0 / 6 * 2 && li_4 < 3 * (li_0 / 6)) gi_unused_848 = 17919;
   if (li_4 >= li_0 / 6 && li_4 < li_0 / 6 * 2) gi_unused_848 = 3937500;
   if (li_4 < li_0 / 5) gi_unused_848 = 255;
   ObjectDelete("Lable1");
   ObjectDelete("Lable2");
   ObjectDelete("Lable3");
   string ls_24 = "";
   int li_8 = f0_80364(0);
   int li_12 = f0_80364(1);
   int li_16 = f0_80364(2);
   int li_20 = f0_80364(3);
   if (ObjectFind("y_MainInfoBack1") == -1) f0_79160("y_MainInfoBack1", "gggg", 58, "Webdings", 0, 0, gi_932);
   if (ObjectFind("y_MainInfoBack2") == -1) f0_79160("y_MainInfoBack2", "gggg", 58, "Webdings", 0, 80, gi_940);
   if (ObjectFind("y_MainInfoBack3") == -1) f0_79160("y_MainInfoBack3", "gggg", 58, "Webdings", 0, 150, gi_948);
   if (ObjectFind("y_MainInfoBack4") == -1) f0_79160("y_MainInfoBack4", "gggg", 58, "Webdings", 0, 220, gi_956);
   if (ObjectFind("y_MainInfoBack5") == -1) f0_79160("y_MainInfoBack5", "gggg", 58, "Webdings", 0, 290, gi_960);
   int li_32 = ObjectGet("y_MainInfoBack1", OBJPROP_XDISTANCE);
   int li_36 = ObjectGet("y_MainInfoBack1", OBJPROP_YDISTANCE);
   int li_40 = ObjectGet("y_MainInfoBack2", OBJPROP_XDISTANCE);
   int li_44 = ObjectGet("y_MainInfoBack2", OBJPROP_YDISTANCE);
   int li_48 = ObjectGet("y_MainInfoBack3", OBJPROP_XDISTANCE);
   int li_52 = ObjectGet("y_MainInfoBack3", OBJPROP_YDISTANCE);
   int li_56 = ObjectGet("y_MainInfoBack4", OBJPROP_XDISTANCE);
   int li_60 = ObjectGet("y_MainInfoBack4", OBJPROP_YDISTANCE);
   int li_64 = ObjectGet("y_MainInfoBack5", OBJPROP_XDISTANCE);
   int li_68 = ObjectGet("y_MainInfoBack5", OBJPROP_YDISTANCE);
   f0_79160("z_MainInfo_1", "FX-Shock v4.13", 24, "Tahoma", li_32 + 55, li_36 + 10, gi_936);
   f0_79160("z_MainInfo_2", "www.fx-investor.com.ua", 15, "Tahoma", li_32 + 48, li_36 + 40, gi_936);
   if (li_8 == 0) ls_24 = "BUY";
   if (li_8 == 1) ls_24 = "SELL";
   f0_79160("z_BuyInfo_1", "Основная серия 1 - " + ls_24, 9, "Arial Black", li_40 + 50, li_44 + 6, gi_944);
   f0_79160("z_BuyInfo_2", "Ордеров:  " + DoubleToStr(f0_101952(0), 0), 9, "Arial Black", li_40 + 20, li_44 + 21, gi_944);
   f0_79160("z_BuyInfo_3", "Magic:  " + gia_840[0], 9, "Arial Black", li_40 + 165, li_44 + 21, gi_944);
   ls_24 = "";
   if (li_12 == 0) ls_24 = "BUY";
   if (li_12 == 1) ls_24 = "SELL";
   f0_79160("z_SellInfo_1", "Основная серия 2 - " + ls_24, 9, "Arial Black", li_48 + 50, li_52 + 6, gi_952);
   f0_79160("z_SellInfo_2", "Ордеров:  " + DoubleToStr(f0_101952(1), 0), 9, "Arial Black", li_48 + 20, li_52 + 21, gi_952);
   f0_79160("z_SellInfo_3", "Magic:  " + gia_840[1], 9, "Arial Black", li_48 + 165, li_52 + 21, gi_952);
   ls_24 = "";
   if (li_16 == 0) ls_24 = "BUY";
   if (li_16 == 1) ls_24 = "SELL";
   f0_79160("z_BuyInfo_11", "Локирующая серия 1 - " + ls_24, 9, "Arial Black", li_56 + 50, li_60 + 6, gi_964);
   f0_79160("z_BuyInfo_21", "Ордеров:  " + DoubleToStr(f0_101952(2), 0), 9, "Arial Black", li_56 + 20, li_60 + 21, gi_964);
   f0_79160("z_BuyInfo_31", "Magic:  " + gia_840[2], 9, "Arial Black", li_56 + 165, li_60 + 21, gi_964);
   ls_24 = "";
   if (li_20 == 0) ls_24 = "BUY";
   if (li_20 == 1) ls_24 = "SELL";
   f0_79160("z_SellInfo_11", "Локирующая серия 2 - " + ls_24, 9, "Arial Black", li_64 + 50, li_68 + 6, gi_968);
   f0_79160("z_SellInfo_21", "Ордеров:  " + DoubleToStr(f0_101952(3), 0), 9, "Arial Black", li_64 + 20, li_68 + 21, gi_968);
   f0_79160("z_SellInfo_31", "Magic:  " + gia_840[3], 9, "Arial Black", li_64 + 165, li_68 + 21, gi_968);
   ls_24 = "";
}

// 9DFFBF69FFBA8BC38BC4E01ABF4B1675
void f0_79160(string a_name_0, string a_text_8, int a_fontsize_16, string a_fontname_20, int a_x_28, int a_y_32, color a_color_36) {
   int window_40 = WindowFind("2SS");
   if (window_40 == -1) window_40 = 0;
   if (ObjectFind("y_MainInfoBack1") != window_40) ObjectDelete("y_MainInfoBack1");
   if (ObjectFind("y_MainInfoBack2") != window_40) ObjectDelete("y_MainInfoBack2");
   if (ObjectFind("y_MainInfoBack3") != window_40) ObjectDelete("y_MainInfoBack3");
   if (ObjectFind("y_MainInfoBack4") != window_40) ObjectDelete("y_MainInfoBack4");
   if (ObjectFind("y_MainInfoBack5") != window_40) ObjectDelete("y_MainInfoBack5");
   if (ObjectFind(a_name_0) == 0 && window_40 != 0) ObjectDelete(a_name_0);
   ObjectCreate(a_name_0, OBJ_LABEL, window_40, 0, 0);
   ObjectSetText(a_name_0, a_text_8, a_fontsize_16, a_fontname_20);
   ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_28);
   ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_32);
   ObjectSet(a_name_0, OBJPROP_COLOR, a_color_36);
   ObjectSet(a_name_0, OBJPROP_BACK, FALSE);
}

// 53FA05F9387FA3A26C7EFE5D980A9469
int f0_42382() {
   if (DayOfWeek() == 5 && Hour() >= TimeToStop) return (0);
   return (1);
}

// 78289F148D96EA6F0CF92E87DA6B475C
bool f0_60350(int ai_0, int ai_4, double ad_8, double ad_16, double ad_24, double ad_32, double ad_40, double ad_48) {
   int li_56 = 0;
   int li_60 = -1;
   int li_64 = 0;
   double ld_68 = 0;
   double ld_76 = 0;
   double ld_84 = 0;
   double ld_92 = 0;
   double ld_100 = 0;
   double ld_108 = 0;
   double point_116 = MarketInfo(Symbol(), MODE_POINT);
   double ld_124 = MarketInfo(Symbol(), MODE_STOPLEVEL) * point_116;
   double ld_132 = MarketInfo(Symbol(), MODE_FREEZELEVEL) * point_116;
   li_56 = ai_0;
   li_60 = ai_4;
   li_64 = 10 * li_56 + li_60;
   if (li_56 == 1) {
      ld_68 = ad_8;
      ld_76 = ad_24;
      ld_84 = ad_16;
   }
   if (li_56 == 2) {
      ld_92 = ad_32;
      ld_100 = ad_48;
      ld_108 = ad_40;
   }
   if (li_56 == 3) {
      ld_68 = ad_8;
      ld_76 = ad_24;
      ld_84 = ad_16;
      ld_92 = ad_32;
      ld_100 = ad_48;
      ld_108 = ad_40;
   }
   RefreshRates();
   switch (li_64) {
   case 10:
      if (Bid - ld_84 > ld_132 || ld_84 == 0.0 && ld_76 - Bid > ld_132 || ld_76 == 0.0 && li_56 == 1) return (1);
      break;
   case 11:
      if (ld_84 - Ask > ld_132 || ld_84 == 0.0 && Ask - ld_76 > ld_132 || ld_76 == 0.0 && li_56 == 1) return (1);
      break;
   case 12:
      if (Ask - ld_68 > ld_132 && ld_124 <= ld_68 - ld_84 || ld_84 == 0.0 && ld_124 <= ld_76 - ld_68 || ld_76 == 0.0 && li_56 == 1) return (1);
      break;
   case 13:
      if (ld_68 - Bid > ld_132 && ld_124 <= ld_84 - ld_68 || ld_84 == 0.0 && ld_124 <= ld_68 - ld_76 || ld_76 == 0.0 && li_56 == 1) return (1);
      break;
   case 14:
      if (ld_68 - Ask > ld_132 && ld_124 <= ld_68 - ld_84 || ld_84 == 0.0 && ld_124 <= ld_76 - ld_68 || ld_76 == 0.0 && li_56 == 1) return (1);
      break;
   case 15:
      if (Bid - ld_68 > ld_132 && ld_124 <= ld_84 - ld_68 || ld_84 == 0.0 && ld_124 <= ld_68 - ld_76 || ld_76 == 0.0 && li_56 == 1) return (1);
      break;
   case 20:
      if (ld_124 <= Bid - ld_108 || ld_108 == 0.0 && ld_124 <= ld_100 - Bid || ld_100 == 0.0) return (1);
      break;
   case 21:
      if (ld_124 <= ld_108 - Ask || ld_108 == 0.0 && ld_124 <= Ask - ld_100 || ld_100 == 0.0) return (1);
      break;
   case 22:
      if (ld_124 <= Ask - ld_92 && ld_124 <= ld_92 - ld_108 || ld_108 == 0.0 && ld_124 <= ld_100 - ld_92 || ld_100 == 0.0 && li_56 == 2) return (1);
      break;
   case 23:
      if (ld_124 <= ld_92 - Bid && ld_124 <= ld_108 - ld_92 || ld_108 == 0.0 && ld_124 <= ld_92 - ld_100 || ld_100 == 0.0 && li_56 == 2) return (1);
      break;
   case 24:
      if (ld_124 <= ld_92 - Ask && ld_124 <= ld_92 - ld_108 || ld_108 == 0.0 && ld_124 <= ld_100 - ld_92 || ld_100 == 0.0 && li_56 == 2) return (1);
      break;
   case 25:
      if (ld_124 <= Bid - ld_92 && ld_124 <= ld_108 - ld_92 || ld_108 == 0.0 && ld_124 <= ld_92 - ld_100 || ld_100 == 0.0 && li_56 == 2) return (1);
      break;
   case 30:
      if (!(Bid - ld_84 > ld_132 || ld_84 == 0.0 && ld_76 - Bid > ld_132 || ld_76 == 0.0)) break;
      if (ld_124 <= Bid - ld_108 || ld_108 == 0.0 && ld_124 <= ld_100 - Bid || ld_100 == 0.0) return (1);
      break;
   case 31:
      if (!(ld_84 - Ask > ld_132 || ld_84 == 0.0 && Ask - ld_76 > ld_132 || ld_76 == 0.0)) break;
      if (ld_124 <= ld_108 - Ask || ld_108 == 0.0 && ld_124 <= Ask - ld_100 || ld_100 == 0.0) return (1);
      break;
   case 32:
      if (!(Ask - ld_68 > ld_132 && ld_124 <= ld_68 - ld_84 || ld_84 == 0.0 && ld_124 <= ld_76 - ld_68 || ld_76 == 0.0)) break;
      if (ld_124 <= Ask - ld_92 && ld_124 <= ld_92 - ld_108 || ld_108 == 0.0 && ld_124 <= ld_100 - ld_92 || ld_100 == 0.0) return (1);
      break;
   case 33:
      if (!(ld_68 - Bid > ld_132 && ld_124 <= ld_84 - ld_68 || ld_84 == 0.0 && ld_124 <= ld_68 - ld_76 || ld_76 == 0.0)) break;
      if (ld_124 <= ld_92 - Bid && ld_124 <= ld_108 - ld_92 || ld_108 == 0.0 && ld_124 <= ld_92 - ld_100 || ld_100 == 0.0) return (1);
      break;
   case 34:
      if (!(ld_68 - Ask > ld_132 && ld_124 <= ld_68 - ld_84 || ld_84 == 0.0 && ld_124 <= ld_76 - ld_68 || ld_76 == 0.0)) break;
      if (ld_124 <= ld_92 - Ask && ld_124 <= ld_92 - ld_108 || ld_108 == 0.0 && ld_124 <= ld_100 - ld_92 || ld_100 == 0.0) return (1);
      break;
   case 35:
      if (!(Bid - ld_68 > ld_132 && ld_124 <= ld_84 - ld_68 || ld_84 == 0.0 && ld_124 <= ld_68 - ld_76 || ld_76 == 0.0)) break;
      if (ld_124 <= Bid - ld_92 && ld_124 <= ld_108 - ld_92 || ld_108 == 0.0 && ld_124 <= ld_92 - ld_100 || ld_100 == 0.0) return (1);
      break;
   }
   return (0);
}

// 938363B042E987609BD8B876255B9679
void f0_73988() {
   Comment("            FX-Shock v4.13 " + Symbol() + "  " + Period(), 
      "\n", "            Forex Account Server:", AccountServer(), 
      "\n", "            Symbol: ", Symbol(), 
      "\n", "            Price:  ", NormalizeDouble(Bid, 4), 
      "\n", "            Date: ", Month(), "-", Day(), "-", Year(), " Server Time: ", Hour(), ":", Minute(), ":", Seconds(), 
   "\n");
}

// FFCAA643B493573EC6A0A6AFE59C37B8
void f0_127919() {
   int li_unused_4;
   string ls_unused_20;
   string ls_unused_28;
   string ls_unused_36;
   string ticket_44;
   string text_52;
   double color_60;
   if (history == TRUE) {
      for (int pos_0 = 0; pos_0 < OrdersHistoryTotal(); pos_0++) {
         OrderSelect(pos_0, SELECT_BY_POS, MODE_HISTORY);
         if (OrderSymbol() == Symbol()) {
            if ((g_magic_1068 == -1 && g_magic_1072 == -1 && g_magic_1076 == -1 && g_magic_1080 == -1 && g_magic_1084 == -1 && g_magic_1088 == -1 && g_magic_1092 == -1 && g_magic_1096 == -1 &&
               g_magic_1100 == -1 && g_magic_1104 == -1 && gi_1116 == -1 && gi_1120 == -1 && gi_1124 == -1 && gi_1128 == -1 && gi_1132 == -1 && gi_1136 == -1 && gi_1140 == -1 && gi_1144 == -1 &&
               gi_1148 == -1 && gi_1152 == -1) || OrderMagicNumber() == g_magic_1068 || OrderMagicNumber() == g_magic_1072 || OrderMagicNumber() == g_magic_1076 || OrderMagicNumber() == g_magic_1080 ||
               OrderMagicNumber() == g_magic_1084 || OrderMagicNumber() == g_magic_1088 || OrderMagicNumber() == g_magic_1092 || OrderMagicNumber() == g_magic_1096 || OrderMagicNumber() == g_magic_1100 ||
               OrderMagicNumber() == g_magic_1104 || OrderTicket() == gi_1116 || OrderTicket() == gi_1120 || OrderTicket() == gi_1124 || OrderTicket() == gi_1128 || OrderTicket() == gi_1132 ||
               OrderTicket() == gi_1136 || OrderTicket() == gi_1140 || OrderTicket() == gi_1144 || OrderTicket() == gi_1148 || OrderTicket() == gi_1152) {
               switch (OrderType()) {
               case OP_BUY:
                  li_unused_4 = 1;
                  color_60 = TOB_Color;
                  ticket_44 = OrderTicket();
                  text_52 = DoubleToStr(OrderOpenPrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) + " -> " + DoubleToStr(OrderClosePrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) 
                     + "\nBuy: " + DoubleToStr(OrderLots(), 2) 
                     + "\nProfit: " + DoubleToStr(OrderProfit(), 2) 
                  + "\nmagic: " + OrderMagicNumber();
                  break;
               case OP_SELL:
                  li_unused_4 = 2;
                  color_60 = TOS_Color;
                  ticket_44 = OrderTicket();
                  text_52 = DoubleToStr(OrderOpenPrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) + " -> " + DoubleToStr(OrderClosePrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) 
                     + "\nSell: " + DoubleToStr(OrderLots(), 2) 
                     + "\nProfit: " + DoubleToStr(OrderProfit(), 2) 
                  + "\nmagic: " + OrderMagicNumber();
                  break;
               case OP_BUYLIMIT:
                  li_unused_4 = 1;
                  color_60 = OOB_Color;
                  ticket_44 = OrderTicket();
                  text_52 = "\n" 
                     + DoubleToStr(OrderOpenPrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) + " -> " + DoubleToStr(OrderClosePrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) 
                     + "\nBuyLimit: " + DoubleToStr(OrderLots(), 2) 
                  + "\nmagic: " + OrderMagicNumber();
                  break;
               case OP_BUYSTOP:
                  li_unused_4 = 1;
                  color_60 = OOB_Color;
                  ticket_44 = OrderTicket();
                  text_52 = DoubleToStr(OrderOpenPrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) + " -> " + DoubleToStr(OrderClosePrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) 
                     + "\nBuyStop: " + DoubleToStr(OrderLots(), 2) 
                  + "\nmagic: " + OrderMagicNumber();
                  break;
               case OP_SELLLIMIT:
                  li_unused_4 = 2;
                  color_60 = OOB_Color;
                  ticket_44 = OrderTicket();
                  text_52 = DoubleToStr(OrderOpenPrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) + " -> " + DoubleToStr(OrderClosePrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) 
                     + "\nSellLimit: " + DoubleToStr(OrderLots(), 2) 
                  + "\nmagic: " + OrderMagicNumber();
                  break;
               case OP_SELLSTOP:
                  li_unused_4 = 2;
                  color_60 = OOB_Color;
                  ticket_44 = OrderTicket();
                  text_52 = DoubleToStr(OrderOpenPrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) + " -> " + DoubleToStr(OrderClosePrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) 
                     + "\nSllStop: " + DoubleToStr(OrderLots(), 2) 
                  + "\nmagic: " + OrderMagicNumber();
               }
               ObjectCreate("орд .№: " + ticket_44, OBJ_TREND, 0, OrderOpenTime(), OrderOpenPrice(), OrderCloseTime(), OrderClosePrice());
               ObjectSet("орд .№: " + ticket_44, OBJPROP_STYLE, STYLE_DOT);
               ObjectSet("орд .№: " + ticket_44, OBJPROP_WIDTH, 1);
               ObjectSet("орд .№: " + ticket_44, OBJPROP_RAY, FALSE);
               ObjectSet("орд .№: " + ticket_44, OBJPROP_COLOR, color_60);
               ObjectSetText("орд .№: " + ticket_44, text_52);
               ObjectCreate("орд .№: " + ticket_44 + " ", OBJ_ARROW, 0, OrderCloseTime(), OrderClosePrice());
               ObjectSet("орд .№: " + ticket_44 + " ", OBJPROP_ARROWCODE, 3);
               ObjectSet("орд .№: " + ticket_44 + " ", OBJPROP_COLOR, color_60);
               ObjectSetText("орд .№: " + ticket_44 + " ", text_52);
            }
         }
      }
   }
}

// B53A5EDA65DD2C5C76918FE4BE35941D
void f0_90721() {
   double order_open_price_56;
   double order_open_price_64;
   double ld_72;
   double ld_80;
   double color_100;
   double ld_0 = f0_73257(0);
   double ld_8 = AccountBalance() - ld_0;
   double ld_16 = 100.0 * (ld_0 / ld_8);
   string name_24 = gs_1204 + "1";
   if (ObjectFind(name_24) == -1) {
      ObjectCreate(name_24, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_24, OBJPROP_CORNER, 1);
      ObjectSet(name_24, OBJPROP_XDISTANCE, 10);
      ObjectSet(name_24, OBJPROP_YDISTANCE, 15);
   }
   ObjectSetText(name_24, "Заработок сегодня: " + DoubleToStr(ld_0, 2) + "  $" + " | " + DoubleToStr(ld_16, 2) + "  %", 10, "System", Yellow);
   double ld_32 = f0_73257(1);
   ld_8 = AccountBalance() - ld_0 - ld_32;
   ld_16 = 100.0 * (ld_32 / ld_8);
   name_24 = gs_1204 + "2";
   if (ObjectFind(name_24) == -1) {
      ObjectCreate(name_24, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_24, OBJPROP_CORNER, 1);
      ObjectSet(name_24, OBJPROP_XDISTANCE, 10);
      ObjectSet(name_24, OBJPROP_YDISTANCE, 30);
   }
   ObjectSetText(name_24, "Заработок вчера: " + DoubleToStr(ld_32, 2) + "  $" + " | " + DoubleToStr(ld_16, 2) + "  %", 10, "System", Yellow);
   double ld_40 = f0_37138();
   if (ld_40 < gd_1196) gd_1196 = ld_40;
   name_24 = gs_1204 + "3";
   if (ObjectFind(name_24) == -1) {
      ObjectCreate(name_24, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_24, OBJPROP_CORNER, 1);
      ObjectSet(name_24, OBJPROP_XDISTANCE, 10);
      ObjectSet(name_24, OBJPROP_YDISTANCE, 45);
   }
   ObjectSetText(name_24, "Просадка общая: " + DoubleToStr(ld_40, 2) + " | " + DoubleToStr(gd_1196, 2) + "  $", 10, "System", Yellow);
   double ld_48 = 100.0 * ((-ld_40) / AccountBalance());
   if (ld_48 >= gd_1172) gd_1172 = ld_48;
   else gd_1172 = gd_1172;
   name_24 = gs_1204 + "4";
   if (ObjectFind(name_24) == -1) {
      ObjectCreate(name_24, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_24, OBJPROP_CORNER, 1);
      ObjectSet(name_24, OBJPROP_XDISTANCE, 10);
      ObjectSet(name_24, OBJPROP_YDISTANCE, 60);
   }
   ObjectSetText(name_24, "Просадка общая: " + DoubleToStr(ld_48, 2) + " | " + DoubleToStr(gd_1172, 2) + "  %", 10, "System", Yellow);
   int count_88 = 0;
   int count_92 = 0;
   for (int pos_96 = 0; pos_96 < OrdersTotal(); pos_96++) {
      if (OrderSelect(pos_96, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderMagicNumber() == gia_840[0] || OrderMagicNumber() == gia_840[1] && OrderSymbol() == Symbol()) {
            if (OrderType() == OP_BUY) {
               count_88++;
               if (count_88 == 1) order_open_price_56 = OrderOpenPrice();
            }
            if (OrderMagicNumber() == gia_840[0] || OrderMagicNumber() == gia_840[1] && OrderType() == OP_SELL) {
               count_92++;
               if (count_92 == 1) order_open_price_64 = OrderOpenPrice();
            }
         }
      }
   }
   if (count_88 <= 0) ld_72 = 0;
   else ld_72 = Bid - order_open_price_56;
   if (count_92 <= 0) ld_80 = 0;
   else ld_80 = order_open_price_64 - Ask;
   if (ld_72 < gd_1180) gd_1180 = ld_72;
   else gd_1180 = gd_1180;
   if (ld_80 < gd_1188) gd_1188 = ld_80;
   else gd_1188 = gd_1188;
   double ld_108 = f0_124986();
   if (ld_108 == 0.0) color_100 = Yellow;
   if (ld_108 > 0.0) color_100 = Lime;
   if (ld_108 < 0.0) color_100 = Red;
   name_24 = gs_1204 + "5";
   if (ObjectFind(name_24) == -1) {
      ObjectCreate(name_24, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_24, OBJPROP_CORNER, 1);
      ObjectSet(name_24, OBJPROP_XDISTANCE, 10);
      ObjectSet(name_24, OBJPROP_YDISTANCE, 75);
   }
   ObjectSetText(name_24, "Ордеров Buy: " + DoubleToStr(count_88, 0) + " | " + DoubleToStr(ld_108, 2) + "  $", 10, "System", color_100);
   double ld_116 = f0_59911();
   if (ld_116 == 0.0) color_100 = Yellow;
   if (ld_116 > 0.0) color_100 = Lime;
   if (ld_116 < 0.0) color_100 = Red;
   name_24 = gs_1204 + "6";
   if (ObjectFind(name_24) == -1) {
      ObjectCreate(name_24, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_24, OBJPROP_CORNER, 1);
      ObjectSet(name_24, OBJPROP_XDISTANCE, 10);
      ObjectSet(name_24, OBJPROP_YDISTANCE, 90);
   }
   ObjectSetText(name_24, "Ордеров Sell: " + DoubleToStr(count_92, 0) + " | " + DoubleToStr(ld_116, 2) + "  $", 10, "System", color_100);
   name_24 = gs_1204 + "7";
   if (ObjectFind(name_24) == -1) {
      ObjectCreate(name_24, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_24, OBJPROP_CORNER, 1);
      ObjectSet(name_24, OBJPROP_XDISTANCE, 10);
      ObjectSet(name_24, OBJPROP_YDISTANCE, 120);
   }
   ObjectSetText(name_24, "Баланс: " + DoubleToStr(AccountBalance(), 2), 12, "System", Yellow);
   int spread_124 = MarketInfo(Symbol(), MODE_SPREAD);
   name_24 = gs_1204 + "8";
   if (ObjectFind(name_24) == -1) {
      ObjectCreate(name_24, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_24, OBJPROP_CORNER, 1);
      ObjectSet(name_24, OBJPROP_XDISTANCE, 10);
      ObjectSet(name_24, OBJPROP_YDISTANCE, 140);
   }
   ObjectSetText(name_24, OrderSymbol() + "  M" + Period() + "  Плечо:" + DoubleToStr(AccountLeverage(), 0) + "  Спрэд:" + DoubleToStr(spread_124, 0), 10, "System",
      Aqua);
}

// 49A35D32F6861FDBED450FA77ED44707
double f0_37138() {
   double ld_ret_0 = 0;
   for (int pos_8 = OrdersTotal() - 1; pos_8 >= 0; pos_8--) {
      OrderSelect(pos_8, SELECT_BY_POS, MODE_TRADES);
      if (OrderMagicNumber() == gia_840[0] || OrderMagicNumber() == gia_840[1] && OrderSymbol() == Symbol() && OrderType() == OP_BUY || OrderType() == OP_SELL) ld_ret_0 += OrderProfit();
   }
   return (ld_ret_0);
}

// 92106D273A87E0D4E98361E7DB777FFA
double f0_73257(int ai_0) {
   double ld_ret_4 = 0;
   for (int pos_12 = 0; pos_12 < OrdersHistoryTotal(); pos_12++) {
      if (!(OrderSelect(pos_12, SELECT_BY_POS, MODE_HISTORY))) break;
      if (OrderSymbol() == Symbol())
         if (OrderCloseTime() >= iTime(Symbol(), PERIOD_D1, ai_0) && OrderCloseTime() < iTime(Symbol(), PERIOD_D1, ai_0) + 86400) ld_ret_4 = ld_ret_4 + OrderProfit() + OrderCommission() + OrderSwap();
   }
   return (ld_ret_4);
}

// FA01070DA6E21155FC6AD8BBC8278C29
double f0_124986() {
   double ld_ret_0 = 0;
   for (int pos_8 = OrdersTotal() - 1; pos_8 >= 0; pos_8--) {
      OrderSelect(pos_8, SELECT_BY_POS, MODE_TRADES);
      if (OrderMagicNumber() == gia_840[0] || OrderMagicNumber() == gia_840[1] && OrderSymbol() == Symbol() && OrderType() == OP_BUY) ld_ret_0 += OrderProfit();
   }
   return (ld_ret_0);
}

// 7740F3B30ED502B2A24169C3E19D5C1E
double f0_59911() {
   double ld_ret_0 = 0;
   for (int pos_8 = OrdersTotal() - 1; pos_8 >= 0; pos_8--) {
      OrderSelect(pos_8, SELECT_BY_POS, MODE_TRADES);
      if (OrderMagicNumber() == gia_840[0] || OrderMagicNumber() == gia_840[1] && OrderSymbol() == Symbol() && OrderType() == OP_SELL) ld_ret_0 += OrderProfit();
   }
   return (ld_ret_0);
}

// 97265C974964F68E43402B476A8AA8AB
void f0_75770() {
   string name_0 = gs_1204 + "L_1";
   if (ObjectFind(name_0) == -1) {
      ObjectCreate(name_0, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_0, OBJPROP_CORNER, 0);
      ObjectSet(name_0, OBJPROP_XDISTANCE, 440);
      ObjectSet(name_0, OBJPROP_YDISTANCE, 7);
   }
   ObjectSetText(name_0, "FX-Shock", 24, "Times New Roman", Gold);
   name_0 = gs_1204 + "L_2";
   if (ObjectFind(name_0) == -1) {
      ObjectCreate(name_0, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_0, OBJPROP_CORNER, 0);
      ObjectSet(name_0, OBJPROP_XDISTANCE, 430);
      ObjectSet(name_0, OBJPROP_YDISTANCE, 42);
   }
   ObjectSetText(name_0, "Classic v4.20", 16, "Arial", Gold);
   name_0 = gs_1204 + "L_3";
   if (ObjectFind(name_0) == -1) {
      ObjectCreate(name_0, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_0, OBJPROP_CORNER, 0);
      ObjectSet(name_0, OBJPROP_XDISTANCE, 397);
      ObjectSet(name_0, OBJPROP_YDISTANCE, 75);
   }
   ObjectSetText(name_0, "www.fx-investor.com.ua", 16, "Arial", White);
   name_0 = gs_1204 + "L_4";
   if (ObjectFind(name_0) == -1) {
      ObjectCreate(name_0, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_0, OBJPROP_CORNER, 0);
      ObjectSet(name_0, OBJPROP_XDISTANCE, 382);
      ObjectSet(name_0, OBJPROP_YDISTANCE, 57);
   }
   ObjectSetText(name_0, "___________________________", 12, "Arial", Blue);
   name_0 = gs_1204 + "L_5";
   if (ObjectFind(name_0) == -1) {
      ObjectCreate(name_0, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_0, OBJPROP_CORNER, 0);
      ObjectSet(name_0, OBJPROP_XDISTANCE, 382);
      ObjectSet(name_0, OBJPROP_YDISTANCE, 83);
   }
   ObjectSetText(name_0, "___________________________", 12, "Arial", Yellow);
   name_0 = gs_1204 + "L_6";
   if (ObjectFind(name_0) == -1) {
      ObjectCreate(name_0, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_0, OBJPROP_CORNER, 0);
      ObjectSet(name_0, OBJPROP_XDISTANCE, 382);
      ObjectSet(name_0, OBJPROP_YDISTANCE, 86);
   }
   ObjectSetText(name_0, "___________________________", 12, "Arial", Yellow);
   name_0 = gs_1204 + "L_7";
   if (ObjectFind(name_0) == -1) {
      ObjectCreate(name_0, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_0, OBJPROP_CORNER, 0);
      ObjectSet(name_0, OBJPROP_XDISTANCE, 382);
      ObjectSet(name_0, OBJPROP_YDISTANCE, 60);
   }
   ObjectSetText(name_0, "___________________________", 12, "Arial", Blue);
   name_0 = gs_1204 + "L_8";
   if (ObjectFind(name_0) == -1) {
      ObjectCreate(name_0, OBJ_LABEL, 0, 0, 0);
      ObjectSet(name_0, OBJPROP_CORNER, 0);
      ObjectSet(name_0, OBJPROP_XDISTANCE, 396);
      ObjectSet(name_0, OBJPROP_YDISTANCE, 74);
   }
   ObjectSetText(name_0, "www.fx-investor.com.ua", 16, "Arial", Black);
}

// D49302C611C739CC565CF8C50FAE94E7
double f0_106357(string a_symbol_0, int a_cmd_8, int a_magic_12 = 0, double a_pips_16 = 0.0) {
   int li_48;
   double ld_24 = 0.0;
   double ld_32 = 0.0;
   double ld_ret_40 = 0.0;
   int order_total_52 = OrdersTotal();
   for (int pos_56 = order_total_52 - 1; pos_56 >= 0; pos_56--) {
      OrderSelect(pos_56, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == a_symbol_0) {
         if (OrderMagicNumber() == a_magic_12 || a_magic_12 == 0) {
            if (OrderType() == a_cmd_8) {
               li_48++;
               ld_32 += OrderLots();
               ld_24 += OrderOpenPrice() * OrderLots();
            }
         }
      }
   }
   if (li_48 > 0) {
      if (a_cmd_8 == OP_BUY) {
         ld_ret_40 = ld_24 / ld_32 + a_pips_16 * MarketInfo(a_symbol_0, MODE_POINT) / (MarketInfo(a_symbol_0, MODE_TICKVALUE) * ld_32) + MarketInfo(a_symbol_0, MODE_SPREAD) * MarketInfo(a_symbol_0,
            MODE_POINT);
         gd_unused_1020 = ld_32;
      } else {
         ld_ret_40 = ld_24 / ld_32 - a_pips_16 * MarketInfo(a_symbol_0, MODE_POINT) / (MarketInfo(a_symbol_0, MODE_TICKVALUE) * ld_32) - MarketInfo(a_symbol_0, MODE_SPREAD) * MarketInfo(a_symbol_0,
            MODE_POINT);
         gd_unused_1028 = ld_32;
      }
   }
   return (ld_ret_40);
}

// F279A48F784B90100D413CA55DFC9BFD
void f0_121269() {
   int li_unused_24;
   string ls_unused_40;
   string ls_unused_48;
   string ls_unused_56;
   string ticket_64;
   string text_72;
   double color_80;
   int ind_counted_0 = IndicatorCounted();
   double price_8 = f0_106357(Symbol(), OP_BUY, gi_992, gd_984);
   double price_16 = f0_106357(Symbol(), OP_SELL, gi_992, gd_984);
   int window_4 = 0;
   if (ObjectFind(NameBuy) == -1) ObjectCreate(NameBuy, OBJ_HLINE, window_4, 0, price_8);
   ObjectSet(NameBuy, OBJPROP_PRICE1, price_8);
   ObjectSet(NameBuy, OBJPROP_COLOR, ColorBuy);
   if (ObjectFind(NameSell) == -1) ObjectCreate(NameSell, OBJ_HLINE, window_4, 0, price_16);
   ObjectSet(NameSell, OBJPROP_PRICE1, price_16);
   ObjectSet(NameSell, OBJPROP_COLOR, ColorSell);
   if (history == TRUE) {
      for (g_pos_1056 = 0; g_pos_1056 < OrdersHistoryTotal(); g_pos_1056++) {
         OrderSelect(g_pos_1056, SELECT_BY_POS, MODE_HISTORY);
         if (OrderSymbol() == Symbol()) {
            if ((g_magic_1068 == -1 && g_magic_1072 == -1 && g_magic_1076 == -1 && g_magic_1080 == -1 && g_magic_1084 == -1 && g_magic_1088 == -1 && g_magic_1092 == -1 && g_magic_1096 == -1 &&
               g_magic_1100 == -1 && g_magic_1104 == -1 && gi_1116 == -1 && gi_1120 == -1 && gi_1124 == -1 && gi_1128 == -1 && gi_1132 == -1 && gi_1136 == -1 && gi_1140 == -1 && gi_1144 == -1 &&
               gi_1148 == -1 && gi_1152 == -1) || OrderMagicNumber() == g_magic_1068 || OrderMagicNumber() == g_magic_1072 || OrderMagicNumber() == g_magic_1076 || OrderMagicNumber() == g_magic_1080 ||
               OrderMagicNumber() == g_magic_1084 || OrderMagicNumber() == g_magic_1088 || OrderMagicNumber() == g_magic_1092 || OrderMagicNumber() == g_magic_1096 || OrderMagicNumber() == g_magic_1100 ||
               OrderMagicNumber() == g_magic_1104 || OrderTicket() == gi_1116 || OrderTicket() == gi_1120 || OrderTicket() == gi_1124 || OrderTicket() == gi_1128 || OrderTicket() == gi_1132 ||
               OrderTicket() == gi_1136 || OrderTicket() == gi_1140 || OrderTicket() == gi_1144 || OrderTicket() == gi_1148 || OrderTicket() == gi_1152) {
               switch (OrderType()) {
               case OP_BUY:
                  li_unused_24 = 1;
                  color_80 = TOB_Color;
                  ticket_64 = OrderTicket();
                  text_72 = DoubleToStr(OrderOpenPrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) + " -> " + DoubleToStr(OrderClosePrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) 
                     + "\nBuy: " + DoubleToStr(OrderLots(), 2) 
                     + "\nProfit: " + DoubleToStr(OrderProfit(), 2) 
                  + "\nmagic: " + OrderMagicNumber();
                  break;
               case OP_SELL:
                  li_unused_24 = 2;
                  color_80 = TOS_Color;
                  ticket_64 = OrderTicket();
                  text_72 = DoubleToStr(OrderOpenPrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) + " -> " + DoubleToStr(OrderClosePrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) 
                     + "\nSell: " + DoubleToStr(OrderLots(), 2) 
                     + "\nProfit: " + DoubleToStr(OrderProfit(), 2) 
                  + "\nmagic: " + OrderMagicNumber();
                  break;
               case OP_BUYLIMIT:
                  li_unused_24 = 1;
                  color_80 = OOB_Color;
                  ticket_64 = OrderTicket();
                  text_72 = "\n" 
                     + DoubleToStr(OrderOpenPrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) + " -> " + DoubleToStr(OrderClosePrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) 
                     + "\nBuyLimit: " + DoubleToStr(OrderLots(), 2) 
                  + "\nmagic: " + OrderMagicNumber();
                  break;
               case OP_BUYSTOP:
                  li_unused_24 = 1;
                  color_80 = OOB_Color;
                  ticket_64 = OrderTicket();
                  text_72 = DoubleToStr(OrderOpenPrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) + " -> " + DoubleToStr(OrderClosePrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) 
                     + "\nBuyStop: " + DoubleToStr(OrderLots(), 2) 
                  + "\nmagic: " + OrderMagicNumber();
                  break;
               case OP_SELLLIMIT:
                  li_unused_24 = 2;
                  color_80 = OOB_Color;
                  ticket_64 = OrderTicket();
                  text_72 = DoubleToStr(OrderOpenPrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) + " -> " + DoubleToStr(OrderClosePrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) 
                     + "\nSellLimit: " + DoubleToStr(OrderLots(), 2) 
                  + "\nmagic: " + OrderMagicNumber();
                  break;
               case OP_SELLSTOP:
                  li_unused_24 = 2;
                  color_80 = OOB_Color;
                  ticket_64 = OrderTicket();
                  text_72 = DoubleToStr(OrderOpenPrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) + " -> " + DoubleToStr(OrderClosePrice(), MarketInfo(OrderSymbol(), MODE_DIGITS)) 
                     + "\nSllStop: " + DoubleToStr(OrderLots(), 2) 
                  + "\nmagic: " + OrderMagicNumber();
               }
               ObjectCreate("орд .№: " + ticket_64, OBJ_TREND, 0, OrderOpenTime(), OrderOpenPrice(), OrderCloseTime(), OrderClosePrice());
               ObjectSet("орд .№: " + ticket_64, OBJPROP_STYLE, STYLE_DOT);
               ObjectSet("орд .№: " + ticket_64, OBJPROP_WIDTH, 1);
               ObjectSet("орд .№: " + ticket_64, OBJPROP_RAY, FALSE);
               ObjectSet("орд .№: " + ticket_64, OBJPROP_COLOR, color_80);
               ObjectSetText("орд .№: " + ticket_64, text_72);
               ObjectCreate("орд .№: " + ticket_64 + " ", OBJ_ARROW, 0, OrderCloseTime(), OrderClosePrice());
               ObjectSet("орд .№: " + ticket_64 + " ", OBJPROP_ARROWCODE, 3);
               ObjectSet("орд .№: " + ticket_64 + " ", OBJPROP_COLOR, color_80);
               ObjectSetText("орд .№: " + ticket_64 + " ", text_72);
            }
         }
      }
   }
}

// BC1C0187CADC020EA9C9F74A9C168024
int f0_94111(int ai_0) {
   switch (ai_0) {
   case 0:
      return (1);
   case 1:
      return (0);
   }
   return (0);
}

Recommend