Navigation:Home > Content >

PipStrider_II_.mq4

Time: 2010-02-19 | Download file:PipStrider_II_.mq4

//=============================================================================================
//Decompiled & Modified by lptuyen at www.forexisbiz.com (FIB Forum)
//Profile: http://www.forexisbiz.com/member.php/11057-lptuyen?tab=aboutme#aboutme
//Email: Lptuyen_fx@yahoo.com
//Another forum: lptuyen at WWI
//Profile: http://worldwide-invest.org/members/48543-lptuyen?tab=aboutme#aboutme
//=============================================================================================

#property copyright "Copyright © 2010-2013 Forex-Goldmine, Inc."
#property link      "http://www.pipstrider.com"

bool Gi_76 = TRUE;
bool Gi_unused_80 = TRUE;
int Gi_unused_84 = D'19.04.2001 18:25:21';
int Gi_unused_88 = 8;
int Gi_unused_92 = 7;
int Gi_unused_96 = 35;
string Gs_100 = "PipStrider II v_1.36 ";
extern string version2 = "PipStrider II v_1.36 ";
extern string OWN = "Copyright © 2010-2013, Forex-Goldmine, Inc.";
bool Gi_unused_124 = TRUE;
extern string _Comment = "PipStrider II v_1.36 ";
extern bool DoTrades = TRUE;
bool Gi_140 = FALSE;
extern bool MonitorAndClose = FALSE;
bool Gi_148 = FALSE;
bool Gi_152 = TRUE;
extern bool AllowLotsBeyondMaxSize = FALSE;
extern bool ModifyMartingale = TRUE;
bool Gi_164 = TRUE;
extern double LotsMultiplier = 1.19;
double Gd_176 = 1.19;
double Gd_unused_184 = 1.19;
int Gi_unused_192 = 0;
double Gd_unused_196 = 1.19;
int Gi_unused_204 = 20;
extern int TradeDirection = 3;
int Gi_212 = 33;
double Gd_216 = 0.0;
double Gd_224 = 0.0;
extern int TradeRange = 12;
extern double TradeRangeMultiplier = 1.44;
extern double ProfitTargetPercent = 0.03;
extern double ProfitTargetMultiplier = 1.03;
double Gd_260 = 0.0;
double Gd_268 = 0.0;
double Gd_276 = 0.0;
double Gd_284 = 0.0;
bool Gi_292 = TRUE;
bool Gi_296 = FALSE;
double Gd_300 = 5.0;
int Gi_308 = 0;
bool Gi_312 = TRUE;
extern int StopLoss = 0;
string Gs_320 = "----------------------------------------------";
string Gs_unused_328 = " Martingale Disrupter (tm) Technology";
bool Gi_336 = TRUE;
bool Gi_340 = FALSE;
double Gd_344 = 2.0;
double Gd_352 = 2.0;
double Gd_360 = -10.0;
bool Gi_368 = TRUE;
bool Gi_372 = TRUE;
bool Gi_376 = FALSE;
extern int MaxMartingaleLevel = 14;
int Gi_384 = 14;
int Gi_388 = 14;
extern bool CloseTradesBeyondMaxLevel = FALSE;
extern int ExpandPipsLevel = 12;
extern int ExpandPipsLevel2 = 13;
extern int ExpandPips = 0;
extern int ExpandPips2 = 0;
int Gi_412 = 0;
bool Gi_416 = FALSE;
bool Gi_420 = FALSE;
bool Gi_424 = FALSE;
bool Gi_428 = FALSE;
int Gi_432 = 8;
double Gd_436 = 1.0;
extern double MaxDrawDownPct = 100.0;
extern bool StopTradingOnMaxDrawdownPercent = FALSE;
bool Gi_456 = FALSE;
bool Gi_460 = TRUE;
int Gi_464 = 100;
int Gi_unused_468 = 0;
int Gi_unused_472 = 0;
extern string a3 = "----------------------------------------------";
extern double TradeLots = 0.0;
extern double BalanceFactor = 4000.0;
double Gd_500 = 0.0;
double Gd_508 = 0.0;
bool Gi_516 = FALSE;
string Gs_unused_520 = "Set to -1 to set 0 or a positive number to set actual value";
double Gd_528 = -1.0;
double Gd_536 = 1000.0;
extern int MagicNumber = 734775;
int Gi_548 = 54432;
bool Gi_552 = FALSE;
int Gi_556 = 0;
int Gi_560 = 0;
bool Gi_564 = TRUE;
bool Gi_568 = TRUE;
bool Gi_572 = TRUE;
bool Gi_576 = TRUE;
bool Gi_580 = TRUE;
bool Gi_584 = TRUE;
bool Gi_588 = FALSE;
extern int LookBackDays = 60;
extern int LookBackMinimumPips = 125;
extern double CenterPrice = 1.0;
double Gd_608 = 2.0;
bool Gi_616 = TRUE;
int G_period_620 = 7;
string Gs_unused_624 = "---- Caution! For Emergency Closing of Trades ---";
bool Gi_632 = FALSE;
bool Gi_636 = FALSE;
int Gi_unused_640 = 40;
int Gi_644 = 40;
int Gi_648 = 40;
int Gi_652 = 30;
int Gi_656 = 0;
double Gd_unused_660 = 20.0;
double Gd_668 = 0.01;
bool Gi_676 = FALSE;
bool Gi_680 = FALSE;
string Gs_unused_684 = " ";
double Gd_692 = 0.0;
double Gd_700 = 0.0;
double G_order_open_price_708 = 0.0;
double G_order_open_price_716 = 0.0;
double Gd_724 = 0.0;
double Gd_732 = 0.0;
double Gd_unused_740 = 0.0;
int G_order_total_748 = 0;
int G_error_752 = 0/* NO_ERROR */;
double G_order_open_price_756 = 0.0;
double Gd_unused_764 = 0.0;
int Gi_772 = 0;
int Gi_776 = 0;
string G_comment_780 = " ";
int Gi_788 = 3;
int G_color_792 = CLR_NONE;
int G_color_796 = CLR_NONE;
bool Gi_800 = FALSE;
double Gd_unused_804 = 0.0;
double Gd_unused_812 = 0.0;
string Gs_unused_820 = " ";
int Gi_unused_828 = 0;
int Gi_unused_832 = 0;
int Gi_unused_836 = 0;
double Gd_unused_840 = 0.0;
int Gi_unused_848 = 0;
int Gi_unused_852 = 0;
int Gi_unused_856 = 0;
double Gd_unused_860 = 0.0;
int Gi_868 = 0;
int Gi_872 = 0;
int Gi_876 = 0;
int Gi_880 = 0;
int Gi_884 = 0;
double Gd_888 = 0.0;
double Gd_896 = 0.0;
int Gi_unused_904 = 0;
int Gi_unused_908 = 0;
int Gi_unused_912 = 0;
int Gi_unused_916 = 0;
int Gi_unused_920 = 0;
double Gd_unused_924 = 98765.43;
double Gd_unused_932 = 98765.43;
int Gi_940 = 2;
int G_slippage_944 = 10;
double Gd_948 = 0.0;
double Gd_956 = 0.0;
bool G_bool_964 = TRUE;
double Gd_968 = 0.0;
double Gd_976 = 0.0;
int G_count_984 = 0;
int G_count_988 = 0;
int G_count_992 = 0;
int Gi_996 = 0;
int G_global_var_1000 = 0;
int G_global_var_1004 = 0;
int Gi_1008 = 0;
int G_day_1012 = 0;
int G_hour_1016 = 0;
string G_dbl2str_1020 = "";
double Gd_1028 = 0.0;
double Gd_1036 = 0.0;
double G_order_lots_1044 = 0.0;
double G_order_lots_1052 = 0.0;
double Gd_1060 = 0.0;
double Gd_1068 = 0.0;
bool Gi_1076 = FALSE;
double Gd_1080 = 0.0;
double Gd_1088 = 0.0;
double Gd_1096 = 0.0;
double Gda_1104[3];
double Gda_1108[3];
double Gda_1112[3];
double Gda_1116[3];
double Gd_1120 = 0.0;
double Gd_unused_1128 = 0.0;
double Gd_1136 = 0.0;
double Gd_1144 = 0.0;
double Gd_unused_1152 = 0.0;
double Gd_1160 = 0.0;
int Gi_1168 = 0;
double Gd_1172 = 0.0;
double Gd_1180 = 0.0;
bool Gi_1188 = FALSE;
int Gi_1192 = 0;
int Gi_1196 = 30;
int Gi_1200 = 0;
int Gi_1204 = 0;
int Gi_unused_1208 = 0;
int Gi_1212 = 0;
double Gd_1216 = 0.0;
int Gi_1224 = 0;
double Gd_1228 = 0.0;
double Gd_1236 = 0.0;
int Gi_1244 = 0;
int Gi_1248 = 0;
double Gd_unused_1252 = 0.0;
double Gd_unused_1260 = 0.0;
double Gd_1268 = 0.0;
string Gs_1276 = " ";
int Gi_1284 = 0;
int Gi_1288 = 0;
int Gi_1292 = 0;
int Gi_1296 = 0;
int Gi_1300 = 0;
int Gi_1304 = 0;
int Gi_1308 = 0;
int Gi_1312 = 0;
int Gi_1316 = 0;
int Gi_1320 = 0;
int Gi_1324 = 0;
int Gi_1328 = 0;
int Gi_1332 = 0;
int Gi_1336 = 0;
int Gi_1340 = 0;
int Gi_1344 = 0;
int Gi_1348 = 0;
int Gi_1352 = 0;
int Gi_unused_1356 = 0;
int Gi_unused_1360 = 0;
double Gd_1364 = 0.0;
double Gd_1372 = 0.0;
int Gi_1380 = 0;
double Gd_1384 = 0.0;
double Gd_1392 = 0.0;
double Gd_1400 = 0.0;
bool Gi_unused_1408 = FALSE;
double G_ihigh_1412 = 0.0;
double G_ilow_1420 = 0.0;
double Gd_1428 = 0.0;
double Gd_1436 = 0.0;
bool Gi_1444 = FALSE;
int Gi_1448 = 0;
int Gi_1452 = 0;
double Gd_unused_1456 = 0.0;
double Gd_unused_1464 = 0.0;
double Gd_unused_1472 = 0.0;
int Gi_unused_1480 = 0;
int Gi_1484 = 0;
int Gi_unused_1488 = 0;
int Gi_unused_1492 = 7;
int Gi_unused_1496 = 35;
int Gi_unused_1500 = 0;
int Gi_unused_1504 = 0;

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   if (Gi_556 != 0 && Gi_556 != 60 && Gi_556 != 240 && Gi_556 != 480 && Gi_556 != 720 && Gi_556 != 1440) {
      Comment("Send_Frequency setting can only be 0, 60, 240, 480, 720 or 1440");
      return (-1);
   }
   if (Gi_560 < 0 || Gi_560 > 59) {
      Comment("Send_Minute must be between 0 and 59");
      return (-1);
   }
   if (Gi_76) {
      Gi_1484 = FALSE;
      Gi_1484 = f0_15();
      if (Gi_1484 != TRUE) {
         Comment("This EA is not licensed for this account");
         return (-1);
      }
   }
   Gi_1484 = TRUE;
   f0_9();
   if (TradeDirection == 7 && Gi_308 == 0) Gi_308 = TradeRange;
   Gd_unused_184 = LotsMultiplier;
   Gi_unused_1360 = 0;
   Gi_868 = TradeRange;
   Gi_872 = TradeRange;
   Gi_876 = TradeRange;
   Gd_888 = TradeRange;
   Gd_896 = TradeRange;
   Gi_880 = TradeRange;
   Gi_884 = TradeRange;
   Gd_1088 = 0.0;
   Gd_1096 = 0.0;
   Gi_unused_1208 = 30;
   Gi_1192 = FALSE;
   Gi_412 = 0;
   Gi_464 = 100;
   Gd_360 = -10.0;
   Gi_1188 = Gi_148;
   Gi_1248 = 10000;
   Gi_1244 = 0;
   Gd_unused_1252 = 0.0;
   Gd_unused_1260 = 0.0;
   Gi_1284 = 0;
   Gi_1288 = 0;
   Gi_1292 = 0;
   Gi_1296 = 0;
   Gi_1300 = 0;
   Gi_1304 = 0;
   Gi_1308 = 0;
   Gi_1312 = 0;
   Gi_1316 = 0;
   Gi_1320 = 0;
   Gi_1324 = 0;
   Gi_1328 = 0;
   Gi_1332 = 0;
   Gi_1336 = 0;
   Gi_1340 = 0;
   Gi_1344 = 0;
   Gi_1348 = 0;
   Gi_1352 = 0;
   Gi_unused_1356 = 0;
   Gi_1448 = FALSE;
   Gi_1452 = FALSE;
   Gd_268 = ProfitTargetPercent;
   Gd_284 = ProfitTargetPercent;
   Gi_384 = MaxMartingaleLevel;
   Gi_388 = MaxMartingaleLevel;
   if (TradeRangeMultiplier != 1.0) Gi_148 = 1;
   if (TradeRangeMultiplier != 1.0) Gi_1188 = TRUE;
   if (LotsMultiplier < 2.0) Gi_148 = 1;
   if (LotsMultiplier < 2.0) Gi_1188 = TRUE;
   if (CloseTradesBeyondMaxLevel) {
      Gi_416 = TRUE;
      Gi_420 = TRUE;
   }
   double lotsize_0 = MarketInfo(Symbol(), MODE_LOTSIZE);
   Gd_344 /= 100000 / lotsize_0;
   Gd_352 /= 100000 / lotsize_0;
   Gd_360 /= 100000 / lotsize_0;
   ArrayInitialize(Gda_1104, 0.0);
   ArrayInitialize(Gda_1108, 0.0);
   ArrayInitialize(Gda_1112, 0.0);
   ArrayInitialize(Gda_1116, 0.0);
   if (StringSubstr(Gs_320, 0, 1) == "3") {
      Gi_412 = 6;
      Gi_464 = 100;
      Gd_360 = -10.0;
   }
   G_dbl2str_1020 = DoubleToStr(MagicNumber, 0);
   G_dbl2str_1020 = StringSubstr(G_dbl2str_1020, 0, 2);
   if (!IsTesting()) {
      if (!GlobalVariableCheck("GVMaxBuyLevel" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVMaxBuyLevel" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVMaxSellLevel" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVMaxSellLevel" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVMaxDailyDrawdown" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVMaxDailyDrawdown" + G_dbl2str_1020 + Symbol(), 0.0);
      if (!GlobalVariableCheck("GVMaxMarginUtilization" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVMaxMarginUtilization" + G_dbl2str_1020 + Symbol(), 0.0);
      if (!GlobalVariableCheck("GVMaxMarginUtilizationEver" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVMaxMarginUtilizationEver" + G_dbl2str_1020 + Symbol(), 0.0);
      if (!GlobalVariableCheck("GVSaveDrawDownPct" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVSaveDrawDownPct" + G_dbl2str_1020 + Symbol(), 0.0);
      if (!GlobalVariableCheck("GVFundsWithdrawn" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVFundsWithdrawn" + G_dbl2str_1020 + Symbol(), 0.0);
      if (!GlobalVariableCheck("GVStealthMode" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVStealthMode" + G_dbl2str_1020 + Symbol(), Gi_148);
      if (!GlobalVariableCheck("GVlevel1counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel1counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel2counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel2counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel3counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel3counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel4counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel4counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel5counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel5counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel6counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel6counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel7counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel7counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel8counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel8counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel9counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel9counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel10counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel10counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel10counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel10counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel11counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel11counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel12counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel12counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel13counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel13counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel14counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel14counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel15counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel15counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel16counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel16counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel17counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel17counter" + G_dbl2str_1020 + Symbol(), 0);
      if (!GlobalVariableCheck("GVlevel18counter" + G_dbl2str_1020 + Symbol())) GlobalVariableSet("GVlevel18counter" + G_dbl2str_1020 + Symbol(), 0);
   }
   if (!IsTesting()) f0_12();
   Gd_1060 = AccountBalance() - Gd_1068;
   if (Gd_1060 < Gd_500) Gd_1060 += Gd_1068;
   if (Gd_528 > 0.0) {
      Gd_1068 = Gd_528;
      GlobalVariableSet("GVFundsWithdrawn" + G_dbl2str_1020 + Symbol(), Gd_528);
      Gd_528 = 0.0;
      if (!IsTesting()) f0_21();
   }
   if (Gd_528 < 0.0) {
      Gd_1068 = 0.0;
      GlobalVariableSet("GVFundsWithdrawn" + G_dbl2str_1020 + Symbol(), 0.0);
      Gd_528 = 0.0;
      if (!IsTesting()) f0_21();
   }
   Gd_1060 = AccountBalance() - Gd_1068;
   if (Gd_1060 < Gd_500) Gd_1060 += Gd_1068;
   G_bool_964 = DoTrades;
   if (MarketInfo(Symbol(), MODE_MINLOT) < 1.0) Gi_940 = 1;
   if (MarketInfo(Symbol(), MODE_MINLOT) < 0.1) Gi_940 = 2;
   if (MarketInfo(Symbol(), MODE_MINLOT) < 0.01) Gi_940 = 3;
   if (MarketInfo(Symbol(), MODE_MINLOT) < 0.001) Gi_940 = 4;
   if (MarketInfo(Symbol(), MODE_MINLOT) < 0.0001) Gi_940 = 5;
   Gi_1196 = 30;
   f0_16();
   if (Digits == 5 || Digits == 3) {
      StopLoss = 10 * StopLoss;
      ExpandPips = 10 * ExpandPips;
      ExpandPips2 = 10 * ExpandPips2;
      Gi_464 = 10 * Gi_464;
      Gi_1196 = 300;
      Gi_308 = 10 * Gi_308;
      Gd_300 = 10.0 * Gd_300;
      LookBackMinimumPips = 10 * LookBackMinimumPips;
   }
   Gi_1224 = Gi_868;
   Gi_unused_640 = Gi_868;
   Gi_644 = Gi_868;
   Gi_648 = Gi_868;
   Gi_652 = Gi_868;
   f0_13();
   f0_1();
   Gd_unused_924 = 98765.43;
   Gd_unused_932 = 98765.43;
   f0_0();
   f0_9();
   if (Gi_588) {
      G_global_var_1004 = 0;
      G_global_var_1000 = 0;
      if (!IsTesting()) f0_21();
   }
   if (Gi_656 >= 0) {
      Gd_176 = LotsMultiplier;
      Gd_668 = Gd_700 * Gd_176;
      if (Gd_176 < 2.0) Gi_148 = 1;
      if (Gd_176 < 2.0) Gi_1188 = TRUE;
      if (ModifyMartingale && G_count_988 <= 1) Gd_668 = Gd_732;
      Gd_668 = NormalizeDouble(Gd_668, Gi_940);
      if (Gd_668 <= Gd_700 && G_count_988 > 1 && Gi_940 == 2) Gd_668 = NormalizeDouble(Gd_668 + 0.01, Gi_940);
      if (Gd_668 <= Gd_700 && G_count_988 > 1 && Gi_940 == 1) Gd_668 = NormalizeDouble(Gd_668 + 0.1, Gi_940);
      if (Gd_668 <= Gd_700 && G_count_988 > 1 && Gi_940 == 0) Gd_668 = NormalizeDouble(Gd_668 + 1.0, Gi_940);
      Gd_888 = Gi_872;
      Gd_260 = Gd_268;
      for (int Li_8 = 1; Li_8 <= G_count_988 - 1; Li_8++) {
         Gd_888 *= TradeRangeMultiplier;
         Gd_260 *= ProfitTargetMultiplier;
      }
      Gi_880 = MathFloor(Gd_888);
      Gi_644 = Gi_880;
      if (Gi_460 && ExpandPipsLevel != 0 && G_count_988 >= ExpandPipsLevel) Gi_644 = Gi_880 + ExpandPips;
      if (Gi_460 && ExpandPipsLevel2 != 0 && G_count_988 >= ExpandPipsLevel2) Gi_644 = Gi_880 + ExpandPips2;
      if (Gi_460 && Gi_412 != 0 && G_count_988 >= Gi_412) Gi_644 = Gi_880 + Gi_464;
      Gd_968 = Gd_668;
      Gd_948 = G_order_open_price_716 - Gi_644 * Point;
   }
   if (Gi_656 <= 0) {
      Gd_176 = LotsMultiplier;
      Gd_668 = Gd_692 * Gd_176;
      if (Gd_176 < 2.0) Gi_148 = 1;
      if (Gd_176 < 2.0) Gi_1188 = TRUE;
      if (ModifyMartingale && G_count_992 == 1) Gd_668 = Gd_732;
      Gd_668 = NormalizeDouble(Gd_668, Gi_940);
      if (Gd_668 <= Gd_692 && G_count_992 > 1 && Gi_940 == 2) Gd_668 = NormalizeDouble(Gd_668 + 0.01, Gi_940);
      if (Gd_668 <= Gd_692 && G_count_992 > 1 && Gi_940 == 1) Gd_668 = NormalizeDouble(Gd_668 + 0.1, Gi_940);
      if (Gd_668 <= Gd_692 && G_count_992 > 1 && Gi_940 == 0) Gd_668 = NormalizeDouble(Gd_668 + 1.0, Gi_940);
      Gd_896 = Gi_876;
      Gd_276 = Gd_284;
      for (Li_8 = 1; Li_8 <= G_count_992 - 1; Li_8++) {
         Gd_896 *= TradeRangeMultiplier;
         Gd_276 *= ProfitTargetMultiplier;
      }
      Gi_884 = MathFloor(Gd_896);
      Gi_648 = Gi_884;
      if (Gi_460 && ExpandPipsLevel != 0 && G_count_992 >= ExpandPipsLevel) Gi_648 = Gi_884 + ExpandPips;
      if (Gi_460 && ExpandPipsLevel2 != 0 && G_count_992 >= ExpandPipsLevel2) Gi_648 = Gi_884 + ExpandPips2;
      if (Gi_460 && Gi_412 != 0 && G_count_992 >= Gi_412) Gi_648 = Gi_884 + Gi_464;
      Gd_976 = Gd_668;
      Gd_956 = G_order_open_price_708 + Gi_648 * Point;
   }
   if (TradeRangeMultiplier > 1.0) Gi_148 = 1;
   if (TradeRangeMultiplier > 1.0) Gi_1188 = TRUE;
   if (Gd_692 == 0.0) G_count_992 = 0;
   if (Gd_700 == 0.0) G_count_988 = 0;
   if (G_count_992 > G_global_var_1004) G_global_var_1004 = G_count_992;
   if (G_count_988 > G_global_var_1000) G_global_var_1000 = G_count_988;
   f0_2();
   if (!IsTesting()) f0_21();
   if (Gi_680 || StringSubstr(Gs_320, 0, 1) == "m") f0_28();
   f0_11();
   if (!IsTesting()) f0_3();
   return (0);
}
	 	  		  	  	 		 	     	  	 		 	 	 		     	  	   	  				  		    	 					 	      			 		 				 	 							  	   		 							  	 	 		  		 	      				 			 
// 52D46093050F38C27267BCE42543EF60
int deinit() {
   Gd_1060 = AccountBalance() - Gd_1068;
   if (Gd_1060 < Gd_500 / 10.0 || Gd_1060 < 0.0) Gd_1060 = AccountBalance();
   Print("Min TradeRange Was " + Gi_1248);
   Print("Max TradeRange Was " + Gi_1244);
   Print("Max DrawDown Percent For Past Day = " + DoubleToStr(100.0 * Gd_1384, 2));
   Print("Max Margin Utilization Percentage vs. Equity For Latest Trade Sequence = " + DoubleToStr(100.0 * Gd_1392, 2));
   Print("Max Margin Utilization Percentage Ever Reached = " + DoubleToStr(100.0 * Gd_1400, 2));
   Print("Max DrawDown Percent Ever Reached Was " + DoubleToStr(100.0 * Gd_1236, 2));
   Print("Max Buy Martingale Level Reached Was " + G_global_var_1000);
   Print("Max Sell Martingale Level Reached Was " + G_global_var_1004);
   int Li_0 = Gi_1284 + Gi_1288 + Gi_1292 + Gi_1296 + Gi_1300 + Gi_1304 + Gi_1308 + Gi_1312 + Gi_1316 + Gi_1320 + Gi_1324 + Gi_1328 + Gi_1332 + Gi_1336 + Gi_1340 + Gi_1344 +
      Gi_1348 + Gi_1352;
   double Ld_4 = Li_0;
   double Ld_12 = Gi_1284;
   double Ld_20 = Gi_1288;
   double Ld_28 = Gi_1292;
   double Ld_36 = Gi_1296;
   double Ld_44 = Gi_1300;
   double Ld_52 = Gi_1304;
   double Ld_60 = Gi_1308;
   double Ld_68 = Gi_1312;
   double Ld_76 = Gi_1316;
   double Ld_84 = Gi_1320;
   double Ld_92 = Gi_1324;
   double Ld_100 = Gi_1328;
   double Ld_108 = Gi_1332;
   double Ld_116 = Gi_1336;
   double Ld_124 = Gi_1340;
   double Ld_132 = Gi_1344;
   double Ld_140 = Gi_1348;
   double Ld_148 = Gi_1352;
   double Ld_156 = 100.0 * (Ld_12 / Ld_4);
   double Ld_164 = 100.0 * (Ld_20 / Ld_4);
   double Ld_172 = 100.0 * (Ld_28 / Ld_4);
   double Ld_180 = 100.0 * (Ld_36 / Ld_4);
   double Ld_188 = 100.0 * (Ld_44 / Ld_4);
   double Ld_196 = 100.0 * (Ld_52 / Ld_4);
   double Ld_204 = 100.0 * (Ld_60 / Ld_4);
   double Ld_212 = 100.0 * (Ld_68 / Ld_4);
   double Ld_220 = 100.0 * (Ld_76 / Ld_4);
   double Ld_228 = 100.0 * (Ld_84 / Ld_4);
   double Ld_236 = 100.0 * (Ld_92 / Ld_4);
   double Ld_244 = 100.0 * (Ld_100 / Ld_4);
   double Ld_252 = 100.0 * (Ld_108 / Ld_4);
   double Ld_260 = 100.0 * (Ld_116 / Ld_4);
   double Ld_268 = 100.0 * (Ld_124 / Ld_4);
   double Ld_276 = 100.0 * (Ld_132 / Ld_4);
   double Ld_284 = 100.0 * (Ld_140 / Ld_4);
   double Ld_292 = 100.0 * (Ld_148 / Ld_4);
   if (Gi_1284 > 0) Print("Level 1 Counter = " + Gi_1284 + "     % of total trades = " + DoubleToStr(Ld_156, 2) + " %");
   if (Gi_1288 > 0) Print("Level 2 Counter = " + Gi_1288 + "     % of total trades = " + DoubleToStr(Ld_164, 2) + " %");
   if (Gi_1292 > 0) Print("Level 3 Counter = " + Gi_1292 + "     % of total trades = " + DoubleToStr(Ld_172, 2) + " %");
   if (Gi_1296 > 0) Print("Level 4 Counter = " + Gi_1296 + "     % of total trades = " + DoubleToStr(Ld_180, 2) + " %");
   if (Gi_1300 > 0) Print("Level 5 Counter = " + Gi_1300 + "     % of total trades = " + DoubleToStr(Ld_188, 2) + " %");
   if (Gi_1304 > 0) Print("Level 6 Counter = " + Gi_1304 + "     % of total trades = " + DoubleToStr(Ld_196, 2) + " %");
   if (Gi_1308 > 0) Print("Level 7 Counter = " + Gi_1308 + "     % of total trades = " + DoubleToStr(Ld_204, 2) + " %");
   if (Gi_1312 > 0) Print("Level 8 Counter = " + Gi_1312 + "     % of total trades = " + DoubleToStr(Ld_212, 2) + " %");
   if (Gi_1316 > 0) Print("Level 9 Counter = " + Gi_1316 + "     % of total trades = " + DoubleToStr(Ld_220, 2) + " %");
   if (Gi_1320 > 0) Print("Level 10 Counter = " + Gi_1320 + "     % of total trades = " + DoubleToStr(Ld_228, 2) + " %");
   if (Gi_1324 > 0) Print("Level 11 Counter = " + Gi_1324 + "     % of total trades = " + DoubleToStr(Ld_236, 2) + " %");
   if (Gi_1328 > 0) Print("Level 12 Counter = " + Gi_1328 + "     % of total trades = " + DoubleToStr(Ld_244, 2) + " %");
   if (Gi_1332 > 0) Print("Level 13 Counter = " + Gi_1332 + "     % of total trades = " + DoubleToStr(Ld_252, 2) + " %");
   if (Gi_1336 > 0) Print("Level 14 Counter = " + Gi_1336 + "     % of total trades = " + DoubleToStr(Ld_260, 2) + " %");
   if (Gi_1340 > 0) Print("Level 15 Counter = " + Gi_1340 + "     % of total trades = " + DoubleToStr(Ld_268, 2) + " %");
   if (Gi_1344 > 0) Print("Level 16 Counter = " + Gi_1344 + "     % of total trades = " + DoubleToStr(Ld_276, 2) + " %");
   if (Gi_1348 > 0) Print("Level 17 Counter = " + Gi_1348 + "     % of total trades = " + DoubleToStr(Ld_284, 2) + " %");
   if (Gi_1352 > 0) Print("Level 18 Counter = " + Gi_1352 + "     % of total trades = " + DoubleToStr(Ld_292, 2) + " %");
   Print("Total Trades Within Displayed Levels = " + Li_0);
   Print("Working Balance Was " + DoubleToStr(Gd_1060, 2));
   Print("Funds Withdrawn Was " + DoubleToStr(Gd_1068, 2));
   f0_25();
   return (0);
}
		  	 	   	  			  	 		 	 	     	  		 	   	  	     	   		 	 			  		 	  	 			 		 		 		 				 			 			  				  	 		 			  				 		 					  	 		  	  		 		 
// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   double Ld_0;
   double Ld_8;
   double Ld_16;
   int Li_24;
   bool Li_28;
   int Li_32;
   double Ld_36;
   double Ld_44;
   double Ld_52;
   double Ld_60;
   double Ld_68;
   double Ld_76;
   double Ld_84;
   double Ld_92;
   double Ld_100;
   double Ld_108;
   double Ld_116;
   double Ld_124;
   double Ld_132;
   double Ld_140;
   double Ld_148;
   double Ld_156;
   double Ld_164;
   double Ld_172;
   double Ld_180;
   double Ld_188;
   double Ld_196;
   double Ld_204;
   double Ld_212;
   double Ld_220;
   double Ld_228;
   double Ld_236;
   double Ld_244;
   double Ld_252;
   double Ld_260;
   double Ld_268;
   double Ld_276;
   double Ld_284;
   double Ld_292;
   double Ld_300;
   double Ld_308;
   double Ld_316;
   double Ld_324;
   if (Gi_556 != 0 && Gi_556 != 60 && Gi_556 != 240 && Gi_556 != 480 && Gi_556 != 720 && Gi_556 != 1440) {
      Comment("Send_Frequency setting can only be 0, 60, 240, 480, 720 or 1440");
      return (-1);
   }
   if (Gi_560 < 0 || Gi_560 > 59) {
      Comment("Send_Minute must be between 0 and 59");
      return (-1);
   }
   if (!IsTesting()) f0_12();
   f0_24();
   if (Gi_516 && Gd_500 > 0.0 && Gd_508 > 0.0 && Gd_1068 > 0.0) {
      if (AccountEquity() >= Gd_500 + Gd_508) {
         Print("Close of all trades due to profit target reached");
         f0_26(OP_BUY);
         f0_26(OP_SELL);
         return (0);
      }
   }
   if (Gi_424 && Gi_1448 == TRUE) {
      Comment("\n" 
         + Gs_100, 
         "\n" 
         + "\nCurrent Server Time = " + TimeToStr(TimeCurrent(), TIME_SECONDS) 
         + "\nAccount Leverage =", AccountLeverage() 
         + "\nSpread = " + DoubleToStr(MarketInfo(Symbol(), MODE_SPREAD), 0) 
      + "\n\nTrading Stopped due to Closing of Trades Beyond Maximum Level");
      return (0);
   }
   if (StopTradingOnMaxDrawdownPercent && Gi_1452 == TRUE) {
      Comment("\n" 
         + Gs_100, 
         "\n" 
         + "\nCurrent Server Time = " + TimeToStr(TimeCurrent(), TIME_SECONDS) 
         + "\nAccount Leverage =", AccountLeverage() 
         + "\nSpread = " + DoubleToStr(MarketInfo(Symbol(), MODE_SPREAD), 0) 
      + "\n\nTrading Stopped due to Max DrawDownPercent Reached");
      return (0);
   }
   G_bool_964 = FALSE;
   if (DoTrades == TRUE && (DayOfWeek() == 1 && Gi_568) || (DayOfWeek() == 2 && Gi_572) || (DayOfWeek() == 3 && Gi_576) || (DayOfWeek() == 4 && Gi_580) || (DayOfWeek() == 5 &&
      Gi_584) || (DayOfWeek() == 0 && Gi_564)) G_bool_964 = TRUE;
   f0_13();
   f0_1();
   if (!Gi_336) f0_14();
   if (Gi_336) f0_19();
   if (Gi_632) f0_26(OP_BUY);
   if (Gi_636) f0_26(OP_SELL);
   if (!Gi_616) f0_16();
   if (Gi_616) {
      Ld_0 = Gi_868;
      f0_16();
      if (Gi_292 && Gi_868 < Ld_0) Gi_868 = Ld_0;
   }
   if (TradeDirection == 7 && Gi_308 == 0) Gi_308 = Gi_868;
   f0_0();
   if (G_count_992 > G_global_var_1004) G_global_var_1004 = G_count_992;
   if (G_count_988 > G_global_var_1000) G_global_var_1000 = G_count_988;
   if (Gd_692 > 0.0 && Gd_700 > 0.0) Gi_1444 = FALSE;
   if (Gd_692 == 0.0 && Gd_700 == 0.0) Gi_1444 = TRUE;
   if (Hour() != G_hour_1016) {
      f0_2();
      G_hour_1016 = Hour();
   }
   f0_9();
   if (Gi_656 >= 0) {
      Gd_176 = LotsMultiplier;
      Gd_668 = Gd_700 * Gd_176;
      if (Gd_176 < 2.0) Gi_148 = 1;
      if (Gd_176 < 2.0) Gi_1188 = TRUE;
      if (ModifyMartingale && G_count_988 <= 1) Gd_668 = Gd_732;
      Gd_668 = NormalizeDouble(Gd_668, Gi_940);
      if (Gd_668 <= Gd_700 && G_count_988 > 1 && Gi_940 == 2) Gd_668 = NormalizeDouble(Gd_668 + 0.01, Gi_940);
      if (Gd_668 <= Gd_700 && G_count_988 > 1 && Gi_940 == 1) Gd_668 = NormalizeDouble(Gd_668 + 0.1, Gi_940);
      if (Gd_668 <= Gd_700 && G_count_988 > 1 && Gi_940 == 0) Gd_668 = NormalizeDouble(Gd_668 + 1.0, Gi_940);
      Gd_888 = Gi_872;
      Gd_260 = Gd_268;
      for (int Li_332 = 1; Li_332 <= G_count_988 - 1; Li_332++) {
         Gd_888 *= TradeRangeMultiplier;
         Gd_260 *= ProfitTargetMultiplier;
      }
      Gi_880 = MathFloor(Gd_888);
      Gi_644 = Gi_880;
      if (Gi_460 && ExpandPipsLevel != 0 && G_count_988 >= ExpandPipsLevel) Gi_644 = Gi_880 + ExpandPips;
      if (Gi_460 && ExpandPipsLevel2 != 0 && G_count_988 >= ExpandPipsLevel2) Gi_644 = Gi_880 + ExpandPips2;
      if (Gi_460 && Gi_412 != 0 && G_count_988 >= Gi_412) Gi_644 = Gi_880 + Gi_464;
      Gd_968 = Gd_668;
      Gd_948 = G_order_open_price_716 - Gi_644 * Point;
   }
   if (Gi_656 <= 0) {
      Gd_176 = LotsMultiplier;
      Gd_668 = Gd_692 * Gd_176;
      if (Gd_176 < 2.0) Gi_148 = 1;
      if (Gd_176 < 2.0) Gi_1188 = TRUE;
      if (ModifyMartingale && G_count_992 == 1) Gd_668 = Gd_732;
      Gd_668 = NormalizeDouble(Gd_668, Gi_940);
      if (Gd_668 <= Gd_692 && G_count_992 > 1 && Gi_940 == 2) Gd_668 = NormalizeDouble(Gd_668 + 0.01, Gi_940);
      if (Gd_668 <= Gd_692 && G_count_992 > 1 && Gi_940 == 1) Gd_668 = NormalizeDouble(Gd_668 + 0.1, Gi_940);
      if (Gd_668 <= Gd_692 && G_count_992 > 1 && Gi_940 == 0) Gd_668 = NormalizeDouble(Gd_668 + 1.0, Gi_940);
      Gd_896 = Gi_876;
      Gd_276 = Gd_284;
      for (Li_332 = 1; Li_332 <= G_count_992 - 1; Li_332++) {
         Gd_896 *= TradeRangeMultiplier;
         Gd_276 *= ProfitTargetMultiplier;
      }
      Gi_884 = MathFloor(Gd_896);
      Gi_648 = Gi_884;
      if (Gi_460 && ExpandPipsLevel != 0 && G_count_992 >= ExpandPipsLevel) Gi_648 = Gi_884 + ExpandPips;
      if (Gi_460 && ExpandPipsLevel2 != 0 && G_count_992 >= ExpandPipsLevel2) Gi_648 = Gi_884 + ExpandPips2;
      if (Gi_460 && Gi_412 != 0 && G_count_992 >= Gi_412) Gi_648 = Gi_884 + Gi_464;
      Gd_976 = Gd_668;
      Gd_956 = G_order_open_price_708 + Gi_648 * Point;
   }
   if (TradeRangeMultiplier != 1.0) Gi_148 = 1;
   if (TradeRangeMultiplier != 1.0) Gi_1188 = TRUE;
   if (LotsMultiplier < 2.0) Gi_148 = 1;
   if (LotsMultiplier < 2.0) Gi_1188 = TRUE;
   if (G_count_992 > 1 && Gd_276 != 0.0 && Gd_692 > 0.0 && f0_27(1) >= AccountBalance() * (Gd_276 / 100.0)) f0_26(OP_SELL);
   if (G_count_988 > 1 && Gd_260 != 0.0 && Gd_700 > 0.0 && f0_27(2) >= AccountBalance() * (Gd_260 / 100.0)) f0_26(OP_BUY);
   if (TradeDirection == 7 && Gd_700 == 0.0 && Gd_692 == 0.0) Gi_656 = 0;
   if (TradeDirection != 7 && Gd_700 == 0.0 && Gi_656 >= 0 && Gi_308 > 0 && Gd_1364 == 0.0) Gd_1364 = Bid - Gi_308 * Point;
   if (TradeDirection == 7 && Gd_700 == 0.0 && Gd_692 == 0.0 && Gi_308 > 0 && Gd_1364 == 0.0) {
      Gd_1364 = Bid - Gi_308 * Point;
      Print("Pending Buy Price = " + DoubleToStr(Gd_1364, Digits));
   }
   if (G_bool_964 == TRUE && TradeDirection != 7 || Gd_692 == 0.0 && MonitorAndClose == FALSE && Gi_656 >= 0 || (TradeDirection == 7 && Gd_692 == 0.0) && !Gi_140 || (Gi_140 &&
      Gi_1444) && (Gd_700 == 0.0 && Gi_308 == 0 || Ask <= Gd_1364)) {
      if (Gd_1392 != 0.0) {
         if (Gd_1392 > Gd_1400) Gd_1400 = Gd_1392;
         Print("Max Margin Utilization Percentage vs. Equity For Last Trade Sequence = " + DoubleToStr(100.0 * Gd_1392, 2));
         Gd_1392 = 0.0;
      }
      f0_16();
      Gi_1224 = Gi_872;
      if (Gi_76 && (!IsTesting())) {
         Gi_1484 = FALSE;
         Gi_1484 = f0_15();
         if (Gi_1484 != TRUE) {
            if (IsTesting()) return (0);
            f0_3();
            return (0);
         }
      }
      if (f0_6() == 1) f0_7(Gd_732, MagicNumber);
      Gi_1284++;
      Gd_700 = Gd_732;
      Gi_unused_1360 = 0;
      Gd_1372 = 0.0;
      Gd_1364 = 0.0;
      if (TradeRange == 7) Gd_1372 = 0.0;
      ArrayInitialize(Gda_1104, 0.0);
      ArrayInitialize(Gda_1108, 0.0);
      ArrayInitialize(Gda_1112, 0.0);
      ArrayInitialize(Gda_1116, 0.0);
      Gi_1200 = FALSE;
      Gi_unused_1356 = 0;
      Gi_unused_1208 = 30;
   }
   if (TradeDirection != 7 && Gd_692 == 0.0 && Gi_656 <= 0 && Gi_308 > 0 && Gd_1372 == 0.0) Gd_1372 = Ask + Gi_308 * Point;
   if (TradeDirection == 7 && Gd_700 == 0.0 && Gd_692 == 0.0 && Gi_308 > 0 && Gd_1372 == 0.0) {
      Gd_1372 = Ask + Gi_308 * Point;
      Print("Pending Sell Price = " + DoubleToStr(Gd_1372, Digits));
   }
   if (G_bool_964 == TRUE && TradeDirection != 7 || Gd_700 == 0.0 && MonitorAndClose == FALSE && Gi_656 <= 0 || (TradeDirection == 7 && Gd_700 == 0.0) && !Gi_140 || (Gi_140 &&
      Gi_1444) && (Gd_692 == 0.0 && Gi_308 == 0 || Bid >= Gd_1372)) {
      if (Gd_1392 != 0.0) {
         if (Gd_1392 > Gd_1400) Gd_1400 = Gd_1392;
         Print("Max Margin Utilization Percentage vs. Equity For Last Trade Sequence = " + DoubleToStr(100.0 * Gd_1392, 2));
         Gd_1392 = 0.0;
      }
      f0_16();
      Gi_1224 = Gi_876;
      if (Gi_76 && (!IsTesting())) {
         Gi_1484 = FALSE;
         Gi_1484 = f0_15();
         if (Gi_1484 != TRUE) {
            if (IsTesting()) return (0);
            f0_3();
            return (0);
         }
      }
      if (f0_6() == 1) f0_18(Gd_732, MagicNumber);
      Gi_1284++;
      Gd_692 = Gd_732;
      Gd_1372 = 0.0;
      Gd_1364 = 0.0;
      if (TradeRange == 7) Gd_1364 = 0.0;
      Gi_unused_1360 = 0;
      ArrayInitialize(Gda_1104, 0.0);
      ArrayInitialize(Gda_1108, 0.0);
      ArrayInitialize(Gda_1112, 0.0);
      ArrayInitialize(Gda_1116, 0.0);
      Gi_1204 = FALSE;
      Gi_unused_1356 = 0;
      Gi_unused_1208 = 30;
   }
   if (G_bool_964 == TRUE || MonitorAndClose == TRUE && Gi_656 >= 0 && Gd_700 > 0.0) {
      if ((!Gi_296 && Ask <= Gd_948) || (Gi_296 && Ask <= Gd_948 && Ask >= Gd_948 - Gd_300 * Point)) {
         G_count_988 = f0_22(2);
         G_count_988++;
         f0_4(Gd_968);
         if (G_count_984 > G_count_988) G_count_988 = G_count_984;
         if (Gi_384 == 0 || (G_count_988 <= Gi_384 && Gi_384 > 0)) {
            if (f0_6() == 1) f0_7(Gd_968, MagicNumber);
            if (G_count_988 == 2) Gi_unused_1408 = TRUE;
            ArrayInitialize(Gda_1104, 0.0);
            ArrayInitialize(Gda_1108, 0.0);
            ArrayInitialize(Gda_1112, 0.0);
            ArrayInitialize(Gda_1116, 0.0);
            if (G_count_988 == 2) Gi_1288++;
            if (G_count_988 == 3) Gi_1292++;
            if (G_count_988 == 4) Gi_1296++;
            if (G_count_988 == 5) Gi_1300++;
            if (G_count_988 == 6) Gi_1304++;
            if (G_count_988 == 7) Gi_1308++;
            if (G_count_988 == 8) Gi_1312++;
            if (G_count_988 == 9) Gi_1316++;
            if (G_count_988 == 10) Gi_1320++;
            if (G_count_988 == 11) Gi_1324++;
            if (G_count_988 == 12) Gi_1328++;
            if (G_count_988 == 13) Gi_1332++;
            if (G_count_988 == 14) Gi_1336++;
            if (G_count_988 == 15) Gi_1340++;
            if (G_count_988 == 16) Gi_1344++;
            if (G_count_988 == 17) Gi_1348++;
            if (G_count_988 >= 18) Gi_1352++;
            Gi_1200 = FALSE;
            Gi_unused_1356 = 0;
            Gi_unused_1208 = 30;
            Gd_1372 = 0.0;
            Gd_1364 = 0.0;
         }
         if (Gi_384 > 0 && G_count_988 > Gi_384 && Gi_428 && f0_10(1, Gi_548) == 0.0) {
            if (Ask <= G_order_open_price_716 - (Gi_432 - Gi_388) * Gi_648 * Point) {
               Print("** Putting Sell Hedge Trade on.");
               Gd_1436 = NormalizeDouble(Gd_1436, Gi_940);
               Ld_8 = Gd_1436 * Gd_436;
               Ld_8 = NormalizeDouble(Ld_8, Gi_940);
               if (f0_6() == 1) f0_18(Ld_8, Gi_548);
            }
         }
         if (Gi_384 > 0 && G_count_988 > Gi_384 && Gi_416) {
            Print("Close of all buy trades due to max martingale level surpassed.");
            f0_26(OP_BUY);
            if (Gi_424) Gi_1448 = TRUE;
         }
      }
   }
   if (G_bool_964 == TRUE || MonitorAndClose == TRUE && Gi_656 <= 0 && Gd_692 > 0.0) {
      if ((!Gi_296 && Bid >= Gd_956) || (Gi_296 && Bid >= Gd_956 && Bid <= Gd_956 + Gd_300 * Point)) {
         G_count_992 = f0_22(1);
         G_count_992++;
         f0_4(Gd_976);
         if (G_count_984 > G_count_992) G_count_992 = G_count_984;
         if (Gi_388 == 0 || (G_count_992 <= Gi_388 && Gi_388 > 0)) {
            if (f0_6() == 1) f0_18(Gd_976, MagicNumber);
            if (G_count_992 == 2) Gi_unused_1408 = TRUE;
            ArrayInitialize(Gda_1104, 0.0);
            ArrayInitialize(Gda_1108, 0.0);
            ArrayInitialize(Gda_1112, 0.0);
            ArrayInitialize(Gda_1116, 0.0);
            if (G_count_992 == 2) Gi_1288++;
            if (G_count_992 == 3) Gi_1292++;
            if (G_count_992 == 4) Gi_1296++;
            if (G_count_992 == 5) Gi_1300++;
            if (G_count_992 == 6) Gi_1304++;
            if (G_count_992 == 7) Gi_1308++;
            if (G_count_992 == 8) Gi_1312++;
            if (G_count_992 == 9) Gi_1316++;
            if (G_count_992 == 10) Gi_1320++;
            if (G_count_992 == 11) Gi_1324++;
            if (G_count_992 == 12) Gi_1328++;
            if (G_count_992 == 13) Gi_1332++;
            if (G_count_992 == 14) Gi_1336++;
            if (G_count_992 == 15) Gi_1340++;
            if (G_count_992 == 16) Gi_1344++;
            if (G_count_992 == 17) Gi_1348++;
            if (G_count_992 >= 18) Gi_1352++;
            Gi_1204 = FALSE;
            Gi_unused_1356 = 0;
            Gi_unused_1208 = 30;
            Gd_1372 = 0.0;
            Gd_1364 = 0.0;
         }
         if (Gi_388 > 0 && G_count_992 > Gi_388 && Gi_428 && f0_10(2, Gi_548) == 0.0) {
            if (Bid >= (Gi_432 - Gi_388) * Gi_648 * Point + G_order_open_price_708) {
               Print("** Putting Buy Hedge Trade on");
               Gd_1428 = NormalizeDouble(Gd_1428, Gi_940);
               Ld_16 = Gd_1428 * Gd_436;
               Ld_16 = NormalizeDouble(Ld_16, Gi_940);
               if (f0_6() == 1) f0_7(Ld_16, Gi_548);
            }
         }
         if (Gi_388 > 0 && G_count_992 > Gi_388 && Gi_420) {
            Print("Close of all sell trades due to max martingale level surpassed.");
            f0_26(OP_SELL);
            if (Gi_424) Gi_1448 = TRUE;
         }
      }
   }
   f0_11();
   f0_8();
   if (!IsTesting()) f0_21();
   if (Gi_552) {
      Li_24 = Gi_560 + 15;
      if (Li_24 > 59) Li_24 -= 60;
      if (Minute() > Li_24) Gi_996 = FALSE;
      if (Gi_996 == FALSE) {
         Li_28 = FALSE;
         if (Gi_556 == 60 && Minute() >= Gi_560 && Minute() < Li_24) Li_28 = TRUE;
         if (Gi_556 == 240 && Minute() >= Gi_560 && Minute() < Li_24 && Hour() == 0 || Hour() == 4 || Hour() == 8 || Hour() == 12 || Hour() == 16 || Hour() == 20) Li_28 = TRUE;
         if (Gi_556 == 480 && Minute() >= Gi_560 && Minute() < Li_24 && Hour() == 0 || Hour() == 8 || Hour() == 16) Li_28 = TRUE;
         if (Gi_556 == 720 && Minute() >= Gi_560 && Minute() < Li_24 && Hour() == 0 || Hour() == 12) Li_28 = TRUE;
         if (Gi_556 == 1440 && Minute() >= Gi_560 && Minute() < Li_24 && Hour() == 0) Li_28 = TRUE;
         if (Gi_996 == TRUE) Li_28 = FALSE;
         if (Li_28) {
            f0_28();
            Gi_996 = TRUE;
         }
      }
   }
   if (IsTesting()) {
      if (Day() != G_day_1012) Gi_1008 = FALSE;
      if (Gi_1008 == FALSE) {
         f0_5();
         Print("Min TradeRange Used = " + Gi_1248);
         Print("Max TradeRange Used = " + Gi_1244);
         Print("Max DrawDown Percent For Past Day = " + DoubleToStr(100.0 * Gd_1384, 2));
         Print("Max DrawDown Percent Ever Reached is " + DoubleToStr(100.0 * Gd_1236, 2));
         Print("Max Margin Utilization Percentage Ever Reached = " + DoubleToStr(100.0 * Gd_1400, 2));
         Print("Max Buy Martingale Level Reached is " + G_global_var_1000);
         Print("Max Sell Martingale Level Reached is " + G_global_var_1004);
         Print(Gs_1276 + DoubleToStr(100.0 * Gd_1268, 2));
         Print("Current Buy TradeRange = " + Gi_872);
         Print("Current Sell TradeRange = " + Gi_876);
         Print("Current High Price = " + DoubleToStr(G_ihigh_1412, Digits));
         Print("Current High Mid Line = " + DoubleToStr(Gd_216, Digits));
         Print("Current Center Line = " + DoubleToStr(Gd_724, Digits));
         Print("Current Low Mid Line = " + DoubleToStr(Gd_224, Digits));
         Print("Current Low Price = " + DoubleToStr(G_ilow_1420, Digits));
         if (Digits == 4 || Digits == 2) Print("Current Total Range = " + DoubleToStr((G_ihigh_1412 - G_ilow_1420) / Point, 0) + " Pips");
         if (Digits == 5 || Digits == 3) Print("Current Total Range = " + DoubleToStr((G_ihigh_1412 - G_ilow_1420) / Point / 10.0, 0) + " Pips");
         if (Digits == 4 || Digits == 2) Print("Current Center Range Segment = " + DoubleToStr((Gd_216 - Gd_224) / Point, 0) + " Pips");
         if (Digits == 5 || Digits == 3) Print("Current Center Range Segment = " + DoubleToStr((Gd_216 - Gd_224) / Point / 10.0, 0) + " Pips");
         Print("Current Buy Martingale Level is " + G_count_988);
         Print("Current Sell Martingale Level is " + G_count_992);
         Li_32 = Gi_1284 + Gi_1288 + Gi_1292 + Gi_1296 + Gi_1300 + Gi_1304 + Gi_1308 + Gi_1312 + Gi_1316 + Gi_1320 + Gi_1324 + Gi_1328 + Gi_1332 + Gi_1336 + Gi_1340 + Gi_1344 +
            Gi_1348 + Gi_1352;
         Ld_36 = Li_32;
         Ld_44 = Gi_1284;
         Ld_52 = Gi_1288;
         Ld_60 = Gi_1292;
         Ld_68 = Gi_1296;
         Ld_76 = Gi_1300;
         Ld_84 = Gi_1304;
         Ld_92 = Gi_1308;
         Ld_100 = Gi_1312;
         Ld_108 = Gi_1316;
         Ld_116 = Gi_1320;
         Ld_124 = Gi_1324;
         Ld_132 = Gi_1328;
         Ld_140 = Gi_1332;
         Ld_148 = Gi_1336;
         Ld_156 = Gi_1340;
         Ld_164 = Gi_1344;
         Ld_172 = Gi_1348;
         Ld_180 = Gi_1352;
         Ld_188 = 100.0 * (Ld_44 / Ld_36);
         Ld_196 = 100.0 * (Ld_52 / Ld_36);
         Ld_204 = 100.0 * (Ld_60 / Ld_36);
         Ld_212 = 100.0 * (Ld_68 / Ld_36);
         Ld_220 = 100.0 * (Ld_76 / Ld_36);
         Ld_228 = 100.0 * (Ld_84 / Ld_36);
         Ld_236 = 100.0 * (Ld_92 / Ld_36);
         Ld_244 = 100.0 * (Ld_100 / Ld_36);
         Ld_252 = 100.0 * (Ld_108 / Ld_36);
         Ld_260 = 100.0 * (Ld_116 / Ld_36);
         Ld_268 = 100.0 * (Ld_124 / Ld_36);
         Ld_276 = 100.0 * (Ld_132 / Ld_36);
         Ld_284 = 100.0 * (Ld_140 / Ld_36);
         Ld_292 = 100.0 * (Ld_148 / Ld_36);
         Ld_300 = 100.0 * (Ld_156 / Ld_36);
         Ld_308 = 100.0 * (Ld_164 / Ld_36);
         Ld_316 = 100.0 * (Ld_172 / Ld_36);
         Ld_324 = 100.0 * (Ld_180 / Ld_36);
         if (Gi_1284 > 0) Print("Level 1 Counter = " + Gi_1284 + "     % of total trades = " + DoubleToStr(Ld_188, 2) + " %");
         if (Gi_1288 > 0) Print("Level 2 Counter = " + Gi_1288 + "     % of total trades = " + DoubleToStr(Ld_196, 2) + " %");
         if (Gi_1292 > 0) Print("Level 3 Counter = " + Gi_1292 + "     % of total trades = " + DoubleToStr(Ld_204, 2) + " %");
         if (Gi_1296 > 0) Print("Level 4 Counter = " + Gi_1296 + "     % of total trades = " + DoubleToStr(Ld_212, 2) + " %");
         if (Gi_1300 > 0) Print("Level 5 Counter = " + Gi_1300 + "     % of total trades = " + DoubleToStr(Ld_220, 2) + " %");
         if (Gi_1304 > 0) Print("Level 6 Counter = " + Gi_1304 + "     % of total trades = " + DoubleToStr(Ld_228, 2) + " %");
         if (Gi_1308 > 0) Print("Level 7 Counter = " + Gi_1308 + "     % of total trades = " + DoubleToStr(Ld_236, 2) + " %");
         if (Gi_1312 > 0) Print("Level 8 Counter = " + Gi_1312 + "     % of total trades = " + DoubleToStr(Ld_244, 2) + " %");
         if (Gi_1316 > 0) Print("Level 9 Counter = " + Gi_1316 + "     % of total trades = " + DoubleToStr(Ld_252, 2) + " %");
         if (Gi_1320 > 0) Print("Level 10 Counter = " + Gi_1320 + "     % of total trades = " + DoubleToStr(Ld_260, 2) + " %");
         if (Gi_1324 > 0) Print("Level 11 Counter = " + Gi_1324 + "     % of total trades = " + DoubleToStr(Ld_268, 2) + " %");
         if (Gi_1328 > 0) Print("Level 12 Counter = " + Gi_1328 + "     % of total trades = " + DoubleToStr(Ld_276, 2) + " %");
         if (Gi_1332 > 0) Print("Level 13 Counter = " + Gi_1332 + "     % of total trades = " + DoubleToStr(Ld_284, 2) + " %");
         if (Gi_1336 > 0) Print("Level 14 Counter = " + Gi_1336 + "     % of total trades = " + DoubleToStr(Ld_292, 2) + " %");
         if (Gi_1340 > 0) Print("Level 15 Counter = " + Gi_1340 + "     % of total trades = " + DoubleToStr(Ld_300, 2) + " %");
         if (Gi_1344 > 0) Print("Level 16 Counter = " + Gi_1344 + "     % of total trades = " + DoubleToStr(Ld_308, 2) + " %");
         if (Gi_1348 > 0) Print("Level 17 Counter = " + Gi_1348 + "     % of total trades = " + DoubleToStr(Ld_316, 2) + " %");
         if (Gi_1352 > 0) Print("Level 18 Counter = " + Gi_1352 + "     % of total trades = " + DoubleToStr(Ld_324, 2) + " %");
         Print("Total Trades Within Displayed Levels = " + Li_32);
         Print("Working Balance is " + DoubleToStr(Gd_1060, 2));
         Print("Funds Withdrawn is " + DoubleToStr(Gd_1068, 2));
         Gi_1008 = TRUE;
         G_day_1012 = Day();
         Gd_1384 = 0.0;
      }
   }
   if (!IsTesting()) f0_3();
   return (0);
}
				   	   			     	 		  				 	     				 			  		   		    		  						 	  			 	 		 	   		  	       	 	  	 	 		     	 	  	 				  	     	 				 	      
// F96D30471D3E10470383B6981C5E7039
double f0_27(int Ai_0) {
   double Ld_ret_4 = 0.0;
   bool Li_12 = FALSE;
   G_order_total_748 = OrdersTotal();
   for (int pos_16 = 0; pos_16 <= G_order_total_748 - 1; pos_16++) {
      if (!OrderSelect(pos_16, SELECT_BY_POS, MODE_TRADES)) {
         G_error_752 = GetLastError();
         Print("OrderSelect( ", pos_16, ", SELECT_BY_POS ) - Error #", G_error_752);
      } else {
         if (OrderSymbol() == Symbol()) {
            if (OrderMagicNumber() == MagicNumber) {
               if (Ai_0 == 1 && OrderType() == OP_BUY) continue;
               if (Ai_0 == 2 && OrderType() == OP_SELL) continue;
               if (OrderCloseTime() == 0) {
                  Li_12 = FALSE;
                  if (Gi_368 && Ai_0 == 2) Li_12 = TRUE;
                  if (Gi_372 && Ai_0 == 1) Li_12 = TRUE;
                  if (Gi_376 && Ai_0 == 2 && G_count_988 >= ExpandPipsLevel2 && OrderSwap() < 0.0) Li_12 = FALSE;
                  if (Gi_376 && Ai_0 == 1 && G_count_992 >= ExpandPipsLevel2 && OrderSwap() < 0.0) Li_12 = FALSE;
                  Ld_ret_4 += OrderProfit();
                  if (Li_12) Ld_ret_4 += OrderSwap();
               }
            }
         }
      }
   }
   return (Ld_ret_4);
}
	   		   		    	 		 	 		     			 			  	     			  		  	 	   		 	 	  	 	  	 	 	 						   							 			 		      			 			 		   	  		  	 		 	 	 		 			 	 
// 2230DA82D7FAFF3EA8CD4CFC92DE64E8
void f0_2() {
   int Li_0 = LookBackDays;
   G_ihigh_1412 = iHigh(Symbol(), PERIOD_D1, iHighest(Symbol(), PERIOD_D1, MODE_HIGH, Li_0, 0));
   G_ilow_1420 = iLow(Symbol(), PERIOD_D1, iLowest(Symbol(), PERIOD_D1, MODE_LOW, Li_0, 0));
   Gd_724 = (G_ihigh_1412 + G_ilow_1420) / 2.0;
   for (Gd_724 = NormalizeDouble(Gd_724, Digits); (G_ihigh_1412 - G_ilow_1420) / Point < LookBackMinimumPips && Li_0 < 365; Gd_724 = NormalizeDouble(Gd_724, Digits)) {
      Li_0++;
      G_ihigh_1412 = iHigh(Symbol(), PERIOD_D1, iHighest(Symbol(), PERIOD_D1, MODE_HIGH, Li_0, 0));
      G_ilow_1420 = iLow(Symbol(), PERIOD_D1, iLowest(Symbol(), PERIOD_D1, MODE_LOW, Li_0, 0));
      Gd_724 = (G_ihigh_1412 + G_ilow_1420) / 2.0;
   }
   if (CenterPrice != 0.0) {
      Gd_724 = CenterPrice;
      Gd_724 = NormalizeDouble(Gd_724, Digits);
   }
   double Ld_4 = (G_ihigh_1412 - G_ilow_1420) * (Gi_212 / 100.0);
   double Ld_12 = (G_ihigh_1412 - G_ilow_1420) * ((100 - Gi_212) / 100.0);
   Ld_12 = NormalizeDouble(Ld_12, Digits);
   Ld_4 = NormalizeDouble(Ld_4, Digits);
   Gd_216 = Gd_724 + Ld_4 / 2.0;
   Gd_224 = Gd_724 - Ld_4 / 2.0;
   Gd_216 = NormalizeDouble(Gd_216, Digits);
   Gd_224 = NormalizeDouble(Gd_224, Digits);
}
		 		 		  		 		   				   	 	      	  	 	 	 		  	  		  	  	  		 			    								  	 	  		 	 	 	 	 	   				 	  	 	 	   						  			   				 		   	 	  
// F7B1F0AA13347699EFAE0D924298CB02
void f0_25() {
   string name_0;
   int objs_total_8 = ObjectsTotal();
   for (int Li_12 = 0; Li_12 < objs_total_8; Li_12++) {
      name_0 = ObjectName(Li_12);
      if (name_0 != "") ObjectDelete(name_0);
   }
   ObjectDelete("FLP_txt");
   ObjectDelete("P_txt");
}
			    	    		       		  		 	 	    					 		   		    	    			 								  			   		 	  			  	  	    	 		 	 	 			    	 		 	 					 	       				 		     
// F8058EB0D24E6949E44CCCFC53A38CBD
void f0_26(int A_cmd_0) {
   int cmd_4;
   int ticket_8;
   double order_lots_12;
   string symbol_20;
   int order_total_28 = OrdersTotal();
   for (int count_32 = 0; count_32 < 5; count_32++) {
      for (int pos_36 = 0; pos_36 < order_total_28; pos_36++) {
         while (!IsTradeAllowed()) {
         }
         OrderSelect(pos_36, SELECT_BY_POS, MODE_TRADES);
         cmd_4 = OrderType();
         ticket_8 = OrderTicket();
         order_lots_12 = OrderLots();
         symbol_20 = OrderSymbol();
         if (symbol_20 == Symbol() && cmd_4 == OP_BUY && cmd_4 == A_cmd_0 && OrderMagicNumber() == MagicNumber) OrderClose(ticket_8, order_lots_12, MarketInfo(symbol_20, MODE_BID), 3, CLR_NONE);
         if (symbol_20 == Symbol() && cmd_4 == OP_SELL && cmd_4 == A_cmd_0 && OrderMagicNumber() == MagicNumber) OrderClose(ticket_8, order_lots_12, MarketInfo(symbol_20, MODE_ASK), 3, CLR_NONE);
      }
   }
}
					  	   	 	     				  			  	      			 				 		   	     		 							    			 				 	    	  	   	   	 	 		 	 		 	   	 	 		 				 		     						 	 	    
// 689C35E4872BA754D7230B8ADAA28E48
double f0_10(int Ai_0, int A_magic_4) {
   double Ld_ret_8 = 0.0;
   double order_open_price_16 = 0.0;
   G_order_total_748 = OrdersTotal();
   double Ld_unused_24 = 0.0;
   double Ld_unused_32 = 0.0;
   double Ld_40 = MathFloor(Gi_872 / 2) * Point;
   if (Ai_0 == 1) Ld_40 = MathFloor(Gi_876 / 2) * Point;
   bool Li_48 = FALSE;
   bool Li_52 = FALSE;
   if (Ai_0 == 1) Gd_1036 = 0.0;
   if (Ai_0 == 2) Gd_1028 = 0.0;
   if (Ai_0 == 1) G_order_lots_1052 = 0.0;
   if (Ai_0 == 2) G_order_lots_1044 = 0.0;
   int Li_unused_56 = 0;
   if (Ai_0 == 2 && A_magic_4 == MagicNumber) Gd_1436 = 0.0;
   if (Ai_0 == 1 && A_magic_4 == MagicNumber) Gd_1428 = 0.0;
   for (int pos_60 = G_order_total_748 - 1; pos_60 >= 0; pos_60--) {
      if (!OrderSelect(pos_60, SELECT_BY_POS, MODE_TRADES)) {
         G_error_752 = GetLastError();
         Print("OrderSelect( ", pos_60, ", SELECT_BY_POS ) - Error #", G_error_752);
      } else {
         if (OrderSymbol() == Symbol()) {
            if (OrderMagicNumber() == A_magic_4) {
               if (OrderCloseTime() == 0) {
                  if (Ai_0 == 1 && OrderType() == OP_BUY) continue;
                  if (Ai_0 == 2 && OrderType() == OP_SELL) continue;
                  if (Ai_0 == 1 && A_magic_4 == MagicNumber) Gd_1428 += OrderLots();
                  if (Ai_0 == 2 && A_magic_4 == MagicNumber) Gd_1436 += OrderLots();
                  if (Ai_0 == 2 && order_open_price_16 != 0.0 && OrderOpenPrice() > order_open_price_16 + Ld_40 || (!AllowLotsBeyondMaxSize)) {
                     if (Li_52 == FALSE) Gd_1028 = OrderOpenPrice();
                     Gd_1028 = NormalizeDouble(Gd_1028, Digits);
                     G_order_lots_1044 = OrderLots();
                     Li_52 = TRUE;
                     continue;
                  }
                  if (Ai_0 == 1 && order_open_price_16 != 0.0 && OrderOpenPrice() < order_open_price_16 - Ld_40 || (!AllowLotsBeyondMaxSize)) {
                     if (Li_48 == FALSE) Gd_1036 = OrderOpenPrice();
                     Gd_1036 = NormalizeDouble(Gd_1036, Digits);
                     G_order_lots_1052 = OrderLots();
                     Li_48 = TRUE;
                     continue;
                  }
                  if (MathAbs(order_open_price_16 - OrderOpenPrice()) > Ld_40 || (!AllowLotsBeyondMaxSize)) Ld_ret_8 = OrderLots();
                  if (MathAbs(order_open_price_16 - OrderOpenPrice()) < Ld_40 && AllowLotsBeyondMaxSize) Ld_ret_8 += OrderLots();
                  if (A_magic_4 == MagicNumber) G_order_open_price_756 = OrderOpenPrice();
                  order_open_price_16 = OrderOpenPrice();
               }
            }
         }
      }
   }
   return (Ld_ret_8);
}
			 		 		       	   	 	 			  		 	  	  					 					    	  					 		 			 	 	 	  	 	    	       			    			  							    			  	 				   	   	 		  				  	
// D362D41CFF235C066CFB390D52F4EB13
void f0_23(int Ai_0, double Ad_4) {
   double Ld_unused_12 = 0.0;
   G_order_total_748 = OrdersTotal();
   double Ld_20 = 0.0;
   double Ld_unused_28 = 0.0;
   for (int pos_36 = G_order_total_748 - 1; pos_36 >= 0; pos_36--) {
      if (!OrderSelect(pos_36, SELECT_BY_POS, MODE_TRADES)) {
         G_error_752 = GetLastError();
         Print("OrderSelect( ", pos_36, ", SELECT_BY_POS ) - Error #", G_error_752);
      } else {
         if (OrderSymbol() == Symbol()) {
            if (OrderMagicNumber() == MagicNumber) {
               if (OrderCloseTime() == 0) {
                  if (Ai_0 == 1 && OrderType() == OP_BUY) continue;
                  if (Ai_0 == 2 && OrderType() == OP_SELL) continue;
                  if (Ai_0 == 2 && Ad_4 != 0.0) Ld_20 = NormalizeDouble(Ad_4, Digits);
                  if (Ai_0 == 1 && Ad_4 != 0.0) Ld_20 = NormalizeDouble(Ad_4, Digits);
                  if (Gi_1188 == 0)
                     if (NormalizeDouble(OrderTakeProfit(), Digits) != Ld_20 && Ld_20 != 0.0) OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), NormalizeDouble(Ld_20, Digits), 0, CLR_NONE);
                  if (Gi_1188 == 1)
                     if (OrderTakeProfit() != 0.0) OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), 0.0, 0, CLR_NONE);
               }
            }
         }
      }
   }
}
	     	 			 							  	 		   	  							  	       			 	 			  	 	     		 	   	  	 	 							 			  		 	 	 		 	  	  		 	 	 		    	 						  	   	 	  			
// 9FDC179C742334D485A77A8B241EC55C
void f0_17(int Ai_0) {
   double Ld_unused_4 = 0.0;
   G_order_total_748 = OrdersTotal();
   double Ld_unused_12 = 0.0;
   double Ld_20 = 0.0;
   for (int pos_28 = G_order_total_748 - 1; pos_28 >= 0; pos_28--) {
      if (!OrderSelect(pos_28, SELECT_BY_POS, MODE_TRADES)) {
         G_error_752 = GetLastError();
         Print("OrderSelect( ", pos_28, ", SELECT_BY_POS ) - Error #", G_error_752);
      } else {
         if (OrderSymbol() == Symbol()) {
            if (OrderMagicNumber() == MagicNumber) {
               if (OrderCloseTime() == 0) {
                  if (Ai_0 == 1 && OrderType() == OP_BUY) continue;
                  if (Ai_0 == 2 && OrderType() == OP_SELL) continue;
                  if (Ai_0 == 2 && StopLoss != 0) Ld_20 = NormalizeDouble(OrderOpenPrice() - StopLoss * Point, Digits);
                  if (Ai_0 == 1 && StopLoss != 0) Ld_20 = NormalizeDouble(OrderOpenPrice() + StopLoss * Point, Digits);
                  if (Gi_1188 == 0)
                     if (StopLoss != 0 && NormalizeDouble(OrderStopLoss(), Digits) != Ld_20 && Ld_20 != 0.0) OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(Ld_20, Digits), OrderTakeProfit(), 0, CLR_NONE);
                  if (Gi_1188 == 1) {
                     if (OrderStopLoss() != 0.0) OrderModify(OrderTicket(), OrderOpenPrice(), 0.0, OrderTakeProfit(), 0, CLR_NONE);
                     if (Ld_20 != 0.0 && StopLoss != 0 && Ai_0 == 2 && Bid <= Ld_20) OrderClose(OrderTicket(), OrderLots(), MarketInfo(Symbol(), MODE_BID), 3, CLR_NONE);
                     if (Ld_20 != 0.0 && StopLoss != 0 && Ai_0 == 1 && Ask >= Ld_20) OrderClose(OrderTicket(), OrderLots(), MarketInfo(Symbol(), MODE_ASK), 3, CLR_NONE);
                  }
               }
            }
         }
      }
   }
}
			     	   		 		    						 	 			  				 			   	 	   	  					 		  				    	   			   			 	   	   	  		 	  				   	  		 	   			 	 		    		   		   		
// 50257C26C4E5E915F022247BABD914FE
int f0_6() {
   int Li_0;
   int Li_4 = 30;
   if (!IsTradeAllowed()) {
      Li_0 = GetTickCount();
      Print("Trade context is busy! Wait until it is free...");
      while (true) {
         if (IsStopped()) {
            Print("The expert was terminated by the user!");
            return (-1);
         }
         if (GetTickCount() - Li_0 > 1000 * Li_4) {
            Print("The waiting limit exceeded (" + Li_4 + " ???.)!");
            return (-2);
         }
         if (IsTradeAllowed()) {
            Print("Trade context has become free!");
            RefreshRates();
            return (1);
         }
         Sleep(100);
      }
   }
   return (1);
}
	 	   		 	  			  	   	    	 	    	 			 	  	    	 	  	 	   		 	 		 			 			    	  		 				 		 	  	 				 			  		  	 				 				 		 		  	   	 					  	  
// 5710F6E623305B2C1458238C9757193B
int f0_7(double A_lots_0, int A_magic_8) {
   int slippage_12;
   int count_16;
   int ticket_20;
   double price_24;
   double Ld_32 = MarketInfo(Symbol(), MODE_MAXLOT);
   double Ld_40 = MarketInfo(Symbol(), MODE_MINLOT);
   double Ld_48 = A_lots_0;
   double price_56 = 0.0;
   if (!AllowLotsBeyondMaxSize && Ld_48 > Ld_32) Ld_48 = Ld_32;
   price_56 = 0.0;
   price_56 = NormalizeDouble(price_56, Digits);
   while (true) {
      while (Ld_48 > 0.0) {
         A_lots_0 = Ld_48;
         if (A_lots_0 > Ld_32) A_lots_0 = Ld_32;
         if (A_lots_0 < Ld_40) A_lots_0 = Ld_40;
         A_lots_0 = NormalizeDouble(A_lots_0, Gi_940);
         Ld_48 -= A_lots_0;
         slippage_12 = G_slippage_944;
         count_16 = 0;
         ticket_20 = -1;
         price_24 = 0.0;
         if (Gi_164 == TRUE && Gi_772 != 0) {
            price_24 = Ask + Gi_772 * Point;
            price_24 = NormalizeDouble(price_24, Digits);
         }
         if (Gi_164 == FALSE && Gi_776 != 0 && Gi_772 != 0) {
            price_24 = Ask + (Gi_772 + Gi_776) * Point;
            price_24 = NormalizeDouble(price_24, Digits);
         }
         price_24 = 0.0;
         price_24 = NormalizeDouble(price_24, Digits);
         G_comment_780 = _Comment + " " + DoubleToStr(A_magic_8, 0);
         while (ticket_20 == -1 && count_16 <= Gi_788) {
            ticket_20 = OrderSend(Symbol(), OP_BUY, A_lots_0, Ask, slippage_12, price_56, price_24, G_comment_780, A_magic_8, 0, G_color_792);
            count_16++;
            if (ticket_20 >= 0) break;
            if (count_16 > Gi_788) break;
            Sleep(1000);
         }
         if (ticket_20 != 0) {
            G_error_752 = GetLastError();
            if (Gi_800 == TRUE) Alert("Error OrderSend # ", G_error_752);
         }
         if (Ld_48 > 0.0) continue;
      }
      break;
   }
   return (0);
}
			 	 		     		     		   		        	 	 	 		 	  	      	  					 					  				  		  	  	 		 	  		 	 	 						 				 	 	 													     		 		 			 	  
// A0F6E6535C856D4495BA899376567E48
int f0_18(double A_lots_0, int A_magic_8) {
   int slippage_12;
   int count_16;
   int ticket_20;
   double price_24;
   double Ld_32 = MarketInfo(Symbol(), MODE_MAXLOT);
   double Ld_40 = MarketInfo(Symbol(), MODE_MINLOT);
   double Ld_48 = A_lots_0;
   double price_56 = 0.0;
   if (!AllowLotsBeyondMaxSize && Ld_48 > Ld_32) Ld_48 = Ld_32;
   price_56 = 0.0;
   price_56 = NormalizeDouble(price_56, Digits);
   while (true) {
      while (Ld_48 > 0.0) {
         A_lots_0 = Ld_48;
         if (A_lots_0 > Ld_32) A_lots_0 = Ld_32;
         if (A_lots_0 < Ld_40) A_lots_0 = Ld_40;
         A_lots_0 = NormalizeDouble(A_lots_0, Gi_940);
         Ld_48 -= A_lots_0;
         slippage_12 = G_slippage_944;
         count_16 = 0;
         ticket_20 = -1;
         price_24 = 0.0;
         if (Gi_164 == TRUE && Gi_772 != 0) {
            price_24 = Bid - Gi_772 * Point;
            price_24 = NormalizeDouble(price_24, Digits);
         }
         if (Gi_164 == FALSE && Gi_776 != 0 && Gi_772 != 0) {
            price_24 = Bid - (Gi_772 + Gi_776) * Point;
            price_24 = NormalizeDouble(price_24, Digits);
         }
         price_24 = 0.0;
         price_24 = NormalizeDouble(price_24, Digits);
         G_comment_780 = _Comment + " " + DoubleToStr(A_magic_8, 0);
         while (ticket_20 == -1 && count_16 <= Gi_788) {
            ticket_20 = OrderSend(Symbol(), OP_SELL, A_lots_0, Bid, slippage_12, price_56, price_24, G_comment_780, A_magic_8, 0, G_color_796);
            count_16++;
            if (ticket_20 >= 0) break;
            if (count_16 > Gi_788) break;
            Sleep(1000);
         }
         if (ticket_20 != 0) {
            G_error_752 = GetLastError();
            if (Gi_800 == TRUE) Alert("Error OrderSend # ", G_error_752);
         }
         if (Ld_48 > 0.0) continue;
      }
      break;
   }
   return (0);
}
	 	 	  	 	   	   	  			   	   	  	 	 			  	 	 		 	        							 		   		   			 		 	 	  		 		   						 	  			   						 		 				   	  									    
// 2569208C5E61CB15E209FFE323DB48B7
void f0_3() {
   string Ls_0 = "TRUE";
   if (DoTrades == FALSE) Ls_0 = "FALSE";
   string Ls_8 = "False";
   if (Gi_1484 == TRUE) Ls_8 = "True";
   string Ls_16 = "False";
   if (MonitorAndClose) Ls_16 = "True";
   int Li_24 = G_count_988;
   int Li_28 = G_count_992;
   if (Gd_692 == 0.0) G_count_992 = 0;
   if (Gd_700 == 0.0) G_count_988 = 0;
   string Ls_unused_32 = "False";
   if (Gi_460) Ls_unused_32 = "True";
   string Ls_unused_40 = "True ";
   if (!Gi_416) Ls_unused_40 = "False";
   string Ls_unused_48 = "True ";
   if (!Gi_420) Ls_unused_48 = "False";
   f0_5();
   string Ls_56 = "Buy and Sell";
   if (TradeDirection == -1) Ls_56 = "Sell Only";
   if (TradeDirection == 1) Ls_56 = "Buy Only";
   if (TradeDirection == 2) Ls_56 = "Alternate Between Buy and Sell";
   if (TradeDirection == 3) Ls_56 = "Buy or Sell Determined by CounterTrend Calculation";
   if (TradeDirection == 4) Ls_56 = "Buy or Sell Determined by Trend Calculation";
   if (TradeDirection == 7) Ls_56 = "Buy or Sell Determined WaitPips";
   if (ExpandPipsLevel2 != 0 && Gi_412 != 0) {
      Comment("\n" 
         + Gs_100, 
         "\n" 
         + "\nCurrent Server Time = " + TimeToStr(TimeCurrent(), TIME_SECONDS) 
         + "\nAccount Leverage =", AccountLeverage() 
         + "\nSpread = " + DoubleToStr(MarketInfo(Symbol(), MODE_SPREAD), 0) 
         + "\nAccount Authorized = " + Ls_8 
         + "\n\nMonitor And Close = " + Ls_16 
         + "\nDoTrades = " + Ls_0 
         + "\nBalanceFactor = " + DoubleToStr(BalanceFactor, 2) 
         + "\n" 
         + Gs_1276 + DoubleToStr(100.0 * Gd_1268, 2) 
         + "\n\nTradeLots = " + DoubleToStr(TradeLots, Gi_940) 
         + "\nBase Lots = " + DoubleToStr(Gd_732, Gi_940) 
         + "\nMagic Number = " + MagicNumber 
         + "\nTrade Direction = " + Ls_56 
         + "\nCenter Price Where Trade Direction Changes = " + DoubleToStr(Gd_724, Digits) 
         + "\nTradeRange = " + TradeRange 
         + "\n\nNext Buy Price = " + DoubleToStr(Gd_948, Digits) 
         + "\nCurrent Buy Level = " + Li_24 
         + "\nMaximum Buy Level Reached = " + G_global_var_1000 
         + "\n\nNext Sell Price = " + DoubleToStr(Gd_956, Digits) 
         + "\nCurrent Sell Level = " + Li_28 
      + "\nMaximum Sell Level Reached = " + G_global_var_1004);
   }
   if (ExpandPipsLevel2 != 0 && Gi_412 == 0) {
      Comment("\n" 
         + Gs_100, 
         "\n" 
         + "\nCurrent Server Time = " + TimeToStr(TimeCurrent(), TIME_SECONDS) 
         + "\nAccount Leverage =", AccountLeverage() 
         + "\nSpread = " + DoubleToStr(MarketInfo(Symbol(), MODE_SPREAD), 0) 
         + "\nAccount Authorized = " + Ls_8 
         + "\n\nMonitor And Close = " + Ls_16 
         + "\nDoTrades = " + Ls_0 
         + "\nBalanceFactor = " + DoubleToStr(BalanceFactor, 2) 
         + "\n" 
         + Gs_1276 + DoubleToStr(100.0 * Gd_1268, 2) 
         + "\n\nTradeLots = " + DoubleToStr(TradeLots, Gi_940) 
         + "\nBase Lots = " + DoubleToStr(Gd_732, Gi_940) 
         + "\nMagic Number = " + MagicNumber 
         + "\nTrade Direction = " + Ls_56 
         + "\nCenter Price Where Trade Direction Changes = " + DoubleToStr(Gd_724, Digits) 
         + "\nTradeRange = " + TradeRange 
         + "\n\nNext Buy Price = " + DoubleToStr(Gd_948, Digits) 
         + "\nCurrent Buy Level = " + Li_24 
         + "\nMaximum Buy Level Reached = " + G_global_var_1000 
         + "\n\nNext Sell Price = " + DoubleToStr(Gd_956, Digits) 
         + "\nCurrent Sell Level = " + Li_28 
      + "\nMaximum Sell Level Reached = " + G_global_var_1004);
   }
   if (ExpandPipsLevel2 == 0 && Gi_412 == 0) {
      Comment("\n" 
         + Gs_100, 
         "\n" 
         + "\nCurrent Server Time = " + TimeToStr(TimeCurrent(), TIME_SECONDS) 
         + "\nAccount Leverage =", AccountLeverage() 
         + "\nSpread = " + DoubleToStr(MarketInfo(Symbol(), MODE_SPREAD), 0) 
         + "\nAccount Authorized = " + Ls_8 
         + "\n\nMonitor And Close = " + Ls_16 
         + "\nDoTrades = " + Ls_0 
         + "\nBalanceFactor = " + DoubleToStr(BalanceFactor, 2) 
         + "\n" 
         + Gs_1276 + DoubleToStr(100.0 * Gd_1268, 2) 
         + "\n\nTradeLots = " + DoubleToStr(TradeLots, Gi_940) 
         + "\nBase Lots = " + DoubleToStr(Gd_732, Gi_940) 
         + "\nMagic Number = " + MagicNumber 
         + "\nTrade Direction = " + Ls_56 
         + "\nCenter Price Where Trade Direction Changes = " + DoubleToStr(Gd_724, Digits) 
         + "\nTradeRange = " + TradeRange 
         + "\n\nNext Buy Price = " + DoubleToStr(Gd_948, Digits) 
         + "\nCurrent Buy Level = " + Li_24 
         + "\nMaximum Buy Level Reached = " + G_global_var_1000 
         + "\n\nNext Sell Price = " + DoubleToStr(Gd_956, Digits) 
         + "\nCurrent Sell Level = " + Li_28 
      + "\nMaximum Sell Level Reached = " + G_global_var_1004);
   }
}
	 	 	  	 	   	   	  			   	   	  	 	 			  	 	 		 	        							 		   		   			 		 	 	  		 		   						 	  			   						 		 				   	  									    
// 184916985BFD167AE4E08C739AF60F52
void f0_1() {
   double Ld_0;
   double lotsize_8 = MarketInfo(S        

Recommend