
#property copyright "Copyright © 2016, cjatradingtools.com"
#property link      "http://cjatradingtools.com/"

#property indicator_chart_window

extern int DaysToShow = 10;
extern string LLLLLLLLLLLLLLLLLLLLL_Asian = "Session Settings   LLLLLLLLLLLLLLL";
extern bool ShowAsianSession = TRUE;
extern int NextDayAsian = 0;
extern string AsiaLabel = "Asia";
extern string AsiaStart = "03:00";
extern string AsiaEnd = "12:00";
extern color AsiaColor = Goldenrod;
extern int AsiaLineStyle = 4;
extern int AsiaLineWidth = 0;
extern string LLLLLLLLLLLLLLLL_Asian_zone = "Session Settings   LLLLLLLLLLLLLLL";
extern bool ShowAsiaBestTradeZone = FALSE;
extern bool ShowAsiaZoneFilled = TRUE;
extern int NextDayAsianZone = 0;
extern string AsiazoneStart = "03:00";
extern string AsiazoneEnd = "06:00";
extern color AsiazoneColor = C'0x46,0x28,0x00';
extern string LLLLLLLLLLLLLLLLLLLLL_Euro = "Session Settings   LLLLLLLLLLLLLLL";
extern bool ShowEuroSession = TRUE;
extern int NextDayEuro = 0;
extern string EuroLabel = "Euro";
extern string EuroStart = "10:00";
extern string EuroEnd = "19:00";
extern color EuroColor = DeepSkyBlue;
extern int EuroLineStyle = 4;
extern int EuroLineWidth = 0;
extern string LLLLLLLLLLLLLLLL_Euro_zone = "Session Settings   LLLLLLLLLLLLLLL";
extern bool ShowEuroBestTradeZone = FALSE;
extern bool ShowEuroZoneFilled = TRUE;
extern int NextDayEuroZone = 0;
extern string EurozoneStart = "10:00";
extern string EurozoneEnd = "13:00";
extern color EurozoneColor = C'0x00,0x14,0x64';
extern string LLLLLLLLLLLLLLLLLLLLL_USA = "Session Settings   LLLLLLLLLLLLLLL";
extern bool ShowUSASession = TRUE;
extern int NextDayUSA = 1;
extern string USALabel = "USA";
extern string USAStart = "15:00";
extern string USAEnd = "01:00";
extern color USAColor = PaleGreen;
extern int USALineStyle = 4;
extern int USALineWidth = 0;
extern string LLLLLLLLLLLLLLLL_USA_zone = "Session Settings   LLLLLLLLLLLLLLL";
extern bool ShowUSABestTradeZone = FALSE;
extern bool ShowUSAZoneFilled = TRUE;
extern int NextDayUSAZone = 0;
extern string USAzoneStart = "15:30";
extern string USAzoneEnd = "19:00";
extern color USAzoneColor = C'0x00,0x28,0x00';
extern string LLLLLLLLLLLLLLLLLLLL_Labels = "Size font & display options   LLLLLLL";
extern bool Show_Line_Price = TRUE;
extern bool Show_HiLo_Price = TRUE;
extern string Line_font = "Vendana";
extern int Line_fontsize = 10;
extern bool Show_SessionLabel = TRUE;
double Gd_396;

// D1F1DB447EF654C1839D0A416E1B4F67
double f0_8() {
   double Ld_ret_0;
   if (Digits < 4) Ld_ret_0 = 0.01;
   else Ld_ret_0 = 0.0001;
   return (Ld_ret_0);
}

// E37F0136AA3FFAF149B351F6A4C948E9
void init() {
   Gd_396 = f0_8();
}

// 52D46093050F38C27267BCE42543EF60
void deinit() {
   ObjectDelete("as_1");
   ObjectDelete("as_2");
   ObjectDelete("eur_1");
   ObjectDelete("eur_2");
   ObjectDelete("usa_1");
   ObjectDelete("usa_2");
   f0_7();
   Comment("");
}

