/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "http://www.ea4u.info"
#property link      "http://www.ea4u.info"

#include <stdlib.mqh>

string gs_76 = "EASCALPER";
extern string _Expert = "";
string gs_unused_92 = "1";
string gs_unused_100 = "2";
bool gi_108 = FALSE;
bool gi_112 = TRUE;
extern int LinePipsPlus = -3;
extern bool SetRevStopOrd = FALSE;
extern int Punkt = 20;
bool gi_128 = TRUE;
extern int Magic = 0;
bool gi_136 = TRUE;
string gs_140 = "expert.wav";
bool gi_148 = FALSE;
extern string Indicator = "";
extern int BandsPeriod = 10;
extern int BandsShift = 0;
extern double BandsDeviations = 2.5;
extern int shift = 1;
extern string Filtersss = "";
extern bool FilterOne = TRUE;
extern bool FilterTwo = TRUE;
extern string Indicator2 = "(FilterTwo=true!!!)";
extern int KPer = 5;
extern int Dper = 3;
extern int Slow = 3;
extern int StochDOWNline = 20;
extern int StochUPline = 80;
extern string Indicator3 = "RSI(FilterTwo=true!!!)";
extern int RSIPeriod = 14;
extern int RSIDownline = 30;
extern int RSIUpline = 70;
extern string _Trade = "";
extern double Lots = 0.1;
extern int StopLoss = 0;
extern int TakeProfit = 3;
extern int Slippage = 3;
int gi_272 = 2;
extern bool AllTimeTrade = FALSE;
extern int DayOfWeekSetNotTrade = 0;
extern string CloseHoura = "10:00";
extern string OpenHoura = "19:00";
extern bool ShowComment = TRUE;
extern string _P_Trailing = "";
extern bool IfProfTrail = TRUE;
extern int prchoose = 0;
extern int TrailingStop = 0;
extern string _close = "";
extern bool CloseifChange = FALSE;
extern int MaxTrades = 1;
extern string _autolot = "";
extern bool Autolot = FALSE;
extern int LotsDigit = 1;
extern double Risk = 1.0;
extern double MaxLots = 9999.0;
bool gi_372 = FALSE;
double gd_376 = 1.6;
extern double Key = 0.0;
double gd_392;
bool gi_400 = FALSE;
bool gi_404 = FALSE;
int gi_408 = 15128749;
int gi_412 = 8421616;
int gi_416 = 16776960;
int gi_420 = 4678655;
int gi_424 = 16711680;
int gi_428 = 255;
double gd_432;
double gd_440;
double g_ibands_448;
double g_ibands_456;
double g_ibands_464;
double g_ibands_472;
double gd_480;
double gd_488;
double g_ask_496;
double g_bid_504;
double gd_512;
double gd_520;
extern int ChWidth = 4;
bool gi_532 = TRUE;
bool gi_536 = FALSE;
bool gi_540 = FALSE;
double g_time_544 = 0.0;
datetime g_time_552;

void init() {
   Stamp();
   gi_404 = FALSE;
   if (!IsTradeAllowed()) {
      Message("\n" 
         + "" 
      + "\nF7");
      gi_404 = TRUE;
      return;
   }
   if (!IsLibrariesAllowed()) {
      Message("\n" 
      + "");
      gi_404 = TRUE;
      return;
   }
   if (!IsTesting()) {
      if (IsExpertEnabled()) Message("");
      else Message("\"\"");
   }
}

void deinit() {
   if (!IsTesting()) Comment("");
}

void start() {
   string ls_0;
   string ls_8;
   gd_392 = Key;
   if (StopLoss < MarketInfo(Symbol(), MODE_STOPLEVEL) && StopLoss != 0) ls_0 = ls_0 + "StopLoss StopLoss = " + DoubleToStr(MarketInfo(Symbol(), MODE_STOPLEVEL), 1) + "";
   if (TakeProfit < MarketInfo(Symbol(), MODE_STOPLEVEL) && TakeProfit != 0) {
      ls_0 = ls_0 
      + "\nTakeProfit TakeProfit = " + DoubleToStr(MarketInfo(Symbol(), MODE_STOPLEVEL), 1) + "";
   }
   if (prchoose < MarketInfo(Symbol(), MODE_STOPLEVEL) && prchoose != 0) {
      ls_0 = ls_0 
      + "\nprchoosep= " + DoubleToStr(MarketInfo(Symbol(), MODE_STOPLEVEL), 1) + "";
   }
   if (TrailingStop < MarketInfo(Symbol(), MODE_STOPLEVEL) && TrailingStop != 0) {
      ls_0 = ls_0 
      + "\nTrailingStopTrailingStop = " + DoubleToStr(MarketInfo(Symbol(), MODE_STOPLEVEL), 1) + "";
   }
   prchoose = MarketInfo(Symbol(), MODE_STOPLEVEL);
   TrailingStop = MarketInfo(Symbol(), MODE_STOPLEVEL);
   if (ls_0 != "") Message(ls_0);
   if (gi_400) {
      Message("");
      return;
   }
   if (gi_404) {
      Message("");
      return;
   }
   gd_432 = 0;
   gd_440 = 0;
   if (idPriceLevel() && g_ask_496 != 0.0 && g_bid_504 != 0.0) MPs();
   if (ShowComment) {
      ls_8 = "";
      if (gd_432 == 0.0) ls_8 = "\n";
      else {
         if (gi_108) ls_8 = "";
         else ls_8 = "";
         ls_8 = ls_8 + DoubleToStr(gd_432, Digits) 
         + "\n";
         if (SetRevStopOrd) {
            if (gi_108) {
               ls_8 = ls_8 + "SellStop" + DoubleToStr(gd_432 - StopLoss * Point, Digits) 
               + "\n";
            } else {
               ls_8 = ls_8 + "BuyStop " + DoubleToStr(gd_432 + StopLoss * Point, Digits) 
               + "\n";
            }
         }
      }
      if (gd_440 == 0.0) ls_8 = ls_8 + "";
      else {
         if (gi_112) ls_8 = ls_8 + "";
         else ls_8 = ls_8 + "";
         ls_8 = ls_8 + DoubleToStr(gd_440, Digits) 
         + "\n";
         if (SetRevStopOrd) {
            if (gi_112) {
               ls_8 = ls_8 + "SellStop " + DoubleToStr(gd_440 - StopLoss * Point, Digits) 
               + "\n";
            } else {
               ls_8 = ls_8 + "BuyStop " + DoubleToStr(gd_440 + StopLoss * Point, Digits) 
               + "\n";
            }
         }
      }
      if (gd_432 > 0.0 || gd_440 > 0.0) ls_8 = "\nLots=" + DoubleToStr(Lots, 2) + " \n StopLoss=" + StopLoss + " ï." + " \n TakeProfit=" + TakeProfit + " ï.\n" + ls_8;
   }
   if (gd_432 > 0.0) gd_480 = gd_432;
   if (gd_440 > 0.0) gd_488 = gd_440;
   g_ask_496 = Ask;
   g_bid_504 = Bid;
   if (IfProfTrail == TRUE) TProf();
}

