DragTrade_v_0.60

Author: Copyright � 2009, TheXpert
Orders Execution
It automatically opens orders when conditions are reachedChecks for the total of open ordersIt Closes Orders by itself It can change open orders parameters, due to possible stepping strategy
0 Views
0 Downloads
0 Favorites
DragTrade_v_0.60
#property copyright "Copyright © 2009, TheXpert"
#property link      "theforexpert@gmail.com"

extern int Magic = 13579;
extern string OrdersComment = "";
extern double TradeLots = 0.0;
extern int TargetMethod = 0;
extern int TargetPoints = 100;
extern double TargetKoef = 2.0;
extern int StopStyle = 3;
extern int StopWidth = 0;
extern int TakeStyle = 3;
extern int TakeWidth = 0;
string gs_128;
double gda_136[];
string gsa_140[];
string gs_dummy_144;
int gi_152 = 10;
int gi_156 = 50;
int gi_160;
string gsa_164[];
extern double RiskPercentage = 0.0;
extern int TimesToRepeat = 3;
extern int Slippage = 3;
int gi_unused_184 = 16776960;
int gi_unused_188 = 4678655;
string gsa_unused_192[4][2];
bool g_bool_196;
string gs_200;
string gs_208;
int gi_216 = -1;
string gs_220;
int g_str_len_228 = -1;
bool gi_232;
datetime g_time_236;

string f1() {
   if (StringLen(gs_128) == 0) {
      switch (Period()) {
      case PERIOD_H1:
         gs_128 = "H1";
         break;
      case PERIOD_H4:
         gs_128 = "H4";
         break;
      case PERIOD_D1:
         gs_128 = "D1";
         break;
      case PERIOD_W1:
         gs_128 = "W1";
         break;
      case PERIOD_MN1:
         gs_128 = "MN1";
         break;
      default:
         gs_128 = "M" + Period();
      }
   }
   return (gs_128);
}

int f2(int aia_0[], int ai_4) {
   int l_arr_size_8 = ArraySize(aia_0);
   for (int l_index_12 = 0; l_index_12 < l_arr_size_8; l_index_12++)
      if (aia_0[l_index_12] == ai_4) return (l_index_12);
   return (-1);
}

void f3(int &aia_0[], int ai_4) {
   int l_arr_size_8 = ArraySize(aia_0);
   ArrayResize(aia_0, l_arr_size_8 + 1);
   aia_0[l_arr_size_8] = ai_4;
}

void f4() {
   ArrayResize(gda_136, 0);
   ArrayResize(gsa_140, 0);
}

double f5(bool ai_0, double ad_4, double ad_12) {
   if (ai_0) return (ad_4);
   return (ad_12);
}

string f6(bool ai_0, string as_4, string as_12) {
   if (ai_0) return (as_4);
   return (as_12);
}

void f7(string as_0) {
   string ls_8 = as_0;
   int li_16 = StringFind(ls_8, 
   "\n");
   for (int li_20 = TRUE; li_16 > 0; li_20 = FALSE) {
      f8(StringSubstr(ls_8, 0, li_16), li_20);
      ls_8 = StringSubstr(ls_8, li_16 + 1);
      li_16 = StringFind(ls_8, 
      "\n");
   }
   f8(ls_8, li_20);
}

void f8(string as_0, int ai_8) {
   string ls_12 = as_0;
   int li_20 = StringLen(as_0);
   bool li_24 = ai_8;
   if (li_20 == 0) {
      f9(ls_12, li_24);
      return;
   }
   while (li_20 > 0) {
      f9(StringSubstr(ls_12, 0, gi_156), li_24);
      ls_12 = StringSubstr(ls_12, gi_156);
      li_20 -= gi_156;
      li_24 = FALSE;
   }
}

void f9(string as_0, bool ai_8) {
   string ls_12 = TimeToStr(TimeCurrent(), TIME_SECONDS) + ": ";
   if (!ai_8) ls_12 = StringSubstr("                       ", 0, StringLen(ls_12));
   if (gi_160 < gi_152) {
      gsa_164[gi_160] = ls_12 + as_0;
      gi_160++;
      return;
   }
   for (int li_20 = 1; li_20 < gi_152; li_20++) gsa_164[li_20 - 1] = gsa_164[li_20];
   gsa_164[gi_160 - 1] = ls_12 + as_0;
}

void f10() {
   ArrayResize(gsa_164, gi_152);
   for (int l_index_0 = 0; l_index_0 < gi_152; l_index_0++) gsa_164[l_index_0] = "";
}