// EA2B2676C28C0DB26D39331A336C6B92
void start() {
   int datetime_0 = TimeCurrent();
   for (int count_4 = 0; count_4 < DaysToShow + 1; count_4++) {
      f0_3(datetime_0, " asian1  " + TimeToStr(datetime_0, TIME_DATE), AsiaStart, AsiaEnd, AsiaColor, 0, 1, NextDayAsian);
      f0_3(datetime_0, " asian2  " + TimeToStr(datetime_0, TIME_DATE), AsiaStart, AsiaEnd, AsiaColor, 0, 2, NextDayAsian);
      f0_2(datetime_0, " asian3  " + TimeToStr(datetime_0, TIME_DATE), AsiazoneStart, AsiazoneEnd, AsiazoneColor, 0, 1, NextDayAsianZone);
      f0_6(datetime_0, " euro1  " + TimeToStr(datetime_0, TIME_DATE), EuroStart, EuroEnd, EuroColor, 0, 1, NextDayEuro);
      f0_6(datetime_0, " euro2  " + TimeToStr(datetime_0, TIME_DATE), EuroStart, EuroEnd, EuroColor, 0, 2, NextDayEuro);
      f0_9(datetime_0, " euro3  " + TimeToStr(datetime_0, TIME_DATE), EurozoneStart, EurozoneEnd, EurozoneColor, 0, 1, NextDayEuroZone);
      f0_1(datetime_0, " usa1  " + TimeToStr(datetime_0, TIME_DATE), USAStart, USAEnd, USAColor, 0, 1, NextDayUSA);
      f0_1(datetime_0, " usa2  " + TimeToStr(datetime_0, TIME_DATE), USAStart, USAEnd, USAColor, 0, 2, NextDayUSA);
      f0_0(datetime_0, " usa3  " + TimeToStr(datetime_0, TIME_DATE), USAzoneStart, USAzoneEnd, USAzoneColor, 0, 1, NextDayUSAZone);
      datetime_0 = f0_5(datetime_0);
      if (TimeDayOfWeek(datetime_0) > 5 || TimeDayOfWeek(datetime_0) < 1) {
         while (true) {
            datetime_0 = f0_5(datetime_0);
            if (TimeDayOfWeek(datetime_0) > 5 || TimeDayOfWeek(datetime_0) < 1) continue;
            break;
         }
      }
   }
}