void CPBS() {
   bool l_ord_close_0;
   color l_color_4;
   double l_ord_lots_8;
   double l_ask_16;
   double l_bid_24;
   double l_price_32;
   int l_error_40;
   if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
      for (int li_44 = 1; li_44 <= gi_272; li_44++) {
         if (!IsTesting() && !IsExpertEnabled() || IsStopped()) break;
         while (!IsTradeAllowed()) Sleep(5000);
         RefreshRates();
         l_ask_16 = MarketInfo(OrderSymbol(), MODE_ASK);
         l_bid_24 = MarketInfo(OrderSymbol(), MODE_BID);
         if (OrderType() == OP_BUY) {
            l_price_32 = l_bid_24;
            l_color_4 = gi_424;
         } else {
            l_price_32 = l_ask_16;
            l_color_4 = gi_428;
         }
         l_ord_lots_8 = OrderLots();
         l_ord_close_0 = OrderClose(OrderTicket(), l_ord_lots_8, l_price_32, Slippage, l_color_4);
         if (l_ord_close_0) {
            if (!(gi_136)) break;
            PlaySound(gs_140);
            return;
         }
         l_error_40 = GetLastError();
         if (l_error_40 == 146/* TRADE_CONTEXT_BUSY */) while (IsTradeContextBusy()) Sleep(11000);
         Print("Error(", l_error_40, ") Close ", GetNameOP(OrderType()), " ", ErrorDescription(l_error_40), ", try ", li_44);
         Print(OrderTicket(), "  Ask=", l_ask_16, "  Bid=", l_bid_24, "  pp=", l_price_32);
         Print("sy=", OrderSymbol(), "  ll=", l_ord_lots_8, "  sl=", OrderStopLoss(), "  tp=", OrderTakeProfit(), "  mn=", OrderMagicNumber());
         Sleep(5000);
      }
   } else Print("Close ", GetNameOP(OrderType()));
}

void CPD(string as_0 = "", int a_cmd_8 = -1, int a_magic_12 = -1) {
   int l_ord_total_16 = OrdersTotal();
   if (as_0 == "0") as_0 = Symbol();
   for (int l_pos_20 = l_ord_total_16 - 1; l_pos_20 >= 0; l_pos_20--) {
      if (OrderSelect(l_pos_20, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderSymbol() == as_0 || as_0 == "" && a_cmd_8 < OP_BUY || OrderType() == a_cmd_8) {
            if (OrderType() == OP_BUY || OrderType() == OP_SELL)
               if (a_magic_12 < 0 || OrderMagicNumber() == a_magic_12) CPBS();
         }
      }
   }
}

bool ExO(string as_0 = "", int a_cmd_8 = -1, int a_magic_12 = -1, int ai_16 = 0) {
   int l_cmd_20;
   int l_ord_total_24 = OrdersTotal();
   if (as_0 == "0") as_0 = Symbol();
   for (int l_pos_28 = 0; l_pos_28 < l_ord_total_24; l_pos_28++) {
      if (OrderSelect(l_pos_28, SELECT_BY_POS, MODE_TRADES)) {
         l_cmd_20 = OrderType();
         if (l_cmd_20 > OP_SELL && l_cmd_20 < 6) {
            if (OrderSymbol() == as_0 || as_0 == "" && a_cmd_8 < OP_BUY || l_cmd_20 == a_cmd_8) {
               if (a_magic_12 < 0 || OrderMagicNumber() == a_magic_12)
                  if (ai_16 <= OrderOpenTime()) return (TRUE);
            }
         }
      }
   }
   return (FALSE);
}

int DxO(string as_0 = "", int a_cmd_8 = -1, int a_magic_12 = -1, int ai_16 = 0) {
   int l_cmd_20;
   int l_ord_total_24 = OrdersTotal();
   if (as_0 == "0") as_0 = Symbol();
   for (int l_pos_28 = 0; l_pos_28 < l_ord_total_24; l_pos_28++) {
      if (OrderSelect(l_pos_28, SELECT_BY_POS, MODE_TRADES)) {
         l_cmd_20 = OrderType();
         if (l_cmd_20 > OP_SELL && l_cmd_20 < 6) {
            if (OrderSymbol() == as_0 || as_0 == "" && a_cmd_8 < OP_BUY || l_cmd_20 == a_cmd_8) {
               if (a_magic_12 < 0 || OrderMagicNumber() == a_magic_12) {
                  if (ai_16 <= OrderOpenTime()) {
                     OrderDelete(OrderTicket(), Black);
                     return (1);
                  }
               }
            }
         }
      }
   }
   return (0);
}

bool EPs(string as_0 = "", int a_cmd_8 = -1, int a_magic_12 = -1, int ai_16 = 0) {
   int l_ord_total_20 = OrdersTotal();
   if (as_0 == "0") as_0 = Symbol();
   for (int l_pos_24 = 0; l_pos_24 < l_ord_total_20; l_pos_24++) {
      if (OrderSelect(l_pos_24, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderSymbol() == as_0 || as_0 == "") {
            if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
               if (a_cmd_8 < OP_BUY || OrderType() == a_cmd_8) {
                  if (a_magic_12 < 0 || OrderMagicNumber() == a_magic_12)
                     if (ai_16 <= OrderOpenTime()) return (TRUE);
               }
            }
         }
      }
   }
   return (FALSE);
}

string GetNameOP(int ai_0) {
   switch (ai_0) {
   case 0:
      return ("Buy");
   case 1:
      return ("Sell");
   case 2:
      return ("Buy Limit");
   case 3:
      return ("Sell Limit");
   case 4:
      return ("Buy Stop");
   case 5:
      return ("Sell Stop");
   }
   return ("Unknown Operation");
}