void f11(string a_name_0, int a_window_8, int a_x_12, int a_y_16, string a_text_20, string a_fontname_28 = "Arial Black", color a_color_36 = 55295, int a_fontsize_40 = 10) {
   ObjectCreate(a_name_0, OBJ_LABEL, a_window_8, 0, 0);
   ObjectSet(a_name_0, OBJPROP_CORNER, 1);
   ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_12);
   ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_16);
   ObjectSetText(a_name_0, a_text_20, a_fontsize_40, a_fontname_28, a_color_36);
}

bool f12(string a_name_0, int &ai_8, int &ai_12) {
   if (ObjectFind(a_name_0) != -1) {
      ai_8 = ObjectGet(a_name_0, OBJPROP_XDISTANCE);
      ai_12 = ObjectGet(a_name_0, OBJPROP_YDISTANCE);
      return (TRUE);
   }
   return (FALSE);
}

void f13(string a_name_0, int a_datetime_8, double a_price_12, int ai_20 = 6, int a_width_24 = 3, color a_color_28 = 16777215) {
   ObjectCreate(a_name_0, OBJ_ARROW, 0, a_datetime_8, a_price_12);
   ObjectSet(a_name_0, OBJPROP_ARROWCODE, ai_20);
   ObjectSet(a_name_0, OBJPROP_PRICE1, a_price_12);
   ObjectSet(a_name_0, OBJPROP_TIME1, a_datetime_8);
   ObjectSet(a_name_0, OBJPROP_COLOR, a_color_28);
   ObjectSet(a_name_0, OBJPROP_WIDTH, a_width_24);
}

void f14(string a_name_0, int a_datetime_8, double ad_12) {
   ObjectSet(a_name_0, OBJPROP_PRICE1, ad_12);
   ObjectSet(a_name_0, OBJPROP_TIME1, a_datetime_8);
}

bool f15(string a_name_0, int &ai_8, double &ad_12) {
   if (ObjectFind(a_name_0) != -1) {
      ad_12 = ObjectGet(a_name_0, OBJPROP_PRICE1);
      ai_8 = ObjectGet(a_name_0, OBJPROP_TIME1);
      return (TRUE);
   }
   return (FALSE);
}

void f16(string a_name_0, double a_price_8, color a_color_16 = 32768, int a_style_20 = 2, int a_width_24 = 0) {
   ObjectCreate(a_name_0, OBJ_HLINE, 0, 0, a_price_8);
   ObjectSet(a_name_0, OBJPROP_PRICE1, a_price_8);
   ObjectSet(a_name_0, OBJPROP_STYLE, a_style_20);
   ObjectSet(a_name_0, OBJPROP_COLOR, a_color_16);
   ObjectSet(a_name_0, OBJPROP_WIDTH, a_width_24);
}

void f17(string a_name_0, double ad_8) {
   ObjectSet(a_name_0, OBJPROP_PRICE1, ad_8);
}

int f18(string a_name_0, double &ad_8) {
   if (ObjectFind(a_name_0) != -1) {
      ad_8 = ObjectGet(a_name_0, OBJPROP_PRICE1);
      return (1);
   }
   return (0);
}

void f19() {
   while (IsTradeContextBusy()) Sleep(20);
}

int f20(int a_magic_0, int ai_4, int ai_8, double ad_12, string a_f720 = "") {
   double l_price_32;
   double l_price_40;
   double l_lots_48;
   int l_ticket_56;
   for (int l_count_28 = 0; l_count_28 < TimesToRepeat; l_count_28++) {
      f19();
      RefreshRates();
      l_price_32 = f5(ai_4 > 0, Ask + ai_4 * Point, 0);
      l_price_40 = f5(ai_8 > 0, Ask - ai_8 * Point, 0);
      l_lots_48 = f5(ad_12 == 0.0, f22(RiskPercentage), ad_12);
      l_ticket_56 = OrderSend(Symbol(), OP_BUY, l_lots_48, Ask, Slippage, l_price_40, l_price_32, a_f720, a_magic_0, 0, Blue);
      if (l_ticket_56 > 0) return (l_ticket_56);
      if (!(f23(GetLastError()))) return;
   }
   return (-1);
}