// 88F07BF2A3E2A04159AC984719B3F549
void f0_3(int Ai_0, string A_name_4, string As_12, string As_20, int Ai_unused_28, int Ai_unused_32, int Ai_36, int Ai_unused_40) {
   string Ls_76;
   string Ls_84;
   string Ls_92;
   string Ls_100;
   double Ld_108;
   string Ls_116;
   int str2time_44 = StrToTime(TimeToStr(Ai_0, TIME_DATE) + " " + As_12);
   int Li_48 = StrToTime(TimeToStr(Ai_0, TIME_DATE) + " " + As_20);
   if (NextDayAsian == 1) Li_48 += 86400;
   if (NextDayAsian == 1 && TimeDayOfWeek(Ai_0) == 5) Li_48 += 172800;
   int shift_68 = iBarShift(NULL, 0, str2time_44 - 60 * Period());
   int shift_72 = iBarShift(NULL, 0, Li_48);
   double high_52 = High[iHighest(NULL, 0, MODE_HIGH, shift_68 - shift_72, shift_72)];
   double low_60 = Low[iLowest(NULL, 0, MODE_LOW, shift_68 - shift_72, shift_72)];
   if (Show_SessionLabel) {
      if (Show_Line_Price) {
         Ls_76 = "                          ";
         Ls_84 = " " + DoubleToStr(high_52, Digits);
         Ls_92 = " " + DoubleToStr(low_60, Digits);
      } else {
         Ls_76 = "            ";
         Ls_84 = "";
         Ls_92 = "";
      }
      if (Show_HiLo_Price) {
         Ls_100 = "          ";
         Ld_108 = (high_52 - low_60) / Gd_396;
         Ls_116 = " #" + DoubleToStr(Ld_108, 0);
      }
      if (ShowAsianSession) {
         f0_4("as_1" + TimeToStr(Ai_0, TIME_DATE), 0, Ls_76 + AsiaLabel + " " + Ls_84, Line_fontsize, Line_font, AsiaColor, str2time_44, high_52, 1);
         f0_4("as_2" + TimeToStr(Ai_0, TIME_DATE), 0, Ls_76 + Ls_100 + AsiaLabel + Ls_116 + " " + Ls_92, Line_fontsize, Line_font, AsiaColor, str2time_44, low_60, 1);
      }
   }
   if (ShowAsianSession) {
      if (Ai_36 == 1) {
         ObjectCreate(A_name_4, OBJ_TREND, 0, 0, 0, 0);
         ObjectSet(A_name_4, OBJPROP_TIME1, str2time_44);
         ObjectSet(A_name_4, OBJPROP_TIME2, Li_48);
         ObjectSet(A_name_4, OBJPROP_PRICE1, high_52);
         ObjectSet(A_name_4, OBJPROP_PRICE2, high_52);
         ObjectSet(A_name_4, OBJPROP_STYLE, AsiaLineStyle);
         ObjectSet(A_name_4, OBJPROP_COLOR, AsiaColor);
         ObjectSet(A_name_4, OBJPROP_WIDTH, AsiaLineWidth);
         ObjectSet(A_name_4, OBJPROP_BACK, FALSE);
         ObjectSet(A_name_4, OBJPROP_RAY, FALSE);
      }
      if (Ai_36 == 2) {
         ObjectCreate(A_name_4, OBJ_TREND, 0, 0, 0, 0);
         ObjectSet(A_name_4, OBJPROP_TIME1, str2time_44);
         ObjectSet(A_name_4, OBJPROP_TIME2, Li_48);
         ObjectSet(A_name_4, OBJPROP_PRICE1, low_60);
         ObjectSet(A_name_4, OBJPROP_PRICE2, low_60);
         ObjectSet(A_name_4, OBJPROP_STYLE, AsiaLineStyle);
         ObjectSet(A_name_4, OBJPROP_COLOR, AsiaColor);
         ObjectSet(A_name_4, OBJPROP_WIDTH, AsiaLineWidth);
         ObjectSet(A_name_4, OBJPROP_BACK, FALSE);
         ObjectSet(A_name_4, OBJPROP_RAY, FALSE);
      }
   }
}

// 58C35603408E8C78B96D0398E4FB97DE
void f0_2(int Ai_0, string A_name_4, string As_12, string As_20, int Ai_unused_28, int Ai_unused_32, int Ai_36, int Ai_unused_40) {
   int str2time_44 = StrToTime(TimeToStr(Ai_0, TIME_DATE) + " " + As_12);
   int Li_48 = StrToTime(TimeToStr(Ai_0, TIME_DATE) + " " + As_20);
   if (NextDayAsianZone == 1) Li_48 += 86400;
   if (NextDayAsianZone == 1 && TimeDayOfWeek(Ai_0) == 5) Li_48 += 172800;
   int shift_68 = iBarShift(NULL, 0, str2time_44 - 60 * Period());
   int shift_72 = iBarShift(NULL, 0, Li_48);
   double high_52 = High[iHighest(NULL, 0, MODE_HIGH, shift_68 - shift_72, shift_72)];
   double low_60 = Low[iLowest(NULL, 0, MODE_LOW, shift_68 - shift_72, shift_72)];
   if (Ai_36 == 1 && ShowAsiaBestTradeZone) {
      ObjectCreate(A_name_4, OBJ_RECTANGLE, 0, 0, 0, 0);
      ObjectSet(A_name_4, OBJPROP_TIME1, str2time_44);
      ObjectSet(A_name_4, OBJPROP_TIME2, Li_48);
      ObjectSet(A_name_4, OBJPROP_PRICE1, high_52);
      ObjectSet(A_name_4, OBJPROP_PRICE2, low_60);
      ObjectSet(A_name_4, OBJPROP_STYLE, STYLE_SOLID);
      if (high_52 > WindowPriceMax() && low_60 < WindowPriceMin()) ObjectSet(A_name_4, OBJPROP_COLOR, CLR_NONE);
      else ObjectSet(A_name_4, OBJPROP_COLOR, AsiazoneColor);
      ObjectSet(A_name_4, OBJPROP_BACK, ShowAsiaZoneFilled);
   }
}