string GetNameTF(int a_timeframe_0 = 0) {
   if (a_timeframe_0 == 0) a_timeframe_0 = Period();
   switch (a_timeframe_0) {
   case PERIOD_M1:
      return ("M1");
   case PERIOD_M5:
      return ("M5");
   case PERIOD_M15:
      return ("M15");
   case PERIOD_M30:
      return ("M30");
   case PERIOD_H1:
      return ("H1");
   case PERIOD_H4:
      return ("H4");
   case PERIOD_D1:
      return ("Daily");
   case PERIOD_W1:
      return ("Weekly");
   case PERIOD_MN1:
      return ("Monthly");
   }
   return ("UnknownPeriod");
}

int idPriceLevel() {
   gd_432 = iBands(Symbol(), 0, BandsPeriod, BandsDeviations, BandsShift, PRICE_CLOSE, MODE_UPPER, shift);
   if (gd_432 > 0.0) gd_432 += LinePipsPlus * Point;
   gd_440 = iBands(Symbol(), 0, BandsPeriod, BandsDeviations, BandsShift, PRICE_CLOSE, MODE_LOWER, shift);
   if (gd_440 > 0.0) gd_440 -= LinePipsPlus * Point;
   if (gd_432 != gd_480 || gd_440 != gd_488 || gd_480 == 0.0 || gd_488 == 0.0 || gd_432 == 0.0 || gd_440 == 0.0) return (0);
   return (1);
}