int f21(int a_magic_0, int ai_4, int ai_8, double ad_12, string a_f720 = "") {
   double l_price_32;
   double l_price_40;
   double l_lots_48;
   int l_ticket_56;
   for (int l_count_28 = 0; l_count_28 < TimesToRepeat; l_count_28++) {
      f19();
      RefreshRates();
      l_price_32 = f5(ai_4 > 0, Bid - ai_4 * Point, 0);
      l_price_40 = f5(ai_8 > 0, Bid + ai_8 * Point, 0);
      l_lots_48 = f5(ad_12 == 0.0, f22(RiskPercentage), ad_12);
      l_ticket_56 = OrderSend(Symbol(), OP_SELL, l_lots_48, Bid, Slippage, l_price_40, l_price_32, a_f720, a_magic_0, 0, Red);
      if (l_ticket_56 > 0) return (l_ticket_56);
      if (!(f23(GetLastError()))) return;
   }
   return (-1);
}

double f22(double ad_0) {
   double l_marginrequired_8 = MarketInfo(Symbol(), MODE_MARGINREQUIRED);
   double l_minlot_16 = MarketInfo(Symbol(), MODE_MINLOT);
   double l_maxlot_24 = MarketInfo(Symbol(), MODE_MAXLOT);
   double l_lotstep_32 = MarketInfo(Symbol(), MODE_LOTSTEP);
   double ld_40 = AccountEquity();
   double ld_48 = ld_40 * ad_0 / 100.0;
   if (l_marginrequired_8 * l_lotstep_32 == 0.0) return (l_minlot_16);
   double ld_ret_56 = MathRound(ld_48 / l_marginrequired_8 / l_lotstep_32) * l_lotstep_32;
   if (ld_ret_56 < l_minlot_16) ld_ret_56 = l_minlot_16;
   if (ld_ret_56 > l_maxlot_24) ld_ret_56 = l_maxlot_24;
   return (ld_ret_56);
}

bool f23(int ai_0) {
   switch (ai_0) {
   case 1:
      return (TRUE);
   case 129:
      return (TRUE);
   case 135:
      return (TRUE);
   case 136:
      return (TRUE);
   case 138:
      return (TRUE);
   }
   return (FALSE);
}

string Symbol_() {
   if (StringLen(gs_200) == 0) gs_200 = StringSubstr(Symbol() + "______", 0, 6);
   return (gs_200);
}

string f24() {
   if (StringLen(gs_208) == 0) gs_208 = "DragTrade Toolbar " + Symbol() + " " + f1();
   return (gs_208);
}

int f25() {
   if (gi_216 == -1) {
      gi_216 = WindowFind(f24());
      if (gi_216 == -1) gi_216 = 0;
   }
   return (gi_216);
}

string ID() {
   if (StringLen(gs_220) == 0) gs_220 = "DragTrade " + Symbol_() + " ";
   return (gs_220);
}

int f26() {
   if (g_str_len_228 == -1) g_str_len_228 = StringLen(ID());
   return (g_str_len_228);
}

void f27(bool ai_0) {
   double ld_52;
   int li_60;
   int li_68;
   int li_72;
   bool li_76;
   int li_80;
   int li_unused_84;
   double ld_88;
   int li_96;
   string l_name_4 = " " + ID() + "_open_" + " mover";
   string l_name_12 = " " + ID() + "_open_" + " acceptor";
   string l_name_20 = " " + ID() + "_open_" + " checker";
   string l_name_28 = " " + ID() + "_open_" + " label";
   if (!ai_0) {
      ObjectDelete(l_name_4);
      ObjectDelete(l_name_12);
      ObjectDelete(l_name_20);
      ObjectDelete(l_name_28);
      return;
   }
   f11(l_name_28, f25(), 10, 47, "Apply Open");
   int li_36 = 10;
   int li_40 = 60;
   int li_44 = 50;
   int li_48 = 60;
   bool li_64 = f28(l_name_20, li_36, li_40, 84, 10025880, l_name_12, li_44, li_48, 164, 255);
   if (!f15(l_name_4, li_60, ld_52)) {
      f13(l_name_4, Time[0] + 60 * Period() << 2, Bid);
      li_64 = FALSE;
   }
   if (ld_52 > WindowPriceMax() || ld_52 < WindowPriceMin()) {
      li_68 = WindowFirstVisibleBar();
      li_72 = WindowBarsPerChart();
      if (li_72 > li_68) ld_52 = Bid;
   }
   f14(l_name_4, Time[0] + 60 * Period() << 2, ld_52);
   if (li_64) {
      li_76 = MathRound(MathAbs(ld_52 - Bid) / Point);
      if (li_76 == FALSE) li_76 = TRUE;
      li_80 = TargetPoints;
      if (TargetMethod == 1) li_80 = li_76 * TargetKoef;
      li_unused_84 = MarketInfo(Symbol(), MODE_STOPLEVEL);
      ld_88 = f5(TradeLots == 0.0, f22(RiskPercentage), TradeLots);
      if (ld_52 > Bid) {
         f7("Open accepted. Trying to open " + ld_88 + " Sell at " + Bid);
         li_96 = f21(Magic, li_80, li_76, TradeLots, OrdersComment);
      } else {
         if (ld_52 < Bid) {
            f7("Open accepted. Trying to open " + ld_88 + " Buy at " + Ask);
            li_96 = f20(Magic, li_80, li_76, TradeLots, OrdersComment);
         }
      }
      if (li_96 > 0) f14(l_name_4, Time[0] + 60 * Period() << 2, Bid);
   }
}