// C0C1871461FB4E45D7B07ECA981CEC8A
void f0_6(int Ai_0, string A_name_4, string As_12, string As_20, int Ai_unused_28, int Ai_unused_32, int Ai_36, int Ai_unused_40) {
   string Ls_76;
   string Ls_84;
   string Ls_92;
   string Ls_100;
   double Ld_108;
   string Ls_116;
   int str2time_44 = StrToTime(TimeToStr(Ai_0, TIME_DATE) + " " + As_12);
   int Li_48 = StrToTime(TimeToStr(Ai_0, TIME_DATE) + " " + As_20);
   if (NextDayEuro == 1) Li_48 += 86400;
   if (NextDayEuro == 1 && TimeDayOfWeek(Ai_0) == 5) Li_48 += 172800;
   int shift_68 = iBarShift(NULL, 0, str2time_44 - 60 * Period());
   int shift_72 = iBarShift(NULL, 0, Li_48);
   double high_52 = High[iHighest(NULL, 0, MODE_HIGH, shift_68 - shift_72, shift_72)];
   double low_60 = Low[iLowest(NULL, 0, MODE_LOW, shift_68 - shift_72, shift_72)];
   if (Show_SessionLabel) {
      if (Show_Line_Price) {
         Ls_76 = "                          ";
         Ls_84 = " " + DoubleToStr(high_52, Digits);
         Ls_92 = " " + DoubleToStr(low_60, Digits);
      } else {
         Ls_76 = "            ";
         Ls_84 = "";
         Ls_92 = "";
      }
      if (Show_HiLo_Price) {
         Ls_100 = "          ";
         Ld_108 = (high_52 - low_60) / Gd_396;
         Ls_116 = " #" + DoubleToStr(Ld_108, 0);
      }
      if (ShowAsianSession) {
         f0_4("eur_1" + TimeToStr(Ai_0, TIME_DATE), 0, Ls_76 + EuroLabel + " " + Ls_84, Line_fontsize, Line_font, EuroColor, str2time_44, high_52, 1);
         f0_4("eur_2" + TimeToStr(Ai_0, TIME_DATE), 0, Ls_76 + Ls_100 + EuroLabel + Ls_116 + " " + Ls_92, Line_fontsize, Line_font, EuroColor, str2time_44, low_60, 1);
      }
   }
   if (ShowEuroSession) {
      if (Ai_36 == 1) {
         ObjectCreate(A_name_4, OBJ_TREND, 0, 0, 0, 0);
         ObjectSet(A_name_4, OBJPROP_TIME1, str2time_44);
         ObjectSet(A_name_4, OBJPROP_TIME2, Li_48);
         ObjectSet(A_name_4, OBJPROP_PRICE1, high_52);
         ObjectSet(A_name_4, OBJPROP_PRICE2, high_52);
         ObjectSet(A_name_4, OBJPROP_STYLE, EuroLineStyle);
         ObjectSet(A_name_4, OBJPROP_COLOR, EuroColor);
         ObjectSet(A_name_4, OBJPROP_WIDTH, EuroLineWidth);
         ObjectSet(A_name_4, OBJPROP_BACK, FALSE);
         ObjectSet(A_name_4, OBJPROP_RAY, FALSE);
      }
      if (Ai_36 == 2) {
         ObjectCreate(A_name_4, OBJ_TREND, 0, 0, 0, 0);
         ObjectSet(A_name_4, OBJPROP_TIME1, str2time_44);
         ObjectSet(A_name_4, OBJPROP_TIME2, Li_48);
         ObjectSet(A_name_4, OBJPROP_PRICE1, low_60);
         ObjectSet(A_name_4, OBJPROP_PRICE2, low_60);
         ObjectSet(A_name_4, OBJPROP_STYLE, EuroLineStyle);
         ObjectSet(A_name_4, OBJPROP_COLOR, EuroColor);
         ObjectSet(A_name_4, OBJPROP_WIDTH, EuroLineWidth);
         ObjectSet(A_name_4, OBJPROP_BACK, FALSE);
         ObjectSet(A_name_4, OBJPROP_RAY, FALSE);
      }
   }
}