void MPs() {
   double ld_0;
   int li_8;
   int l_acc_number_12 = AccountNumber();
   bool li_16 = FALSE;
   bool li_20 = FALSE;
   double ld_24 = GetSizeLot();
   double ld_32 = 0;
   double ld_40 = 0;
   int l_month_48 = Month();
   int l_bool_52 = IsOptimization();
   int l_bool_56 = IsTesting();
   int l_bool_60 = IsDemo();
   int l_month_64 = l_month_48;
   int l_bool_68 = l_bool_52;
   int l_bool_72 = l_bool_56;
   int l_bool_76 = l_bool_60;
   string ls_80 = gs_76;
   PInd();
   g_ibands_448 = iBands(Symbol(), PERIOD_H1, BandsPeriod, BandsDeviations, BandsShift, PRICE_CLOSE, MODE_UPPER, shift);
   g_ibands_464 = iBands(Symbol(), PERIOD_M30, BandsPeriod, BandsDeviations, BandsShift, PRICE_CLOSE, MODE_UPPER, shift);
   g_ibands_456 = iBands(Symbol(), PERIOD_H1, BandsPeriod, BandsDeviations, BandsShift, PRICE_CLOSE, MODE_LOWER, shift);
   g_ibands_472 = iBands(Symbol(), PERIOD_M30, BandsPeriod, BandsDeviations, BandsShift, PRICE_CLOSE, MODE_LOWER, shift);
   if (!FilterOne && !FilterTwo) {
      if ((Ask > g_ask_496 && Ask >= gd_432 && gi_108) || (Ask < g_ask_496 && Ask <= gd_440 && gi_112)) li_16 = TRUE;
      if ((Bid > g_bid_504 && Bid >= gd_432 && !gi_108) || (Bid < g_bid_504 && Bid <= gd_440 && !gi_112)) li_20 = TRUE;
   }
   if (FilterOne && !FilterTwo) {
      if (iGDB() && !TCB() && (Ask > g_ask_496 && Ask >= gd_432 && gi_108) || (Ask < g_ask_496 && Ask <= gd_440 && gi_112) && KT(gd_392, l_acc_number_12, l_month_64, l_bool_68, l_bool_72, l_bool_76, ls_80) == 1) li_16 = TRUE;
      if (iGDS() && !TCB() && (Bid > g_bid_504 && Bid >= gd_432 && !gi_108) || (Bid < g_bid_504 && Bid <= gd_440 && !gi_112) && KT(gd_392, l_acc_number_12, l_month_64, l_bool_68, l_bool_72, l_bool_76, ls_80) == 1) li_20 = TRUE;
   }
   if (FilterOne && FilterTwo) {
      if ((Ask > g_ask_496 && Ask >= gd_432 && gi_108) || (Ask < g_ask_496 && Ask <= gd_440 && gi_112) && (iStochastic(Symbol(), 0, KPer, Dper, Slow, MODE_SMA, 1, MODE_SIGNAL, 0) < StochUPline &&
         iStochastic(Symbol(), 0, KPer, Dper, Slow, MODE_SMA, 1, MODE_SIGNAL, 0) > StochDOWNline && iRSI(Symbol(), 0, RSIPeriod, PRICE_CLOSE, 0) < RSIUpline && iRSI(Symbol(), 0, RSIPeriod, PRICE_CLOSE, 0) > RSIDownline) &&
         iGDB() && !TCB()) li_16 = TRUE;
      if ((Bid > g_bid_504 && Bid >= gd_432 && !gi_108) || (Bid < g_bid_504 && Bid <= gd_440 && !gi_112) && (iStochastic(Symbol(), 0, KPer, Dper, Slow, MODE_SMA, 1, MODE_SIGNAL, 0) < StochUPline &&
         iStochastic(Symbol(), 0, KPer, Dper, Slow, MODE_SMA, 1, MODE_SIGNAL, 0) > StochDOWNline && iRSI(Symbol(), 0, RSIPeriod, PRICE_CLOSE, 0) < RSIUpline && iRSI(Symbol(), 0, RSIPeriod, PRICE_CLOSE, 0) > RSIDownline) &&
         iGDS() && !TCB()) li_20 = TRUE;
   }
   if (!FilterOne && FilterTwo) {
      if ((Ask > g_ask_496 && Ask >= gd_432 && gi_108) || (Ask < g_ask_496 && Ask <= gd_440 && gi_112) && (iStochastic(Symbol(), 0, KPer, Dper, Slow, MODE_SMA, 1, MODE_SIGNAL, 0) < StochUPline &&
         iStochastic(Symbol(), 0, KPer, Dper, Slow, MODE_SMA, 1, MODE_SIGNAL, 0) > StochDOWNline && iRSI(Symbol(), 0, RSIPeriod, PRICE_CLOSE, 0) < RSIUpline && iRSI(Symbol(), 0, RSIPeriod, PRICE_CLOSE, 0) > RSIDownline)) li_16 = TRUE;
      if ((Bid > g_bid_504 && Bid >= gd_432 && !gi_108) || (Bid < g_bid_504 && Bid <= gd_440 && !gi_112) && (iStochastic(Symbol(), 0, KPer, Dper, Slow, MODE_SMA, 1, MODE_SIGNAL, 0) < StochUPline &&
         iStochastic(Symbol(), 0, KPer, Dper, Slow, MODE_SMA, 1, MODE_SIGNAL, 0) > StochDOWNline && iRSI(Symbol(), 0, RSIPeriod, PRICE_CLOSE, 0) < RSIUpline && iRSI(Symbol(), 0, RSIPeriod, PRICE_CLOSE, 0) > RSIDownline)) li_20 = TRUE;
   }
   if (CloseifChange == TRUE && gi_148 == FALSE && TDt(CloseHoura, OpenHoura) == 1 && KT(gd_392, l_acc_number_12, l_month_64, l_bool_68, l_bool_72, l_bool_76, ls_80) == 1) {
      if (li_16) {
         if (EPs(0, OP_SELL, Magic)) CPD(0, OP_SELL, Magic);
         if (!EPs(0, OP_BUY, Magic) && KT(gd_392, l_acc_number_12, l_month_64, l_bool_68, l_bool_72, l_bool_76, ls_80) == 1) {
            if (gi_128) {
               li_8 = OPs("", OP_BUY, ld_24, 0, 0, Magic);
               if (SBT(li_8)) {
                  if (StopLoss > 0) ld_32 = Ask - StopLoss * Point;
                  else ld_32 = 0;
                  if (TakeProfit > 0) ld_40 = Ask + TakeProfit * Point;
                  else ld_40 = 0;
                  MOr(-1, ld_32, ld_40, gi_416);
               }
            } else {
               if (StopLoss > 0) ld_32 = Ask - StopLoss * Point;
               else ld_32 = 0;
               if (TakeProfit > 0) ld_40 = Ask + TakeProfit * Point;
               else ld_40 = 0;
               OPs("", OP_BUY, ld_24, ld_32, ld_40, Magic);
            }
            if (ExO(0, OP_SELLSTOP, Magic)) DxO(0, OP_SELLSTOP, Magic);
            if (SetRevStopOrd && Punkt > 0 && !ExO(0, OP_SELLSTOP, Magic)) {
               ld_32 = Ask - Punkt * Point;
               ld_0 = ld_32;
               ld_32 = ld_0 + StopLoss * Point;
               if (TakeProfit > 0) ld_40 = ld_0 - TakeProfit * Point;
               else ld_40 = 0;
               SOr("", OP_SELLSTOP, ld_24, ld_0, ld_32, ld_40, Magic);
            }
         }
      }
      if (li_20) {
         if (EPs(0, OP_BUY, Magic)) CPD(0, OP_BUY, Magic);
         if (!EPs(0, OP_SELL, Magic) && KT(gd_392, l_acc_number_12, l_month_64, l_bool_68, l_bool_72, l_bool_76, ls_80) == 1) {
            if (gi_128) {
               li_8 = OPs("", OP_SELL, ld_24, 0, 0, Magic);
               if (SBT(li_8)) {
                  if (StopLoss > 0) ld_32 = Bid + StopLoss * Point;
                  else ld_32 = 0;
                  if (TakeProfit > 0) ld_40 = Bid - TakeProfit * Point;
                  else ld_40 = 0;
                  MOr(-1, ld_32, ld_40, gi_420);
               }
            } else {
               if (StopLoss > 0) ld_32 = Bid + StopLoss * Point;
               else ld_32 = 0;
               if (TakeProfit > 0) ld_40 = Bid - TakeProfit * Point;
               else ld_40 = 0;
               OPs("", OP_SELL, ld_24, ld_32, ld_40, Magic);
            }
            if (ExO(0, OP_BUYSTOP, Magic)) DxO(0, OP_BUYSTOP, Magic);
            if (SetRevStopOrd && Punkt > 0 && !ExO(0, OP_BUYSTOP, Magic)) {
               ld_32 = Bid + Punkt * Point;
               ld_0 = ld_32;
               ld_32 = ld_0 - StopLoss * Point;
               if (TakeProfit > 0) ld_40 = ld_0 + TakeProfit * Point;
               else ld_40 = 0;
               SOr("", OP_BUYSTOP, ld_24, ld_0, ld_32, ld_40, Magic);
            }
         }
      }
   }
   if (CloseifChange == TRUE && gi_148 == TRUE && MaxTrades > OrdersTotal() - 1 && TDt(CloseHoura, OpenHoura) == 1 && KT(gd_392, l_acc_number_12, l_month_64, l_bool_68, l_bool_72, l_bool_76, ls_80) == 1) {
      if (li_16) {
         if (EPs(0, OP_SELL, Magic)) CPD(0, OP_SELL, Magic);
         if (gi_128) {
            li_8 = OPs("", OP_BUY, ld_24, 0, 0, Magic);
            if (SBT(li_8)) {
               if (StopLoss > 0) ld_32 = Ask - StopLoss * Point;
               else ld_32 = 0;
               if (TakeProfit > 0) ld_40 = Ask + TakeProfit * Point;
               else ld_40 = 0;
               MOr(-1, ld_32, ld_40, gi_416);
            }
         } else {
            if (StopLoss > 0) ld_32 = Ask - StopLoss * Point;
            else ld_32 = 0;
            if (TakeProfit > 0) ld_40 = Ask + TakeProfit * Point;
            else ld_40 = 0;
            OPs("", OP_BUY, ld_24, ld_32, ld_40, Magic);
         }
         if (SetRevStopOrd && ld_32 > 0.0 && !ExO(0, OP_SELLSTOP, Magic)) {
            ld_0 = ld_32;
            ld_32 = ld_0 + StopLoss * Point;
            if (TakeProfit > 0) ld_40 = ld_0 - TakeProfit * Point;
            else ld_40 = 0;
            SOr("", OP_SELLSTOP, ld_24, ld_0, ld_32, ld_40, Magic);
         }
      }
      if (li_20) {
         if (EPs(0, OP_BUY, Magic)) CPD(0, OP_BUY, Magic);
         if (gi_128) {
            li_8 = OPs("", OP_SELL, ld_24, 0, 0, Magic);
            if (SBT(li_8)) {
               if (StopLoss > 0) ld_32 = Bid + StopLoss * Point;
               else ld_32 = 0;
               if (TakeProfit > 0) ld_40 = Bid - TakeProfit * Point;
               else ld_40 = 0;
               MOr(-1, ld_32, ld_40, gi_420);
            }
         } else {
            if (StopLoss > 0) ld_32 = Bid + StopLoss * Point;
            else ld_32 = 0;
            if (TakeProfit > 0) ld_40 = Bid - TakeProfit * Point;
            else ld_40 = 0;
            OPs("", OP_SELL, ld_24, ld_32, ld_40, Magic);
         }
         if (SetRevStopOrd && ld_32 > 0.0 && !ExO(0, OP_BUYSTOP, Magic)) {
            ld_0 = ld_32;
            ld_32 = ld_0 - StopLoss * Point;
            if (TakeProfit > 0) ld_40 = ld_0 + TakeProfit * Point;
            else ld_40 = 0;
            SOr("", OP_BUYSTOP, ld_24, ld_0, ld_32, ld_40, Magic);
         }
      }
   }
   if (CloseifChange == FALSE && MaxTrades > OrdersTotal() - 1 && TDt(CloseHoura, OpenHoura) == 1 && KT(gd_392, l_acc_number_12, l_month_64, l_bool_68, l_bool_72, l_bool_76, ls_80) == 1) {
      if (li_16 && g_time_552 != Time[0]) {
         if (gi_128) {
            li_8 = OPs("", OP_BUY, ld_24, 0, 0, Magic);
            if (SBT(li_8)) {
               if (StopLoss > 0) ld_32 = Ask - StopLoss * Point;
               else ld_32 = 0;
               if (TakeProfit > 0) ld_40 = Ask + TakeProfit * Point;
               else ld_40 = 0;
               MOr(-1, ld_32, ld_40, gi_416);
            }
         } else {
            if (StopLoss > 0) ld_32 = Ask - StopLoss * Point;
            else ld_32 = 0;
            if (TakeProfit > 0) ld_40 = Ask + TakeProfit * Point;
            else ld_40 = 0;
            OPs("", OP_BUY, ld_24, ld_32, ld_40, Magic);
         }
         if (SetRevStopOrd && ld_32 > 0.0 && !ExO(0, OP_SELLSTOP, Magic)) {
            ld_0 = ld_32;
            ld_32 = ld_0 + StopLoss * Point;
            if (TakeProfit > 0) ld_40 = ld_0 - TakeProfit * Point;
            else ld_40 = 0;
            SOr("", OP_SELLSTOP, ld_24, ld_0, ld_32, ld_40, Magic);
         }
         g_time_552 = Time[0];
      }
      if (li_20 && g_time_552 != Time[0]) {
         if (gi_128) {
            li_8 = OPs("", OP_SELL, ld_24, 0, 0, Magic);
            if (SBT(li_8)) {
               if (StopLoss > 0) ld_32 = Bid + StopLoss * Point;
               else ld_32 = 0;
               if (TakeProfit > 0) ld_40 = Bid - TakeProfit * Point;
               else ld_40 = 0;
               MOr(-1, ld_32, ld_40, gi_420);
            }
         } else {
            if (StopLoss > 0) ld_32 = Bid + StopLoss * Point;
            else ld_32 = 0;
            if (TakeProfit > 0) ld_40 = Bid - TakeProfit * Point;
            else ld_40 = 0;
            OPs("", OP_SELL, ld_24, ld_32, ld_40, Magic);
         }
         if (SetRevStopOrd && ld_32 > 0.0 && !ExO(0, OP_BUYSTOP, Magic)) {
            ld_0 = ld_32;
            ld_32 = ld_0 - StopLoss * Point;
            if (TakeProfit > 0) ld_40 = ld_0 + TakeProfit * Point;
            else ld_40 = 0;
            SOr("", OP_BUYSTOP, ld_24, ld_0, ld_32, ld_40, Magic);
         }
         g_time_552 = Time[0];
      }
   }
}