int f28(string a_name_0, int &ai_8, int &ai_12, int ai_16, int ai_20, string a_name_24, int &ai_32, int &ai_36, int ai_40, int ai_44) {
   int li_48 = f29(a_name_0, ai_8, ai_12, ai_16, ai_20, a_name_24);
   li_48 = li_48 && f29(a_name_24, ai_32, ai_36, ai_40, ai_44, a_name_0);
   if (li_48 && MathAbs(ai_8 - ai_32) <= 20.0 && MathAbs(ai_12 - ai_36) <= 20.0) {
      ObjectDelete(a_name_0);
      ObjectDelete(a_name_24);
      return (1);
   }
   return (0);
}

int f29(string as_0, int &ai_8, int &ai_12, int ai_16, int ai_20, string a_name_24) {
   int li_40;
   int li_44;
   int li_unused_32 = ai_8;
   int li_unused_36 = ai_12;
   if (!f12(as_0, ai_8, ai_12)) {
      if (f12(a_name_24, li_40, li_44)) {
         if (MathAbs(li_40 - ai_8) >= 20.0 || MathAbs(li_44 - ai_12) >= 20.0) f11(as_0, f25(), ai_8, ai_12, CharToStr(ai_16), "Wingdings", ai_20, 20);
         else ObjectDelete(a_name_24);
      } else f11(as_0, f25(), ai_8, ai_12, CharToStr(ai_16), "Wingdings", ai_20, 20);
      return (0);
   }
   return (1);
}

int f30(string as_0) {
   string ls_8 = StringSubstr(as_0, f26() + 3);
   int li_16 = StringFind(ls_8, " ");
   if (li_16 == -1) return (-1);
   return (StrToInteger(StringSubstr(ls_8, 0, li_16)));
}