// F9FE9282B4CB0801C3BA308DEBD33C2D
void f0_9(int Ai_0, string A_name_4, string As_12, string As_20, int Ai_unused_28, int Ai_unused_32, int Ai_36, int Ai_unused_40) {
   int str2time_44 = StrToTime(TimeToStr(Ai_0, TIME_DATE) + " " + As_12);
   int Li_48 = StrToTime(TimeToStr(Ai_0, TIME_DATE) + " " + As_20);
   if (NextDayEuroZone == 1) Li_48 += 86400;
   if (NextDayEuroZone == 1 && TimeDayOfWeek(Ai_0) == 5) Li_48 += 172800;
   int shift_68 = iBarShift(NULL, 0, str2time_44 - 60 * Period());
   int shift_72 = iBarShift(NULL, 0, Li_48);
   double high_52 = High[iHighest(NULL, 0, MODE_HIGH, shift_68 - shift_72, shift_72)];
   double low_60 = Low[iLowest(NULL, 0, MODE_LOW, shift_68 - shift_72, shift_72)];
   if (Ai_36 == 1 && ShowEuroBestTradeZone) {
      ObjectCreate(A_name_4, OBJ_RECTANGLE, 0, 0, 0, 0);
      ObjectSet(A_name_4, OBJPROP_TIME1, str2time_44);
      ObjectSet(A_name_4, OBJPROP_TIME2, Li_48);
      ObjectSet(A_name_4, OBJPROP_PRICE1, high_52);
      ObjectSet(A_name_4, OBJPROP_PRICE2, low_60);
      ObjectSet(A_name_4, OBJPROP_STYLE, STYLE_SOLID);
      if (high_52 > WindowPriceMax() && low_60 < WindowPriceMin()) ObjectSet(A_name_4, OBJPROP_COLOR, CLR_NONE);
      else ObjectSet(A_name_4, OBJPROP_COLOR, EurozoneColor);
      ObjectSet(A_name_4, OBJPROP_BACK, ShowEuroZoneFilled);
   }
}