void Message(string as_0) {
   Comment(as_0);
   if (StringLen(as_0) > 0) Print(as_0);
}

void MOr(double a_ord_open_price_0 = -1.0, double a_ord_stoploss_8 = 0.0, double a_ord_takeprofit_16 = 0.0, color a_color_24 = -1) {
   bool l_bool_28;
   int l_error_32;
   double l_ask_36 = MarketInfo(OrderSymbol(), MODE_ASK);
   double l_bid_44 = MarketInfo(OrderSymbol(), MODE_BID);
   if (a_ord_open_price_0 <= 0.0) a_ord_open_price_0 = OrderOpenPrice();
   if (a_ord_stoploss_8 < 0.0) a_ord_stoploss_8 = OrderStopLoss();
   if (a_ord_takeprofit_16 < 0.0) a_ord_takeprofit_16 = OrderTakeProfit();
   int l_digits_52 = MarketInfo(OrderSymbol(), MODE_DIGITS);
   a_ord_open_price_0 = NormalizeDouble(a_ord_open_price_0, l_digits_52);
   a_ord_stoploss_8 = NormalizeDouble(a_ord_stoploss_8, l_digits_52);
   a_ord_takeprofit_16 = NormalizeDouble(a_ord_takeprofit_16, l_digits_52);
   double ld_56 = NormalizeDouble(OrderOpenPrice(), l_digits_52);
   double ld_64 = NormalizeDouble(OrderStopLoss(), l_digits_52);
   double ld_72 = NormalizeDouble(OrderTakeProfit(), l_digits_52);
   if (a_ord_open_price_0 != ld_56 || a_ord_stoploss_8 != ld_64 || a_ord_takeprofit_16 != ld_72) {
      for (int li_80 = 1; li_80 <= gi_272; li_80++) {
         if (!IsTesting() && !IsExpertEnabled() || IsStopped()) break;
         while (!IsTradeAllowed()) Sleep(5000);
         RefreshRates();
         l_bool_28 = OrderModify(OrderTicket(), a_ord_open_price_0, a_ord_stoploss_8, a_ord_takeprofit_16, 0, a_color_24);
         if (l_bool_28) {
            if (!(gi_136)) break;
            PlaySound(gs_140);
            return;
         }
         l_error_32 = GetLastError();
         Print("Error(", l_error_32, ") modifying order: ", ErrorDescription(l_error_32), ", try ", li_80);
         Print("Ask=", l_ask_36, "  Bid=", l_bid_44, "  sy=", OrderSymbol(), "  op=" + GetNameOP(OrderType()), "  pp=", a_ord_open_price_0, "  sl=", a_ord_stoploss_8, "  tp=", a_ord_takeprofit_16);
         Sleep(10000);
      }
   }
}