void f31(bool ai_0) {
   int li_4;
   string l_name_20;
   int li_28;
   int lia_32[];
   string ls_36;
   int l_ticket_44;
   double ld_48;
   double ld_56;
   double ld_64;
   int li_72;
   int li_76;
   double ld_80;
   double ld_88;
   string ls_96;
   string ls_104;
   string l_name_8 = " arrow";
   if (!ai_0) {
      li_4 = ObjectsTotal();
      for (int li_16 = li_4 - 1; li_16 >= 0; li_16--) {
         l_name_20 = ObjectName(li_16);
         li_28 = ObjectType(l_name_20);
         if (StringFind(l_name_20, ID()) == 0 && li_28 == 1 || li_28 == 22) ObjectDelete(l_name_20);
      }
   } else {
      ArrayResize(lia_32, 0);
      li_4 = OrdersTotal();
      for (li_16 = li_4 - 1; li_16 >= 0; li_16--) {
         if (OrderSelect(li_16, SELECT_BY_POS, MODE_TRADES)) {
            if (OrderSymbol() == Symbol()) {
               if (OrderType() != OP_BUY && OrderType() != OP_SELL) continue;
               if (OrderStopLoss() > 0.0 || OrderTakeProfit() > 0.0) f3(lia_32, OrderTicket());
            }
         }
      }
      li_4 = ObjectsTotal();
      for (li_16 = li_4 - 1; li_16 >= 0; li_16--) {
         l_name_20 = ObjectName(li_16);
         ls_36 = l_name_20 + l_name_8;
         if (StringFind(l_name_20, ID()) != 0 || ObjectType(l_name_20) != 1) continue;
         l_ticket_44 = f30(l_name_20);
         if (f2(lia_32, l_ticket_44) < 0 || !OrderSelect(l_ticket_44, SELECT_BY_TICKET)) {
            ObjectDelete(l_name_20);
            ObjectDelete(l_name_20 + l_name_8);
         } else {
            if (StringSubstr(l_name_20, f26(), 2) == "SL") {
               if (OrderStopLoss() > 0.0) {
                  ld_48 = ObjectGet(l_name_20, OBJPROP_PRICE1);
                  ld_56 = NormalizeDouble(OrderStopLoss(), Digits);
                  if (f15(ls_36, li_72, ld_64)) {
                     ld_64 = NormalizeDouble(ld_64, Digits);
                     if (ld_64 != ld_56) {
                        f17(l_name_20, ld_56);
                        f14(ls_36, Time[0] - 60 * Period() << 2, ld_56);
                     } else {
                        li_28 = OrderType();
                        if ((li_28 == 0 && ld_48 > Ask) || (li_28 == 1 && ld_48 < Bid)) {
                           f7("Close command accepted for order #" + l_ticket_44);
                           if (!OrderClose(l_ticket_44, OrderLots(), f5(li_28 == 0, Bid, Ask), Slippage, Blue)) f7("Close failed for order#" + l_ticket_44 + ", last error #" + GetLastError());
                        } else {
                           li_76 = f32(NormalizeDouble(ld_48, Digits), -1);
                           if (li_76 > 0) f7("Modify failed for order#" + l_ticket_44 + ", last error #" + li_76);
                        }
                     }
                  }
               } else {
                  ObjectDelete(l_name_20);
                  ObjectDelete(l_name_8);
               }
            } else {
               if (StringSubstr(l_name_20, f26(), 2) == "TP") {
                  if (OrderTakeProfit() > 0.0) {
                     ld_48 = ObjectGet(l_name_20, OBJPROP_PRICE1);
                     ld_80 = NormalizeDouble(OrderTakeProfit(), Digits);
                     if (f15(ls_36, li_72, ld_88)) {
                        ld_88 = NormalizeDouble(ld_88, Digits);
                        if (ld_88 != ld_80) {
                           f17(l_name_20, ld_80);
                           f14(ls_36, Time[0] - 60 * Period() << 2, ld_80);
                        } else {
                           li_28 = OrderType();
                           if ((li_28 == 0 && ld_48 < Bid) || (li_28 == 1 && ld_48 > Ask)) {
                              f7("Close command accepted for order #" + l_ticket_44);
                              if (!OrderClose(l_ticket_44, OrderLots(), f5(li_28 == 0, Bid, Ask), Slippage, Blue)) f7("Close failed for order#" + l_ticket_44 + ", last error #" + GetLastError());
                           } else {
                              li_76 = f32(-1, NormalizeDouble(ld_48, Digits));
                              if (li_76 > 0) f7("Modify failed for order#" + l_ticket_44 + ", last error #" + li_76);
                           }
                        }
                     }
                  } else {
                     ObjectDelete(l_name_20);
                     ObjectDelete(l_name_8);
                  }
               } else {
                  ObjectDelete(l_name_20);
                  ObjectDelete(l_name_8);
               }
            }
         }
      }
      li_4 = OrdersTotal();
      for (li_16 = li_4 - 1; li_16 >= 0; li_16--) {
         if (OrderSelect(li_16, SELECT_BY_POS, MODE_TRADES)) {
            if (OrderSymbol() == Symbol()) {
               li_28 = OrderType();
               if (li_28 != 0 && li_28 != 1) continue;
               ls_96 = " " + OrderLots() + " " + f6(li_28 == 0, "Buy", "Sell") + " at " + DoubleToStr(OrderOpenPrice(), Digits);
               if (OrderStopLoss() > 0.0) {
                  ls_104 = ID() + "SL " + OrderTicket() + ls_96;
                  ls_36 = ls_104 + l_name_8;
                  if (!f18(ls_104, ld_48)) f16(ls_104, OrderStopLoss(), Coral, StopStyle, StopWidth);
                  f13(ls_36, Time[0] - 60 * Period() << 2, OrderStopLoss(), SYMBOL_LEFTPRICE, 2, Coral);
               }
               if (OrderTakeProfit() > 0.0) {
                  ls_104 = ID() + "TP " + OrderTicket() + ls_96;
                  ls_36 = ls_104 + l_name_8;
                  if (!f18(ls_104, ld_48)) f16(ls_104, OrderTakeProfit(), PaleGreen, TakeStyle, TakeWidth);
                  f13(ls_36, Time[0] - 60 * Period() << 2, OrderTakeProfit(), SYMBOL_LEFTPRICE, 2, PaleGreen);
               }
            }
         }
      }
   }
}