// 491FC3CE8629A276BCB79602F26859A5
void f0_1(int Ai_0, string A_name_4, string As_12, string As_20, int Ai_unused_28, int Ai_unused_32, int Ai_36, int Ai_unused_40) {
   string Ls_76;
   string Ls_84;
   string Ls_92;
   string Ls_100;
   double Ld_108;
   string Ls_116;
   int str2time_44 = StrToTime(TimeToStr(Ai_0, TIME_DATE) + " " + As_12);
   int Li_48 = StrToTime(TimeToStr(Ai_0, TIME_DATE) + " " + As_20);
   if (NextDayUSA == 1) Li_48 += 86400;
   if (NextDayUSA == 1 && TimeDayOfWeek(Ai_0) == 5) Li_48 += 172800;
   int shift_68 = iBarShift(NULL, 0, str2time_44 - 60 * Period());
   int shift_72 = iBarShift(NULL, 0, Li_48);
   double high_52 = High[iHighest(NULL, 0, MODE_HIGH, shift_68 - shift_72, shift_72)];
   double low_60 = Low[iLowest(NULL, 0, MODE_LOW, shift_68 - shift_72, shift_72)];
   if (Show_SessionLabel) {
      if (Show_Line_Price) {
         Ls_76 = "                          ";
         Ls_84 = " " + DoubleToStr(high_52, Digits);
         Ls_92 = " " + DoubleToStr(low_60, Digits);
      } else {
         Ls_76 = "            ";
         Ls_84 = "";
         Ls_92 = "";
      }
      if (Show_HiLo_Price) {
         Ls_100 = "          ";
         Ld_108 = (high_52 - low_60) / Gd_396;
         Ls_116 = " #" + DoubleToStr(Ld_108, 0);
      }
      if (ShowAsianSession) {
         f0_4("usa_1" + TimeToStr(Ai_0, TIME_DATE), 0, Ls_76 + USALabel + " " + Ls_84, Line_fontsize, Line_font, USAColor, str2time_44, high_52, 1);
         f0_4("usa_2" + TimeToStr(Ai_0, TIME_DATE), 0, Ls_76 + Ls_100 + USALabel + Ls_116 + " " + Ls_92, Line_fontsize, Line_font, USAColor, str2time_44, low_60, 1);
      }
   }
   if (ShowUSASession) {
      if (Ai_36 == 1) {
         ObjectCreate(A_name_4, OBJ_TREND, 0, 0, 0, 0);
         ObjectSet(A_name_4, OBJPROP_TIME1, str2time_44);
         ObjectSet(A_name_4, OBJPROP_TIME2, Li_48);
         ObjectSet(A_name_4, OBJPROP_PRICE1, high_52);
         ObjectSet(A_name_4, OBJPROP_PRICE2, high_52);
         ObjectSet(A_name_4, OBJPROP_STYLE, USALineStyle);
         ObjectSet(A_name_4, OBJPROP_COLOR, USAColor);
         ObjectSet(A_name_4, OBJPROP_WIDTH, USALineWidth);
         ObjectSet(A_name_4, OBJPROP_BACK, FALSE);
         ObjectSet(A_name_4, OBJPROP_RAY, FALSE);
      }
      if (Ai_36 == 2) {
         ObjectCreate(A_name_4, OBJ_TREND, 0, 0, 0, 0);
         ObjectSet(A_name_4, OBJPROP_TIME1, str2time_44);
         ObjectSet(A_name_4, OBJPROP_TIME2, Li_48);
         ObjectSet(A_name_4, OBJPROP_PRICE1, low_60);
         ObjectSet(A_name_4, OBJPROP_PRICE2, low_60);
         ObjectSet(A_name_4, OBJPROP_STYLE, USALineStyle);
         ObjectSet(A_name_4, OBJPROP_COLOR, USAColor);
         ObjectSet(A_name_4, OBJPROP_WIDTH, USALineWidth);
         ObjectSet(A_name_4, OBJPROP_BACK, FALSE);
         ObjectSet(A_name_4, OBJPROP_RAY, FALSE);
      }
   }
}

// 012CF0065BE4245AC967A7F82E8C9F61
void f0_0(int Ai_0, string A_name_4, string As_12, string As_20, int Ai_unused_28, int Ai_unused_32, int Ai_36, int Ai_unused_40) {
   int str2time_44 = StrToTime(TimeToStr(Ai_0, TIME_DATE) + " " + As_12);
   int Li_48 = StrToTime(TimeToStr(Ai_0, TIME_DATE) + " " + As_20);
   if (NextDayUSAZone == 1) Li_48 += 86400;
   if (NextDayUSAZone == 1 && TimeDayOfWeek(Ai_0) == 5) Li_48 += 172800;
   int shift_68 = iBarShift(NULL, 0, str2time_44 - 60 * Period());
   int shift_72 = iBarShift(NULL, 0, Li_48);
   double high_52 = High[iHighest(NULL, 0, MODE_HIGH, shift_68 - shift_72, shift_72)];
   double low_60 = Low[iLowest(NULL, 0, MODE_LOW, shift_68 - shift_72, shift_72)];
   if (Ai_36 == 1 && ShowUSABestTradeZone) {
      ObjectCreate(A_name_4, OBJ_RECTANGLE, 0, 0, 0, 0);
      ObjectSet(A_name_4, OBJPROP_TIME1, str2time_44);
      ObjectSet(A_name_4, OBJPROP_TIME2, Li_48);
      ObjectSet(A_name_4, OBJPROP_PRICE1, high_52);
      ObjectSet(A_name_4, OBJPROP_PRICE2, low_60);
      ObjectSet(A_name_4, OBJPROP_STYLE, STYLE_SOLID);
      if (high_52 > WindowPriceMax() && low_60 < WindowPriceMin()) ObjectSet(A_name_4, OBJPROP_COLOR, CLR_NONE);
      else ObjectSet(A_name_4, OBJPROP_COLOR, USAzoneColor);
      ObjectSet(A_name_4, OBJPROP_BACK, ShowUSAZoneFilled);
   }
}