int OPs(string a_symbol_0, int a_cmd_8, double a_lots_12, double a_price_20 = 0.0, double a_price_28 = 0.0, int a_magic_36 = 0) {
   color l_color_40;
   int l_datetime_44;
   double l_price_48;
   double l_ask_56;
   double l_bid_64;
   int l_digits_72;
   int l_error_76;
   int l_ticket_80 = 0;
   string l_comment_84 = Symbol() + " " + GetNameTF(Period());
   if (!ShowComment) l_comment_84 = "";
   if (a_symbol_0 == "" || a_symbol_0 == "0") a_symbol_0 = Symbol();
   if (a_cmd_8 == OP_BUY) l_color_40 = gi_408;
   else l_color_40 = gi_412;
   for (int li_92 = 1; li_92 <= gi_272; li_92++) {
      if (!IsTesting() && !IsExpertEnabled() || IsStopped()) break;
      while (!IsTradeAllowed()) Sleep(5000);
      RefreshRates();
      l_digits_72 = MarketInfo(a_symbol_0, MODE_DIGITS);
      l_ask_56 = MarketInfo(a_symbol_0, MODE_ASK);
      l_bid_64 = MarketInfo(a_symbol_0, MODE_BID);
      if (a_cmd_8 == OP_BUY) l_price_48 = l_ask_56;
      else l_price_48 = l_bid_64;
      l_price_48 = NormalizeDouble(l_price_48, l_digits_72);
      l_datetime_44 = TimeCurrent();
      l_ticket_80 = OrderSend(a_symbol_0, a_cmd_8, a_lots_12, l_price_48, Slippage, a_price_20, a_price_28, l_comment_84, a_magic_36, 0, l_color_40);
      if (l_ticket_80 > 0) {
         if (!(gi_136)) break;
         PlaySound(gs_140);
         break;
      }
      l_error_76 = GetLastError();
      if (l_error_76 == 128/* TRADE_TIMEOUT */ || l_error_76 == 142 || l_error_76 == 143) {
         Sleep(66666.0);
         if (EPs(a_symbol_0, a_cmd_8, a_magic_36, l_datetime_44)) {
            if (!(gi_136)) break;
            PlaySound(gs_140);
            break;
         }
      }
      Print("Error(", l_error_76, ") opening position: ", ErrorDescription(l_error_76), ", try ", li_92);
      Print("Ask=", l_ask_56, " Bid=", l_bid_64, " sy=", a_symbol_0, " ll=", a_lots_12, " op=", GetNameOP(a_cmd_8), " pp=", l_price_48, " sl=", a_price_20, " tp=", a_price_28, " mn=", a_magic_36);
      if (l_ask_56 == 0.0 && l_bid_64 == 0.0) Message("" + a_symbol_0);
      if (l_error_76 == 2/* COMMON_ERROR */ || l_error_76 == 64/* ACCOUNT_DISABLED */ || l_error_76 == 65/* INVALID_ACCOUNT */ || l_error_76 == 133/* TRADE_DISABLED */) {
         gi_400 = TRUE;
         break;
      }
      if (l_error_76 == 4/* SERVER_BUSY */ || l_error_76 == 131/* INVALID_TRADE_VOLUME */ || l_error_76 == 132/* MARKET_CLOSED */) {
         Sleep(300000);
         break;
      }
      if (l_error_76 == 140/* LONG_POSITIONS_ONLY_ALLOWED */ || l_error_76 == 148/* ERR_TRADE_TOO_MANY_ORDERS */ || l_error_76 == 4110/* LONGS__NOT_ALLOWED */ || l_error_76 == 4111/* SHORTS_NOT_ALLOWED */) break;
      if (l_error_76 == 141/* TOO_MANY_REQUESTS */) Sleep(100000);
      if (l_error_76 == 145/* TRADE_MODIFY_DENIED */) Sleep(17000);
      if (l_error_76 == 146/* TRADE_CONTEXT_BUSY */) while (IsTradeContextBusy()) Sleep(11000);
      if (l_error_76 != 135/* PRICE_CHANGED */) Sleep(7700.0);
   }
   g_time_544 = Time[0];
   return (l_ticket_80);
}

bool SBT(int ai_0, string as_4 = "", int a_cmd_12 = -1, int a_magic_16 = -1) {
   int l_ord_total_20 = OrdersTotal();
   if (as_4 == "0") as_4 = Symbol();
   for (int l_pos_24 = 0; l_pos_24 < l_ord_total_20; l_pos_24++) {
      if (OrderSelect(l_pos_24, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderSymbol() == as_4 || as_4 == "" && a_cmd_12 < OP_BUY || OrderType() == a_cmd_12)
            if (a_magic_16 < 0 || OrderMagicNumber() == a_magic_16 && OrderTicket() == ai_0) return (TRUE);
      }
   }
   return (FALSE);
}