int f32(double ad_0 = -1.0, double ad_8 = -1.0) {
   double ld_16 = NormalizeDouble(OrderStopLoss(), Digits);
   double ld_24 = NormalizeDouble(OrderTakeProfit(), Digits);
   double l_price_32 = f5(ad_0 == -1.0, ld_16, NormalizeDouble(ad_0, Digits));
   double l_price_40 = f5(ad_8 == -1.0, ld_24, NormalizeDouble(ad_8, Digits));
   if (l_price_32 == ld_16 && l_price_40 == ld_24) return (0);
   f7("Trying to modify #" + OrderTicket() + " sl = " + DoubleToStr(ld_16, Digits) + ", tp = " + DoubleToStr(ld_24, Digits) + " to sl = " + DoubleToStr(l_price_32, Digits) +
      ", tp = " + DoubleToStr(l_price_40, Digits));
   if (OrderModify(OrderTicket(), OrderOpenPrice(), l_price_32, l_price_40, 0)) {
      f7("Order #" + OrderTicket() + "  modified successfully");
      return (0);
   }
   return (GetLastError());
}

void f33() {
   string ls_0 = ID() + "_f7";
   for (int l_index_8 = 0; l_index_8 < gi_152; l_index_8++) {
      f11(ls_0 + l_index_8, f25(), 10, 15 * l_index_8 + 20, gsa_164[l_index_8], "Lucida console", Gray);
      ObjectSet(ls_0 + l_index_8, OBJPROP_CORNER, 0);
   }
}

int f34() {
   string ls_0 = " " + ID() + "_enable_" + " acceptor";
   string ls_8 = " " + ID() + "_enable_" + " checker";
   string ls_16 = " " + ID() + "_enable_" + " label";
   int li_24 = 10;
   int li_28 = 25;
   int li_32 = 50;
   int li_36 = 25;
   bool li_40 = f28(ls_8, li_24, li_28, 84, 10025880, ls_0, li_32, li_36, 164, 255);
   if (li_40) {
      g_bool_196 = !g_bool_196;
      if (g_bool_196) f7("Manual drag trading is on. To disable it perform Switch off command.");
      else f7("Manual drag trading is off. To enable it perform Switch on command.");
   }
   string ls_44 = f6(g_bool_196, "Switch off", "Switch on");
   f11(ls_16, f25(), 10, 12, ls_44);
   return (g_bool_196);
}

void f35(bool ai_0) {
   int l_objs_total_48;
   string l_name_56;
   string l_name_4 = " " + ID() + "_clear_" + " acceptor";
   string l_name_12 = " " + ID() + "_clear_" + " checker";
   string l_name_20 = " " + ID() + "_clear_" + " label";
   if (!ai_0) {
      ObjectDelete(l_name_4);
      ObjectDelete(l_name_12);
      ObjectDelete(l_name_20);
      return;
   }
   int li_28 = 10;
   int li_32 = 95;
   int li_36 = 50;
   int li_40 = 95;
   bool li_44 = f28(l_name_12, li_28, li_32, 84, 10025880, l_name_4, li_36, li_40, 164, 255);
   if (li_44) {
      f7("Command accepted. Clearing objects.");
      l_objs_total_48 = ObjectsTotal();
      for (int li_52 = l_objs_total_48 - 1; li_52 >= 0; li_52--) {
         l_name_56 = ObjectName(li_52);
         if (StringFind(l_name_56, ID()) != -1)
            if (StringFind(l_name_56, "_f7") == -1) ObjectDelete(l_name_56);
      }
   }
   f11(l_name_20, f25(), 10, 82, "Clear");
}

int init() {
   gi_232 = TRUE;
   g_bool_196 = TRUE;
   f4();
   f10();
   string ls_0 = ID() + "comment";
   f7("Init finished successfully");
   return (0);
}

int start() {
   if (gi_232) {
      gi_232 = FALSE;
      g_time_236 = Time[0];
   }
   if (g_time_236 != Time[0]) g_time_236 = Time[0];
   int li_0 = f34();
   f35(li_0);
   f27(li_0);
   f31(li_0);
   f33();
   f34();
   ObjectsRedraw();
   return (0);
}

void deinit() {
   string l_name_8;
   int l_objs_total_0 = ObjectsTotal();
   for (int li_4 = l_objs_total_0 - 1; li_4 >= 0; li_4--) {
      l_name_8 = ObjectName(li_4);
      if (StringFind(l_name_8, ID()) != -1) ObjectDelete(l_name_8);
   }
}

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---