// C221A17B360C36A473B962FBBDF51DA3
void f0_7() {
   int datetime_0 = TimeCurrent();
   for (int count_4 = 0; count_4 < DaysToShow + 1; count_4++) {
      ObjectDelete(" asian1  " + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete(" asian2  " + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete(" asian3  " + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete(" euro1  " + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete(" euro2  " + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete(" euro3  " + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete(" usa1  " + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete(" usa2  " + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete(" usa3  " + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete("as_1" + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete("as_2" + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete("eur_1" + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete("eur_2" + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete("usa_1" + TimeToStr(datetime_0, TIME_DATE));
      ObjectDelete("usa_2" + TimeToStr(datetime_0, TIME_DATE));
      datetime_0 = f0_5(datetime_0);
      if (TimeDayOfWeek(datetime_0) > 5 || TimeDayOfWeek(datetime_0) < 1) {
         while (true) {
            datetime_0 = f0_5(datetime_0);
            if (TimeDayOfWeek(datetime_0) > 5 || TimeDayOfWeek(datetime_0) < 1) continue;
            break;
         }
      }
   }
}

// B1F8CFA9539C6EF805A535AE3E572279
int f0_5(int Ai_0) {
   int Li_4 = TimeYear(Ai_0);
   int Li_8 = TimeMonth(Ai_0);
   int Li_12 = TimeDay(Ai_0);
   int hour_16 = TimeHour(Ai_0);
   int minute_20 = TimeMinute(Ai_0);
   Li_12--;
   if (Li_12 == 0) {
      Li_8--;
      if (Li_8 == 0) {
         Li_4--;
         Li_8 = 12;
      }
      if (Li_8 == 4 || Li_8 == 6 || Li_8 == 9 || Li_8 == 11) Li_12 = 30;
      if (Li_8 == 1 || Li_8 == 3 || Li_8 == 5 || Li_8 == 7 || Li_8 == 8 || Li_8 == 10 || Li_8 == 12) Li_12 = 31;
      if (Li_8 == 2) {
         if (MathMod(Li_4, 4) == 0.0) Li_12 = 29;
         else Li_12 = 28;
      }
   }
   return (StrToTime(Li_4 + "." + Li_8 + "." + Li_12 + " " + hour_16 + ":" + minute_20));
}

// 9DFFBF69FFBA8BC38BC4E01ABF4B1675
void f0_4(string A_name_0, int Ai_unused_8, string A_text_12, int A_fontsize_20, string A_fontname_24, color A_color_32, int A_datetime_36, double A_price_40, bool Ai_48) {
   if (Ai_48) ObjectDelete(A_name_0);
   if (ObjectFind(A_name_0) != 0) {
      ObjectCreate(A_name_0, OBJ_TEXT, 0, A_datetime_36, A_price_40);
      ObjectSetText(A_name_0, A_text_12, A_fontsize_20, A_fontname_24, A_color_32);
      ObjectSet(A_name_0, OBJPROP_BACK, FALSE);
      return;
   }
   ObjectMove(A_name_0, 0, A_datetime_36, A_price_40);
}