void SOr(string a_symbol_0, int a_cmd_8, double a_lots_12, double a_price_20, double a_price_28 = 0.0, double a_price_36 = 0.0, int a_magic_44 = 0, int a_datetime_48 = 0) {
   color l_color_52;
   int l_datetime_56;
   double l_ask_60;
   double l_bid_68;
   double l_point_76;
   int l_error_84;
   int l_ticket_88;
   string l_comment_92 = Symbol() + " " + GetNameTF(Period());
   if (a_symbol_0 == "" || a_symbol_0 == "0") a_symbol_0 = Symbol();
   int l_stoplevel_100 = MarketInfo(a_symbol_0, MODE_STOPLEVEL);
   if (a_cmd_8 == OP_BUYLIMIT || a_cmd_8 == OP_BUYSTOP) l_color_52 = gi_408;
   else l_color_52 = gi_412;
   if (a_datetime_48 > 0 && a_datetime_48 < TimeCurrent()) a_datetime_48 = 0;
   for (int li_104 = 1; li_104 <= gi_272; li_104++) {
      if (!IsTesting() && !IsExpertEnabled() || IsStopped()) {
         Print("SOr(): ");
         return;
      }
      while (!IsTradeAllowed()) Sleep(5000);
      RefreshRates();
      l_datetime_56 = TimeCurrent();
      l_ticket_88 = OrderSend(a_symbol_0, a_cmd_8, a_lots_12, a_price_20, Slippage, a_price_28, a_price_36, l_comment_92, a_magic_44, a_datetime_48, l_color_52);
      if (l_ticket_88 > 0) {
         if (!(gi_136)) break;
         PlaySound(gs_140);
         return;
      }
      l_error_84 = GetLastError();
      if (l_error_84 == 128/* TRADE_TIMEOUT */ || l_error_84 == 142 || l_error_84 == 143) {
         Sleep(66000);
         if (ExO(a_symbol_0, a_cmd_8, a_magic_44, l_datetime_56)) {
            if (!(gi_136)) break;
            PlaySound(gs_140);
            return;
         }
         Print("Error(", l_error_84, ") set order: ", ErrorDescription(l_error_84), ", try ", li_104);
      } else {
         l_point_76 = MarketInfo(a_symbol_0, MODE_POINT);
         l_ask_60 = MarketInfo(a_symbol_0, MODE_ASK);
         l_bid_68 = MarketInfo(a_symbol_0, MODE_BID);
         if (l_ask_60 == 0.0 && l_bid_68 == 0.0) Message("SOr(): " + a_symbol_0);
         Print("Error(", l_error_84, ") set order: ", ErrorDescription(l_error_84), ", try ", li_104);
         Print("Ask=", l_ask_60, "  Bid=", l_bid_68, "  sy=", a_symbol_0, "  ll=", a_lots_12, "  op=", GetNameOP(a_cmd_8), "  pp=", a_price_20, "  sl=", a_price_28, "  tp=", a_price_36, "  mn=", a_magic_44);
         if (l_error_84 == 130/* INVALID_STOPS */) {
            switch (a_cmd_8) {
            case OP_BUYLIMIT:
               if (a_price_20 > l_ask_60 - l_stoplevel_100 * l_point_76) a_price_20 = l_ask_60 - l_stoplevel_100 * l_point_76;
               if (a_price_28 > a_price_20 - (l_stoplevel_100 + 1) * l_point_76) a_price_28 = a_price_20 - (l_stoplevel_100 + 1) * l_point_76;
               if (a_price_36 > 0.0 && a_price_36 < a_price_20 + (l_stoplevel_100 + 1) * l_point_76) a_price_36 = a_price_20 + (l_stoplevel_100 + 1) * l_point_76;
               break;
            case OP_BUYSTOP:
               if (a_price_20 < l_ask_60 + (l_stoplevel_100 + 1) * l_point_76) a_price_20 = l_ask_60 + (l_stoplevel_100 + 1) * l_point_76;
               if (a_price_28 > a_price_20 - (l_stoplevel_100 + 1) * l_point_76) a_price_28 = a_price_20 - (l_stoplevel_100 + 1) * l_point_76;
               if (a_price_36 > 0.0 && a_price_36 < a_price_20 + (l_stoplevel_100 + 1) * l_point_76) a_price_36 = a_price_20 + (l_stoplevel_100 + 1) * l_point_76;
               break;
            case OP_SELLLIMIT:
               if (a_price_20 < l_bid_68 + l_stoplevel_100 * l_point_76) a_price_20 = l_bid_68 + l_stoplevel_100 * l_point_76;
               if (a_price_28 > 0.0 && a_price_28 < a_price_20 + (l_stoplevel_100 + 1) * l_point_76) a_price_28 = a_price_20 + (l_stoplevel_100 + 1) * l_point_76;
               if (a_price_36 > a_price_20 - (l_stoplevel_100 + 1) * l_point_76) a_price_36 = a_price_20 - (l_stoplevel_100 + 1) * l_point_76;
               break;
            case OP_SELLSTOP:
               if (a_price_20 > l_bid_68 - l_stoplevel_100 * l_point_76) a_price_20 = l_bid_68 - l_stoplevel_100 * l_point_76;
               if (a_price_28 > 0.0 && a_price_28 < a_price_20 + (l_stoplevel_100 + 1) * l_point_76) a_price_28 = a_price_20 + (l_stoplevel_100 + 1) * l_point_76;
               if (a_price_36 > a_price_20 - (l_stoplevel_100 + 1) * l_point_76) a_price_36 = a_price_20 - (l_stoplevel_100 + 1) * l_point_76;
            }
            Print("SOr(): ");
         }
         if (l_error_84 == 2/* COMMON_ERROR */ || l_error_84 == 64/* ACCOUNT_DISABLED */ || l_error_84 == 65/* INVALID_ACCOUNT */ || l_error_84 == 133/* TRADE_DISABLED */) {
            gi_400 = TRUE;
            return;
         }
         if (l_error_84 == 4/* SERVER_BUSY */ || l_error_84 == 131/* INVALID_TRADE_VOLUME */ || l_error_84 == 132/* MARKET_CLOSED */) {
            Sleep(300000);
            return;
         }
         if (l_error_84 == 8/* TOO_FREQUENT_REQUESTS */ || l_error_84 == 141/* TOO_MANY_REQUESTS */) Sleep(100000);
         if (l_error_84 == 139/* ORDER_LOCKED */ || l_error_84 == 140/* LONG_POSITIONS_ONLY_ALLOWED */ || l_error_84 == 148/* ERR_TRADE_TOO_MANY_ORDERS */) break;
         if (l_error_84 == 146/* TRADE_CONTEXT_BUSY */) while (IsTradeContextBusy()) Sleep(11000);
         if (l_error_84 == 147/* ERR_TRADE_EXPIRATION_DENIED */) a_datetime_48 = 0;
         else
            if (l_error_84 != 135/* PRICE_CHANGED */ && l_error_84 != 138/* REQUOTE */) Sleep(7700.0);
      }
   }
}

void TProf() {
   int l_cmd_0;
   double l_price_4;
   double ld_12;
   bool li_20;
   double l_ord_open_price_24;
   int l_ticket_32;
   bool l_bool_36;
   if (prchoose == 0) prchoose = MarketInfo(Symbol(), MODE_STOPLEVEL);
   for (int li_40 = 1; li_40 <= OrdersTotal(); li_40++) {
      if (OrderSelect(li_40 - 1, SELECT_BY_POS) == TRUE) {
         l_cmd_0 = OrderType();
         if (OrderMagicNumber() == Magic) {
            l_price_4 = OrderStopLoss();
            while (true) {
               if (TrailingStop == 0) TrailingStop = MarketInfo(Symbol(), MODE_STOPLEVEL);
               ld_12 = TrailingStop;
               li_20 = FALSE;
               switch (l_cmd_0) {
               case OP_BUY:
                  if (NormalizeDouble(l_price_4, Digits) < NormalizeDouble(Bid - ld_12 * Point, Digits) && MarketInfo(OrderSymbol(), MODE_BID) - OrderOpenPrice() >= prchoose * Point) {
                     l_price_4 = Bid - ld_12 * Point;
                     li_20 = TRUE;
                  }
                  break;
               case OP_SELL:
                  if (NormalizeDouble(l_price_4, Digits) > NormalizeDouble(Ask + ld_12 * Point, Digits) || NormalizeDouble(l_price_4, Digits) == 0.0 && OrderOpenPrice() - MarketInfo(OrderSymbol(), MODE_ASK) >= prchoose * Point) {
                     l_price_4 = Ask + ld_12 * Point;
                     li_20 = TRUE;
                  }
               }
               if (li_20 == FALSE) break;
               l_ord_open_price_24 = OrderOpenPrice();
               l_ticket_32 = OrderTicket();
               l_bool_36 = OrderModify(l_ticket_32, l_ord_open_price_24, l_price_4, 0, 0, Green);
               if (l_bool_36 != TRUE) continue;
               break;
            }
         }
      }
   }
}

double GetSizeLot() {
   double ld_ret_0;
   int li_8;
   int l_hist_total_12;
   double l_marginrequired_16;
   double l_lotsize_24 = MarketInfo(Symbol(), MODE_LOTSIZE);
   double ld_32 = NormalizeDouble(MarketInfo(Symbol(), MODE_LOTSTEP), 2);
   if (LotsDigit == 2) li_8 = 2;
   if (LotsDigit == 1) li_8 = 1;
   if (Autolot == TRUE) ld_ret_0 = NormalizeDouble(AccountFreeMargin() * Risk / l_lotsize_24, LotsDigit);
   else ld_ret_0 = Lots;
   double ld_40 = NormalizeDouble(MarketInfo(Symbol(), MODE_MINLOT), 2);
   if (LotsDigit == 2) ld_40 = 0.01;
   if (ld_ret_0 < ld_40) ld_ret_0 = ld_40;
   if (ld_ret_0 > MaxLots) ld_ret_0 = MaxLots;
   if (gi_372 == TRUE) {
      l_hist_total_12 = OrdersHistoryTotal();
      for (int l_pos_48 = 0; l_pos_48 < l_hist_total_12; l_pos_48++) {
         if (OrderSelect(l_pos_48, SELECT_BY_POS, MODE_HISTORY) == TRUE) {
            if (OrderProfit() < 0.0) {
               ld_ret_0 *= gd_376;
               ld_ret_0 = NormalizeDouble(ld_ret_0, li_8);
            }
            if (OrderProfit() > 0.0) ld_ret_0 = Lots;
            if (ld_ret_0 > MaxLots) ld_ret_0 = MaxLots;
            l_marginrequired_16 = MarketInfo(Symbol(), MODE_MARGINREQUIRED);
            if (AccountFreeMargin() < l_marginrequired_16 * ld_ret_0) ld_ret_0 = ld_40;
            ld_ret_0 = NormalizeDouble(ld_ret_0, li_8);
         }
      }
   }
   Lots = ld_ret_0;
   return (ld_ret_0);
}

void Stamp() {
   ObjectCreate("Original", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Original", " ", 10, "Arial Bold", Red);
   ObjectSet("Original", OBJPROP_CORNER, 2);
   ObjectSet("Original", OBJPROP_XDISTANCE, 200);
   ObjectSet("Original", OBJPROP_YDISTANCE, 10);
}

int KT(double ad_unused_0, int ai_unused_8, int ai_unused_12, int ai_unused_16, int ai_unused_20, int ai_unused_24, string as_unused_28) {
   return (1);
}

int TDt(string as_0, string as_8) {
   bool li_ret_16 = FALSE;
   if (StrToTime(as_0) > StrToTime(as_8))
      if (TimeCurrent() < StrToTime(as_0) && TimeCurrent() >= StrToTime(as_8)) li_ret_16 = TRUE;
   if (StrToTime(as_0) < StrToTime(as_8))
      if (TimeCurrent() < StrToTime(as_0) || TimeCurrent() >= StrToTime(as_8)) li_ret_16 = TRUE;
   if (AllTimeTrade) li_ret_16 = TRUE;
   if (DayOfWeekSetNotTrade != 0 && DayOfWeekSetNotTrade == DayOfWeek()) li_ret_16 = FALSE;
   return (li_ret_16);
}

int iGDB() {
   bool li_ret_0 = FALSE;
   if (!gi_536) {
      if (Bid < gd_512 || (gi_532 && Bid <= gd_512)) li_ret_0 = TRUE;
   } else
      if (Bid > gd_520 || (gi_532 && Bid >= gd_520)) li_ret_0 = TRUE;
   return (li_ret_0);
}

int iGDS() {
   bool li_ret_0 = FALSE;
   if (!gi_536) {
      if (Bid > gd_520 || (gi_532 && Bid >= gd_520)) li_ret_0 = TRUE;
   } else
      if (Bid < gd_512 || (gi_532 && Bid <= gd_512)) li_ret_0 = TRUE;
   return (li_ret_0);
}

void PInd() {
   gd_520 = High[iHighest(NULL, 0, MODE_HIGH, ChWidth, 1)] + Point;
   gd_512 = Low[iLowest(NULL, 0, MODE_LOW, ChWidth, 1)] + Point;
   if (IsTesting() || IsOptimization()) {
      gd_520 = High[iHighest(NULL, 0, MODE_HIGH, ChWidth, 1)];
      gd_512 = Low[iLowest(NULL, 0, MODE_LOW, ChWidth, 1)];
   }
}

bool TCB() {
   bool li_ret_0 = FALSE;
   if (gi_540 && Time[0] == g_time_544) li_ret_0 = TRUE;
   return (li_ret_0);
}
