#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DodgerBlue
#property indicator_color2 Red

#import "kernel32.dll"
   void GetLocalTime(int& a0[]);
   int GetTimeZoneInformation(int& a0[]);
#import

double G_ibuf_76[];
double G_ibuf_80[];
bool Gi_84 = FALSE;
bool Gi_88 = FALSE;
double G_iadx_92;
double G_iadx_100;
double G_iadx_108;
double G_iadx_116;
double Gda_unused_124[];
double Gda_unused_128[];
bool Gi_unused_132 = FALSE;
bool Gi_unused_136 = FALSE;
bool Gi_unused_140 = FALSE;
bool Gi_unused_144 = FALSE;
int Gi_unused_148 = 0;
int Gi_unused_152 = 0;
int Gi_unused_156 = 0;
extern string Setting_1 = "<<<< If Broker time is GMT+2 - enter 2 >>>>>>";
extern int GMTHours = 0;
extern int GMTMinutes = 0;
extern string Setting_2 = "<<<< Signal Display Settings >>>>>>>>>>>>>>>>>>>>>>";
bool Gi_188 = TRUE;
extern int Shift_UP_DN = 0;
extern int Shift_SIDEWAYS = 0;
extern bool Show_CommentsText_Bold = TRUE;
string Gs_unused_204 = "<<<< TREND + Entry Signals Display >>>>>>>>>";
bool Gi_212 = TRUE;
int Gi_216 = 0;
int Gi_220 = 0;
bool Gi_unused_224 = TRUE;
string Gs_unused_228 = "<<<< Daily Average Settings >>>>>>>>>>>>>>>>>>>";
bool Gi_unused_236 = TRUE;
bool Gi_unused_240 = TRUE;
int Gi_unused_244 = 20;
int Gi_unused_248 = 9;
string Gs_unused_252 = "Arial Bold";
string Gs_unused_260 = "<<<< Colors Setting is Fixed >>>>>>>>>";
string Gs_unused_268 = "<<<<Colors Setting is Fixed>>>>>>>>>";
int Gi_276 = 1;
string Gs_unused_280 = "<<<< Manual Color Inputs >>>>>>>>>";
int Gi_unused_288 = 0;
int Gi_unused_292 = 8421504;
bool Gi_296 = TRUE;
string Gs_unused_300 = "<<<< Use Open Graphics >>>>>>>>>";
bool Gi_308 = TRUE;
string Gs_unused_312 = "<<<< ENTRY EXIT Alerts >>>>>>>>>";
int G_timeframe_320 = PERIOD_M1;
int G_timeframe_324 = PERIOD_M5;
bool Gi_unused_328 = FALSE;
bool Gi_unused_332 = FALSE;
string Gs_unused_336 = "alert2";
string Gs_unused_344 = "alert2";
string Gs_unused_352 = "<<<< TREND Analysis Alerts >>>>>>>>>";
int G_timeframe_360 = PERIOD_M1;
int G_timeframe_364 = PERIOD_M5;
int G_timeframe_368 = PERIOD_M15;
int G_timeframe_372 = PERIOD_M30;
int G_timeframe_376 = PERIOD_H1;
int G_timeframe_380 = PERIOD_H4;
int Gi_unused_384 = 2;
int Gi_unused_388 = 9;
string Gs_unused_392 = "Arial Bold";
int Gi_400 = 0;
bool Gi_404 = FALSE;
int Gi_unused_408 = 50;
int Gi_unused_412 = 9;
string Gs_unused_416 = "Arial Bold";
extern string Setting_3 = "<<<< Daily Open Settings >>>>>>>>>>>>>>>>>>>>";
extern bool Show_Daily_OPEN = TRUE;
extern int SHIFT_Daily_OPEN_TEXT = 0;
extern int Open_FontSize = 9;
extern string Open_Font = "Arial Bold";
extern string Setting_4 = "<<<< Central Pivot Settings >>>>>>>>>>>>>>>>>>>>";
extern bool Show_CentralPIVOT_Only = TRUE;
extern int SHIFT_CentralPIVOT_Only_TEXT = 0;
extern int CentralPivot_FontSize = 9;
extern string CentralPivot_Font = "Arial Bold";
extern string Setting_5 = "<<<< Adx Crossing Indicator Settings >>>>>>>>>>>>>>>>>>>>";
extern bool Arrow_Indicator = TRUE;
extern int ADXbars = 14;
extern string Bars_Counted = "500 - Fixed";
int G_bars_504 = 500;
extern bool AlertOn = FALSE;
extern bool EmailON = FALSE;
extern bool PushAlert = FALSE;
int G_timeframe_516 = 0;
int Gi_520 = 500;
int Gi_532;
int Gi_536;
int Gi_unused_540;
int Gi_unused_544;
int Gi_unused_548;
int Gi_unused_552;
int Gi_unused_556;
int Gi_unused_560;
int Gi_unused_564;
int Gi_unused_568;
int Gi_unused_572;
int Gi_unused_576;
int Gi_unused_580;
int Gi_unused_584;
int Gi_unused_588;
int Gi_unused_592;
int Gi_unused_596;
int Gi_unused_600;
int Gi_604;
int Gi_unused_608;
int Gi_unused_612;
int Gi_unused_616;
int Gi_unused_620;
double Gda_unused_624[];
double Gda_unused_628[];
double Gda_unused_632[];
double Gda_unused_636[];
double Gda_unused_640[];
double Gda_unused_644[];
double Gda_unused_648[];
double Gda_unused_652[];
int Gi_unused_656;
int Gi_unused_660;
int Gi_unused_664;
int G_count_668 = 0;
string G_name_672 = "";
int Gi_680 = 13;
int Gi_unused_684 = 8;
int Gia_unused_688[13];
int Gi_unused_692 = 3;
datetime Gt_unused_696 = 0;
int G_timeframe_700 = 0;
double G_high_708;
double G_low_716;
double G_open_724;
double G_day_732;
double G_day_740;
double G_high_748 = 0.0;
double G_low_756 = 0.0;
double G_close_764 = 0.0;
double Gd_unused_772 = 0.0;
string Gs_780;
string Gs_788;
string Gs_796;
string Gs_804;
string Gs_812;
string Gs_dummy_820;
string Gs_dummy_828;
string Gs_836;
string Gs_unused_844;
bool Gi_852 = TRUE;
double Gd_856;
bool Gi_864 = FALSE;
int Gi_unused_868 = 0;
int Gi_unused_872 = 0;
int Gi_unused_876 = 0;
int Gi_unused_880 = 0;

// 1F3272F63CFFE4358AB8E05967359FED
string f0_1(int Ai_0) {
   if (!Gi_864) return (TimeToStr(Ai_0, TIME_MINUTES));
   int Li_4 = TimeHour(Ai_0);
   int minute_8 = TimeMinute(Ai_0);
   string Ls_12 = " AM";
   if (Li_4 >= 12) {
      Li_4 -= 12;
      Ls_12 = " PM";
   }
   if (Li_4 == 0) Li_4 = 12;
   string Ls_ret_20 = DoubleToStr(Li_4, 0) + ":";
   if (minute_8 < 10) Ls_ret_20 = Ls_ret_20 + "0";
   Ls_ret_20 = Ls_ret_20 + DoubleToStr(minute_8, 0);
   Ls_ret_20 = Ls_ret_20 + Ls_12;
   return (Ls_ret_20);
}

// D1F1DB447EF654C1839D0A416E1B4F67
double f0_5() {
   double Ld_ret_0;
   if (Digits < 4) Ld_ret_0 = 0.01;
   else Ld_ret_0 = 0.0001;
   return (Ld_ret_0);
}

// CD49F40C714ED1EC9C25781C2D8964F6
void f0_4(string A_name_0, int A_window_8, string A_text_12, int A_fontsize_20, string A_fontname_24, color A_color_32, int A_corner_36, int A_y_40, int A_x_44) {
   if (ObjectFind(A_name_0) != 0) ObjectCreate(A_name_0, OBJ_LABEL, A_window_8, 0, 0);
   ObjectSetText(A_name_0, A_text_12, A_fontsize_20, A_fontname_24, A_color_32);
   ObjectSet(A_name_0, OBJPROP_CORNER, A_corner_36);
   ObjectSet(A_name_0, OBJPROP_XDISTANCE, A_x_44);
   ObjectSet(A_name_0, OBJPROP_YDISTANCE, A_y_40);
}

// 1B6369A007EAF6195B8CF983729BF251
void f0_0(string A_name_0, int A_window_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, A_window_8, 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, TRUE);
      return;
   }
   ObjectMove(A_name_0, 0, A_datetime_36, A_price_40);
}

// F4AF69835131F6D06D33C5A616A2972C
void f0_6(string A_name_0, int Ai_unused_8, double A_price_12, double A_price_20, double A_width_28, double A_style_36, color A_color_44, bool Ai_48) {
   if (Ai_48) ObjectDelete(A_name_0);
   if (ObjectFind(A_name_0) != 0) {
      ObjectCreate(A_name_0, OBJ_TREND, 0, iTime(NULL, PERIOD_D1, Gi_400) + 3600 * GMTHours + 60 * GMTMinutes, A_price_12, Time[0], A_price_20);
      ObjectSet(A_name_0, OBJPROP_COLOR, A_color_44);
      ObjectSet(A_name_0, OBJPROP_RAY, FALSE);
      ObjectSet(A_name_0, OBJPROP_BACK, TRUE);
      ObjectSet(A_name_0, OBJPROP_WIDTH, A_width_28);
      ObjectSet(A_name_0, OBJPROP_STYLE, A_style_36);
      return;
   }
   ObjectMove(A_name_0, 0, iTime(NULL, PERIOD_D1, Gi_400 + 0) + 3600 * GMTHours + 60 * GMTMinutes, Time[0]);
}

// C248C34F8D287A6A2F05C377B9F06428
string f0_3(int Ai_0, int Ai_4, int Ai_8, int Ai_12, int Ai_16, int Ai_20) {
   string Ls_24 = Ai_4 + 100;
   Ls_24 = StringSubstr(Ls_24, 1);
   string Ls_32 = Ai_8 + 100;
   Ls_32 = StringSubstr(Ls_32, 1);
   string Ls_40 = Ai_12 + 100;
   Ls_40 = StringSubstr(Ls_40, 1);
   string Ls_48 = Ai_16 + 100;
   Ls_48 = StringSubstr(Ls_48, 1);
   string Ls_56 = Ai_20 + 100;
   Ls_56 = StringSubstr(Ls_56, 1);
   return (StringConcatenate(Ai_0, ".", Ls_24, ".", Ls_32, " ", Ls_40, ":", Ls_48, ":", Ls_56));
}

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   Gd_856 = f0_5();
   IndicatorShortName("Ultimate_Trend_Signals");
   Gs_780 = "M1";
   Gs_788 = "M5";
   Gs_796 = "M15";
   Gs_804 = "M30";
   Gs_812 = "H1";
   Gs_836 = "H4";
   Gs_unused_844 = "D1";
   IndicatorBuffers(2);
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0, 108);
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexArrow(1, 108);
   SetIndexBuffer(0, G_ibuf_76);
   SetIndexBuffer(1, G_ibuf_80);
   GlobalVariableSet("AlertTime" + Symbol() + Period(), TimeCurrent());
   GlobalVariableSet("SignalType" + Symbol() + Period(), 5);
   GlobalVariableSet("LastAlert" + Symbol() + Period(), 0);
   return (0);
}

// 52D46093050F38C27267BCE42543EF60
int deinit() {
   f0_2();
   for (G_count_668 = 0; G_count_668 < Gi_680; G_count_668++) G_name_672 = "mml";
   ObjectDelete(G_name_672);
   G_name_672 = "mml_txt";
   ObjectDelete(G_name_672);
   GlobalVariableDel("AlertTime" + Symbol() + Period());
   GlobalVariableDel("SignalType" + Symbol() + Period());
   GlobalVariableDel("LastAlert" + Symbol() + Period());
   
   ObjectsDeleteAll(0);
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   int Lia_0[4];
   int Lia_4[43];
   string Ls_unused_8;
   string Ls_16;
   string Ls_unused_24;
   double Ld_unused_32;
   int Li_40;
   int Li_44;
   int Li_unused_48;
   string Ls_52;
   int Li_unused_60;
   string Ls_64;
   int Li_unused_72;
   double imacd_76;
   double imacd_84;
   double imacd_92;
   double imacd_100;
   double imacd_108;
   double imacd_116;
   string Ls_124;
   int Li_unused_132;
   double irsi_136;
   string Ls_144;
   int Li_unused_152;
   double irsi_156;
   string Ls_164;
   int Li_unused_172;
   double irsi_176;
   string Ls_184;
   int Li_unused_192;
   double irsi_196;
   double imacd_204;
   double imacd_212;
   string Ls_220;
   string Ls_228;
   string Ls_236;
   int Li_244;
   int Li_248;
   int Li_252;
   string Ls_256;
   string Ls_264;
   string Ls_272;
   int Li_280;
   int Li_284;
   int Li_288;
   string Ls_292;
   int Li_300;
   string Ls_304;
   int Li_312;
   string Ls_316;
   int Li_324;
   string Ls_328;
   int Li_unused_336;
   double irsi_340;
   string Ls_348;
   int Li_unused_356;
   double irsi_360;
   string Ls_368;
   int Li_unused_376;
   string Ls_unused_380;
   double imacd_388;
   double imacd_396;
   string Ls_404;
   int Li_412;
   string Ls_416;
   int Li_424;
   string Ls_428;
   int Li_436;
   string Ls_440;
   int Li_unused_448;
   double irsi_452;
   string Ls_460;
   int Li_unused_468;
   double irsi_472;
   string Ls_480;
   int Li_unused_488;
   string Ls_unused_492;
   string Ls_500;
   int Li_508;
   string Ls_512;
   int Li_520;
   string Ls_524;
   int Li_532;
   string Ls_536;
   int Li_unused_544;
   double irsi_548;
   string Ls_556;
   int Li_unused_564;
   double irsi_568;
   string Ls_576;
   int Li_unused_584;
   string Ls_unused_588;
   string Ls_596;
   int Li_unused_604;
   string Ls_624;
   int Li_unused_632;
   string Ls_644;
   string Ls_unused_660;
   string Ls_unused_668;
   string Ls_676;
   int Li_unused_684;
   int Li_unused_688;
   int Li_692;
   double Ld_704;
   double Ld_712;
   double Ld_720;
   double Ld_728;
   double Ld_736;
   double Ld_744;
   double Ld_752;
   double Ld_760;
   string Ls_768;
   string Ls_776;
   int Li_784;
   int Li_788;
   int Li_792;
   string Ls_828;
   string Ls_836;
   int Li_844;
   string Ls_912;
   int Li_920;
   int shift_924;
   int Li_952;
   double Ld_1236;
   int ind_counted_1252;
   string Ls_unused_928 = "";
   string Ls_unused_936 = "";
   Gt_unused_696 = Time[0];
   G_timeframe_700 = Period();
   int timeframe_944 = Period();
   if (timeframe_944 > PERIOD_D1) return (-1);
   if (Gi_276 >= 0) {
      for (int Li_948 = 1; Li_948 <= 9; Li_948++) {
         Li_952 = Li_948;
         if (Li_952 == 2) {
            if (Gi_276 == 1) {
               Gi_unused_540 = 9830400;
               Gi_unused_544 = 6553600;
               Gi_unused_548 = 120;
               Gi_unused_552 = 170;
               Gi_unused_556 = 16739840;
               Gi_unused_560 = 16729600;
               Gi_unused_564 = 16716820;
               Gi_unused_568 = 13762560;
               Gi_unused_572 = 12451840;
               Gi_unused_576 = 200;
               Gi_unused_580 = 220;
               Gi_unused_584 = 655615;
               Gi_unused_588 = 18175;
               Gi_unused_592 = 28415;
               Gi_unused_616 = 7895160;
               Gi_unused_620 = 30720;
               Gi_unused_596 = 16748574;
               Gi_unused_600 = 36095;
               Gi_unused_608 = 16760576;
               Gi_unused_612 = 65535;
               Gi_604 = 3329434;
               Gi_532 = 4259840;
               Gi_536 = 16748574;
            }
         }
      }
   }
   if (Gi_852) {
      Gi_852 = FALSE;
      if (Gi_276 >= 0) WindowRedraw();
   }
   if (!IsDllsAllowed()) {
      Alert(" " + "Ultimate_Trend_Signals" + "  DLLs are disabled. \n To enable tick the checkbox \n in the Common Tab of indicator");
      return (0);
   }
   int Li_956 = IndicatorCounted();
   GetLocalTime(Lia_0);
   int Li_960 = Lia_0[0] & 65535;
   int Li_964 = Lia_0[0] >> 16;
   int Li_968 = Lia_0[1] >> 16;
   int Li_972 = Lia_0[2] & 65535;
   int Li_976 = Lia_0[2] >> 16;
   int Li_980 = Lia_0[3] & 65535;
   int Li_984 = Lia_0[3] >> 16;
   string Ls_988 = f0_3(Li_960, Li_964, Li_968, Li_972, Li_976, Li_980);
   int str2time_996 = StrToTime(Ls_988);
   int Li_1000 = 0;
   int Li_1004 = GetTimeZoneInformation(Lia_4);
   if (Li_1004 != 0) Li_1000 = Lia_4[0];
   if (Li_1004 == 2) Li_1000 += Lia_4[42];
   int datetime_1008 = TimeCurrent();
   int Li_1012 = str2time_996 + 60 * Li_1000;
   string Ls_1016 = f0_1(Li_1012);
   string Ls_1024 = f0_1(str2time_996);
   string Ls_1032 = f0_1(TimeCurrent());
   if (Show_CommentsText_Bold) Ls_16 = "Arial Bold";
   else Ls_16 = "Arial";
   G_day_732 = 0;
   G_day_740 = 0;
   for (int Li_1040 = 99999; Li_1040 != 0; Li_1040--) {
      if (TimeDayOfWeek(Time[Li_1040]) == 0) G_day_732 = G_day_740;
      else G_day_732 = TimeDay(Time[Li_1040] - (3600 * GMTHours + 60 * GMTMinutes));
      if (G_day_740 != G_day_732) {
         G_close_764 = Close[Li_1040 + 1];
         G_open_724 = Open[Li_1040];
         G_high_748 = G_high_708;
         G_low_756 = G_low_716;
         G_high_708 = High[Li_1040];
         G_low_716 = Low[Li_1040];
         G_day_740 = G_day_732;
      }
      if (High[Li_1040] > G_high_708) G_high_708 = High[Li_1040];
      if (Low[Li_1040] < G_low_716) G_low_716 = Low[Li_1040];
   }
   double Ld_1044 = (G_high_748 + G_low_756 + G_close_764) / 3.0;
   double Ld_1052 = 2.0 * Ld_1044 + (G_high_748 - 2.0 * G_low_756);
   double Ld_1060 = Ld_1044 + (G_high_748 - G_low_756);
   double Ld_1068 = 2.0 * Ld_1044 - G_low_756;
   double Ld_1076 = 2.0 * Ld_1044 - G_high_748;
   double Ld_1084 = Ld_1044 - (G_high_748 - G_low_756);
   double Ld_1092 = 2.0 * Ld_1044 - (2.0 * G_high_748 - G_low_756);
   double Ld_1100 = (Ld_1084 + Ld_1092) / 2.0;
   double Ld_1108 = (Ld_1076 + Ld_1084) / 2.0;
   double Ld_1116 = (Ld_1044 + Ld_1076) / 2.0;
   double Ld_1124 = (Ld_1044 + Ld_1068) / 2.0;
   double Ld_1132 = (Ld_1068 + Ld_1060) / 2.0;
   double Ld_1140 = (Ld_1060 + Ld_1052) / 2.0;
   double Ld_1148 = G_open_724;
   double ihigh_1156 = iHigh(NULL, PERIOD_D1, 0);
   double ilow_1164 = iLow(NULL, PERIOD_D1, 0);
   double high_1172 = G_high_748;
   double low_1180 = G_low_756;
   int Li_1188 = 0;
   int Li_1192 = 0;
   int Li_1196 = 0;
   int Li_1200 = 0;
   int Li_unused_1204 = 0;
   int Li_1208 = 0;
   Li_1188 = (iHigh(NULL, PERIOD_D1, 1) - iLow(NULL, PERIOD_D1, 1)) / Gd_856;
   for (Li_1208 = 1; Li_1208 <= 5; Li_1208++) Li_1192 = Li_1192 + (iHigh(NULL, PERIOD_D1, Li_1208) - iLow(NULL, PERIOD_D1, Li_1208)) / Gd_856;
   for (Li_1208 = 1; Li_1208 <= 10; Li_1208++) Li_1196 = Li_1196 + (iHigh(NULL, PERIOD_D1, Li_1208) - iLow(NULL, PERIOD_D1, Li_1208)) / Gd_856;
   for (Li_1208 = 1; Li_1208 <= 20; Li_1208++) Li_1200 = Li_1200 + (iHigh(NULL, PERIOD_D1, Li_1208) - iLow(NULL, PERIOD_D1, Li_1208)) / Gd_856;
   Li_1192 /= 5;
   Li_1196 /= 10;
   Li_1200 /= 20;
   double Ld_unused_1212 = (Li_1188 + Li_1192 + Li_1196 + Li_1200) / 4;
   if (Gi_308 == TRUE) Ld_unused_32 = Ld_1148;
   else Ld_unused_32 = Ld_1044;
   WindowRedraw();
   string Ls_1220 = "";
   string Ls_1228 = "";
   f0_4("Signal1", 0, Ls_1220, 9, "Arial Bold", Li_40, 0, Shift_UP_DN + 65, Shift_SIDEWAYS + 20);
   f0_4("Signal2", 0, Ls_1228, 9, "Arial Bold", Li_44, 0, Shift_UP_DN + 85, Shift_SIDEWAYS + 20);
   if (Show_CentralPIVOT_Only) f0_6("Pivotline", 0, Ld_1044, Ld_1044, 2, STYLE_SOLID, Gray, 1);
   if (Gi_404 == TRUE) {
      f0_6("HiLow", 0, high_1172, high_1172, 2, STYLE_SOLID, Turquoise, 1);
      f0_6("HiLow1", 0, low_1180, low_1180, 2, STYLE_SOLID, Turquoise, 1);
   }
   if (Show_Daily_OPEN == TRUE) f0_6("OpenLine", 0, Ld_1148, Ld_1148, 2, STYLE_SOLID, Gi_604, 1);
   if (Show_CentralPIVOT_Only) {
      f0_0("Pivot", 0, "                              PIVOT " + DoubleToStr(Ld_1044, Digits) + "", CentralPivot_FontSize, CentralPivot_Font, Silver, Time[SHIFT_CentralPIVOT_Only_TEXT],
         Ld_1044, 1);
   }
   if (Show_Daily_OPEN == TRUE) {
      f0_0("Open", 0, "                                          DAILY OPEN " + DoubleToStr(Ld_1148, Digits) + "", Open_FontSize, Open_Font, Gi_604, Time[SHIFT_Daily_OPEN_TEXT],
         Ld_1148, 1);
   }
   if (WindowBarsPerChart() > 800) Li_unused_48 = 60;
   if (WindowBarsPerChart() < 800) Li_unused_48 = 30;
   if (WindowBarsPerChart() < 400) Li_unused_48 = 10;
   if (WindowBarsPerChart() < 200) Li_unused_48 = 3;
   if (WindowBarsPerChart() < 100) Li_unused_48 = 0;
   if (WindowBarsPerChart() < 50) Li_unused_48 = -5;
   if (StringFind(Symbol(), "JPY", 0) != -1) {
      Gi_unused_664 = 0;
      Gi_unused_660 = 100;
      Gi_unused_656 = 2;
   } else {
      Gi_unused_664 = 2;
      Gi_unused_660 = 10000;
      Gi_unused_656 = 4;
   }
   if (Gi_212) {
      imacd_92 = iMACD(NULL, G_timeframe_376, 8, 17, 9, PRICE_CLOSE, MODE_SIGNAL, 0);
      imacd_100 = iMACD(NULL, G_timeframe_376, 8, 17, 9, PRICE_CLOSE, MODE_MAIN, 0);
      if (imacd_92 < imacd_100) {
         Ls_64 = "UP";
         Li_unused_72 = 3329330;
      }
      if (imacd_92 > imacd_100) {
         Ls_64 = "DOWN";
         Li_unused_72 = 255;
      }
      irsi_176 = iRSI(NULL, G_timeframe_376, 18, PRICE_MEDIAN, 0);
      if (irsi_176 > 50.0) {
         Ls_164 = "UP";
         Li_unused_172 = 3329330;
      }
      if (irsi_176 < 50.0) {
         Ls_164 = "DOWN";
         Li_unused_172 = 255;
      }
      irsi_196 = iRSI(NULL, G_timeframe_376, 9, PRICE_MEDIAN, 0);
      if (irsi_196 > 50.0) {
         Ls_184 = "UP";
         Li_unused_192 = 3329330;
      }
      if (irsi_196 < 50.0) {
         Ls_184 = "DOWN";
         Li_unused_192 = 255;
      }
      if (Ls_64 == "UP" && Ls_164 == "UP" && Ls_184 == "UP") {
         Ls_256 = "UP";
         Li_280 = 65280;
         Ls_264 = "STRONG";
         Li_284 = 65280;
         Ls_272 = "BULLISH";
         Li_288 = 65280;
      }
      if (Ls_64 == "UP" && Ls_164 == "UP" && Ls_184 == "DOWN") {
         Ls_256 = "UP";
         Li_280 = 65280;
         Ls_264 = "WEAK";
         Li_284 = 3329330;
         Ls_272 = "SIDEWAY";
         Li_288 = 12632256;
      }
      if (Ls_64 == "UP" && Ls_164 == "DOWN" && Ls_184 == "UP") {
         Ls_256 = "UP";
         Li_280 = 65280;
         Ls_264 = "WEAK";
         Li_284 = 3329330;
         Ls_272 = "SIDEWAY";
         Li_288 = 12632256;
      }
      if (Ls_64 == "UP" && Ls_164 == "DOWN" && Ls_184 == "DOWN") {
         Ls_256 = "DOWN";
         Li_280 = 255;
         Ls_264 = "WEAK";
         Li_284 = 4678655;
         Ls_272 = "SIDEWAY";
         Li_288 = 12632256;
      }
      if (Ls_64 == "DOWN" && Ls_164 == "DOWN" && Ls_184 == "DOWN") {
         Ls_256 = "DOWN";
         Li_280 = 255;
         Ls_264 = "STRONG";
         Li_284 = 255;
         Ls_272 = "BEARISH";
         Li_288 = 255;
      }
      if (Ls_64 == "DOWN" && Ls_164 == "DOWN" && Ls_184 == "UP") {
         Ls_256 = "DOWN";
         Li_280 = 255;
         Ls_264 = "WEAK";
         Li_284 = 4678655;
         Ls_272 = "SIDEWAY";
         Li_288 = 12632256;
      }
      if (Ls_64 == "DOWN" && Ls_164 == "UP" && Ls_184 == "DOWN") {
         Ls_256 = "DOWN";
         Li_280 = 255;
         Ls_264 = "WEAK";
         Li_284 = 4678655;
         Ls_272 = "SIDEWAY";
         Li_288 = 12632256;
      }
      if (Ls_64 == "DOWN" && Ls_164 == "UP" && Ls_184 == "UP") {
         Ls_256 = "UP";
         Li_280 = 65280;
         Ls_264 = "WEAK";
         Li_284 = 3329330;
         Ls_272 = "SIDEWAY";
         Li_288 = 12632256;
      }
   }
   if (Gi_212) {
      imacd_108 = iMACD(NULL, G_timeframe_372, 8, 17, 9, PRICE_CLOSE, MODE_SIGNAL, 0);
      imacd_116 = iMACD(NULL, G_timeframe_372, 8, 17, 9, PRICE_CLOSE, MODE_MAIN, 0);
      if (imacd_108 < imacd_116) {
         Ls_328 = "UP";
         Li_unused_336 = 3329330;
      }
      if (imacd_108 > imacd_116) {
         Ls_328 = "DOWN";
         Li_unused_336 = 255;
      }
      irsi_340 = iRSI(NULL, G_timeframe_372, 18, PRICE_MEDIAN, 0);
      if (irsi_340 > 50.0) {
         Ls_348 = "UP";
         Li_unused_356 = 3329330;
      }
      if (irsi_340 < 50.0) {
         Ls_348 = "DOWN";
         Li_unused_356 = 255;
      }
      irsi_360 = iRSI(NULL, G_timeframe_372, 9, PRICE_MEDIAN, 0);
      if (irsi_360 > 50.0) {
         Ls_368 = "UP";
         Li_unused_376 = 3329330;
      }
      if (irsi_360 < 50.0) {
         Ls_368 = "DOWN";
         Li_unused_376 = 255;
      }
      if (Ls_328 == "UP" && Ls_348 == "UP" && Ls_368 == "UP") {
         Ls_292 = "UP";
         Li_300 = 65280;
         Ls_304 = "STRONG";
         Li_312 = 65280;
         Ls_316 = "BULLISH";
         Li_324 = 65280;
      }
      if (Ls_328 == "UP" && Ls_348 == "UP" && Ls_368 == "DOWN") {
         Ls_292 = "UP";
         Li_300 = 65280;
         Ls_304 = "WEAK";
         Li_312 = 3329330;
         Ls_316 = "SIDEWAY";
         Li_324 = 12632256;
      }
      if (Ls_328 == "UP" && Ls_348 == "DOWN" && Ls_368 == "UP") {
         Ls_292 = "UP";
         Li_300 = 65280;
         Ls_304 = "WEAK";
         Li_312 = 3329330;
         Ls_316 = "SIDEWAY";
         Li_324 = 12632256;
      }
      if (Ls_328 == "UP" && Ls_348 == "DOWN" && Ls_368 == "DOWN") {
         Ls_292 = "DOWN";
         Li_300 = 255;
         Ls_304 = "WEAK";
         Li_312 = 4678655;
         Ls_316 = "SIDEWAY";
         Li_324 = 12632256;
      }
      if (Ls_328 == "DOWN" && Ls_348 == "DOWN" && Ls_368 == "DOWN") {
         Ls_292 = "DOWN";
         Li_300 = 255;
         Ls_304 = "STRONG";
         Li_312 = 255;
         Ls_316 = "BEARISH";
         Li_324 = 255;
      }
      if (Ls_328 == "DOWN" && Ls_348 == "DOWN" && Ls_368 == "UP") {
         Ls_292 = "DOWN";
         Li_300 = 255;
         Ls_304 = "WEAK";
         Li_312 = 4678655;
         Ls_316 = "SIDEWAY";
         Li_324 = 12632256;
      }
      if (Ls_328 == "DOWN" && Ls_348 == "UP" && Ls_368 == "DOWN") {
         Ls_292 = "DOWN";
         Li_300 = 255;
         Ls_304 = "WEAK";
         Li_312 = 4678655;
         Ls_316 = "SIDEWAY";
         Li_324 = 12632256;
      }
      if (Ls_328 == "DOWN" && Ls_348 == "UP" && Ls_368 == "UP") {
         Ls_292 = "UP";
         Li_300 = 65280;
         Ls_304 = "WEAK";
         Li_312 = 3329330;
         Ls_316 = "SIDEWAY";
         Li_324 = 12632256;
      }
   }
   if (Gi_212) {
      imacd_388 = iMACD(NULL, G_timeframe_368, 8, 17, 9, PRICE_CLOSE, MODE_SIGNAL, 0);
      imacd_396 = iMACD(NULL, G_timeframe_368, 8, 17, 9, PRICE_CLOSE, MODE_MAIN, 0);
      if (imacd_388 < imacd_396) {
         Ls_440 = "UP";
         Li_unused_448 = 3329330;
      }
      if (imacd_388 > imacd_396) {
         Ls_440 = "DOWN";
         Li_unused_448 = 255;
      }
      irsi_452 = iRSI(NULL, G_timeframe_368, 18, PRICE_MEDIAN, 0);
      if (irsi_452 > 50.0) {
         Ls_460 = "UP";
         Li_unused_468 = 3329330;
      }
      if (irsi_452 < 50.0) {
         Ls_460 = "DOWN";
         Li_unused_468 = 255;
      }
      irsi_472 = iRSI(NULL, G_timeframe_368, 9, PRICE_MEDIAN, 0);
      if (irsi_472 > 50.0) {
         Ls_480 = "UP";
         Li_unused_488 = 3329330;
      }
      if (irsi_472 < 50.0) {
         Ls_480 = "DOWN";
         Li_unused_488 = 255;
      }
      if (Ls_440 == "UP" && Ls_460 == "UP" && Ls_480 == "UP") {
         Ls_404 = "UP";
         Li_412 = 65280;
         Ls_416 = "STRONG";
         Li_424 = 65280;
         Ls_428 = "BULLISH";
         Li_436 = 65280;
      }
      if (Ls_440 == "UP" && Ls_460 == "UP" && Ls_480 == "DOWN") {
         Ls_404 = "UP";
         Li_412 = 65280;
         Ls_416 = "WEAK";
         Li_424 = 3329330;
         Ls_428 = "SIDEWAY";
         Li_436 = 12632256;
      }
      if (Ls_440 == "UP" && Ls_460 == "DOWN" && Ls_480 == "UP") {
         Ls_404 = "UP";
         Li_412 = 65280;
         Ls_416 = "WEAK";
         Li_424 = 3329330;
         Ls_428 = "SIDEWAY";
         Li_436 = 12632256;
      }
      if (Ls_440 == "UP" && Ls_460 == "DOWN" && Ls_480 == "DOWN") {
         Ls_404 = "DOWN";
         Li_412 = 255;
         Ls_416 = "WEAK";
         Li_424 = 4678655;
         Ls_428 = "SIDEWAY";
         Li_436 = 12632256;
      }
      if (Ls_440 == "DOWN" && Ls_460 == "DOWN" && Ls_480 == "DOWN") {
         Ls_404 = "DOWN";
         Li_412 = 255;
         Ls_416 = "STRONG";
         Li_424 = 255;
         Ls_428 = "BEARISH";
         Li_436 = 255;
      }
      if (Ls_440 == "DOWN" && Ls_460 == "DOWN" && Ls_480 == "UP") {
         Ls_404 = "DOWN";
         Li_412 = 255;
         Ls_416 = "WEAK";
         Li_424 = 4678655;
         Ls_428 = "SIDEWAY";
         Li_436 = 12632256;
      }
      if (Ls_440 == "DOWN" && Ls_460 == "UP" && Ls_480 == "DOWN") {
         Ls_404 = "DOWN";
         Li_412 = 255;
         Ls_416 = "WEAK";
         Li_424 = 4678655;
         Ls_428 = "SIDEWAY";
         Li_436 = 12632256;
      }
      if (Ls_440 == "DOWN" && Ls_460 == "UP" && Ls_480 == "UP") {
         Ls_404 = "UP";
         Li_412 = 65280;
         Ls_416 = "WEAK";
         Li_424 = 3329330;
         Ls_428 = "SIDEWAY";
         Li_436 = 12632256;
      }
   }
   if (Gi_212) {
      imacd_204 = iMACD(NULL, G_timeframe_364, 8, 17, 9, PRICE_CLOSE, MODE_SIGNAL, 0);
      imacd_212 = iMACD(NULL, G_timeframe_364, 8, 17, 9, PRICE_CLOSE, MODE_MAIN, 0);
      if (imacd_204 < imacd_212) {
         Ls_536 = "UP";
         Li_unused_544 = 3329330;
      }
      if (imacd_204 > imacd_212) {
         Ls_536 = "DOWN";
         Li_unused_544 = 255;
      }
      irsi_548 = iRSI(NULL, G_timeframe_364, 18, PRICE_MEDIAN, 0);
      if (irsi_548 > 50.0) {
         Ls_556 = "UP";
         Li_unused_564 = 3329330;
      }
      if (irsi_548 < 50.0) {
         Ls_556 = "DOWN";
         Li_unused_564 = 255;
      }
      irsi_568 = iRSI(NULL, G_timeframe_364, 9, PRICE_MEDIAN, 0);
      if (irsi_568 > 50.0) {
         Ls_576 = "UP";
         Li_unused_584 = 3329330;
      }
      if (irsi_568 < 50.0) {
         Ls_576 = "DOWN";
         Li_unused_584 = 255;
      }
      if (Ls_536 == "UP" && Ls_556 == "UP" && Ls_576 == "UP") {
         Ls_500 = "UP";
         Li_508 = 65280;
         Ls_512 = "STRONG";
         Li_520 = 65280;
         Ls_524 = "BULLISH";
         Li_532 = 65280;
      }
      if (Ls_536 == "UP" && Ls_556 == "UP" && Ls_576 == "DOWN") {
         Ls_500 = "UP";
         Li_508 = 65280;
         Ls_512 = "WEAK";
         Li_520 = 3329330;
         Ls_524 = "SIDEWAY";
         Li_532 = 12632256;
      }
      if (Ls_536 == "UP" && Ls_556 == "DOWN" && Ls_576 == "UP") {
         Ls_500 = "UP";
         Li_508 = 65280;
         Ls_512 = "WEAK";
         Li_520 = 3329330;
         Ls_524 = "SIDEWAY";
         Li_532 = 12632256;
      }
      if (Ls_536 == "UP" && Ls_556 == "DOWN" && Ls_576 == "DOWN") {
         Ls_500 = "DOWN";
         Li_508 = 255;
         Ls_512 = "WEAK";
         Li_520 = 4678655;
         Ls_524 = "SIDEWAY";
         Li_532 = 12632256;
      }
      if (Ls_536 == "DOWN" && Ls_556 == "DOWN" && Ls_576 == "DOWN") {
         Ls_500 = "DOWN";
         Li_508 = 255;
         Ls_512 = "STRONG";
         Li_520 = 255;
         Ls_524 = "BEARISH";
         Li_532 = 255;
      }
      if (Ls_536 == "DOWN" && Ls_556 == "DOWN" && Ls_576 == "UP") {
         Ls_500 = "DOWN";
         Li_508 = 255;
         Ls_512 = "WEAK";
         Li_520 = 4678655;
         Ls_524 = "SIDEWAY";
         Li_532 = 12632256;
      }
      if (Ls_536 == "DOWN" && Ls_556 == "UP" && Ls_576 == "DOWN") {
         Ls_500 = "DOWN";
         Li_508 = 255;
         Ls_512 = "WEAK";
         Li_520 = 4678655;
         Ls_524 = "SIDEWAY";
         Li_532 = 12632256;
      }
      if (Ls_536 == "DOWN" && Ls_556 == "UP" && Ls_576 == "UP") {
         Ls_500 = "UP";
         Li_508 = 65280;
         Ls_512 = "WEAK";
         Li_520 = 3329330;
         Ls_524 = "SIDEWAY";
         Li_532 = 12632256;
      }
   }
   if (Gi_212) {
      imacd_76 = iMACD(NULL, G_timeframe_360, 8, 17, 9, PRICE_CLOSE, MODE_SIGNAL, 0);
      imacd_84 = iMACD(NULL, G_timeframe_360, 8, 17, 9, PRICE_CLOSE, MODE_MAIN, 0);
      if (imacd_76 < imacd_84) {
         Ls_52 = "UP";
         Li_unused_60 = 3329330;
      }
      if (imacd_76 > imacd_84) {
         Ls_52 = "DOWN";
         Li_unused_60 = 255;
      }
      irsi_136 = iRSI(NULL, G_timeframe_360, 18, PRICE_MEDIAN, 0);
      if (irsi_136 > 50.0) {
         Ls_124 = "UP";
         Li_unused_132 = 3329330;
      }
      if (irsi_136 < 50.0) {
         Ls_124 = "DOWN";
         Li_unused_132 = 255;
      }
      irsi_156 = iRSI(NULL, G_timeframe_360, 9, PRICE_MEDIAN, 0);
      if (irsi_156 > 50.0) {
         Ls_144 = "UP";
         Li_unused_152 = 3329330;
      }
      if (irsi_156 < 50.0) {
         Ls_144 = "DOWN";
         Li_unused_152 = 255;
      }
      if (Ls_52 == "UP" && Ls_124 == "UP" && Ls_144 == "UP") {
         Ls_220 = "UP";
         Li_244 = 65280;
         Ls_228 = "STRONG";
         Li_248 = 65280;
         Ls_236 = "BULLISH";
         Li_252 = 65280;
      }
      if (Ls_52 == "UP" && Ls_124 == "UP" && Ls_144 == "DOWN") {
         Ls_220 = "UP";
         Li_244 = 65280;
         Ls_228 = "WEAK";
         Li_248 = 3329330;
         Ls_236 = "SIDEWAY";
         Li_252 = 12632256;
      }
      if (Ls_52 == "UP" && Ls_124 == "DOWN" && Ls_144 == "UP") {
         Ls_220 = "UP";
         Li_244 = 65280;
         Ls_228 = "WEAK";
         Li_248 = 3329330;
         Ls_236 = "SIDEWAY";
         Li_252 = 12632256;
      }
      if (Ls_52 == "UP" && Ls_124 == "DOWN" && Ls_144 == "DOWN") {
         Ls_220 = "DOWN";
         Li_244 = 255;
         Ls_228 = "WEAK";
         Li_248 = 4678655;
         Ls_236 = "SIDEWAY";
         Li_252 = 12632256;
      }
      if (Ls_52 == "DOWN" && Ls_124 == "DOWN" && Ls_144 == "DOWN") {
         Ls_220 = "DOWN";
         Li_244 = 255;
         Ls_228 = "STRONG";
         Li_248 = 255;
         Ls_236 = "BEARISH";
         Li_252 = 255;
      }
      if (Ls_52 == "DOWN" && Ls_124 == "DOWN" && Ls_144 == "UP") {
         Ls_220 = "DOWN";
         Li_244 = 255;
         Ls_228 = "WEAK";
         Li_248 = 4678655;
         Ls_236 = "SIDEWAY";
         Li_252 = 12632256;
      }
      if (Ls_52 == "DOWN" && Ls_124 == "UP" && Ls_144 == "DOWN") {
         Ls_220 = "DOWN";
         Li_244 = 255;
         Ls_228 = "WEAK";
         Li_248 = 4678655;
         Ls_236 = "SIDEWAY";
         Li_252 = 12632256;
      }
      if (Ls_52 == "DOWN" && Ls_124 == "UP" && Ls_144 == "UP") {
         Ls_220 = "UP";
         Li_244 = 65280;
         Ls_228 = "WEAK";
         Li_248 = 3329330;
         Ls_236 = "SIDEWAY";
         Li_252 = 12632256;
      }
   }
   double imacd_608 = iMACD(NULL, G_timeframe_380, 8, 17, 9, PRICE_CLOSE, MODE_SIGNAL, 0);
   double imacd_616 = iMACD(NULL, G_timeframe_380, 8, 17, 9, PRICE_CLOSE, MODE_MAIN, 0);
   if (imacd_608 < imacd_616) {
      Ls_596 = "UP";
      Li_unused_604 = 3329330;
   }
   if (imacd_608 > imacd_616) {
      Ls_596 = "DOWN";
      Li_unused_604 = 255;
   }
   double irsi_636 = iRSI(NULL, G_timeframe_380, 18, PRICE_MEDIAN, 0);
   if (irsi_636 > 50.0) {
      Ls_624 = "UP";
      Li_unused_632 = 3329330;
   }
   if (irsi_636 < 50.0) {
      Ls_624 = "DOWN";
      Li_unused_632 = 255;
   }
   double irsi_652 = iRSI(NULL, G_timeframe_380, 9, PRICE_MEDIAN, 0);
   if (irsi_652 > 50.0) {
      Ls_644 = "UP";
      irsi_652 = 3329330;
   }
   if (irsi_652 < 50.0) {
      Ls_644 = "DOWN";
      irsi_652 = 255;
   }
   if (Ls_596 == "UP" && Ls_624 == "UP" && Ls_644 == "UP") {
      Ls_unused_660 = "UP";
      Ls_unused_668 = "STRONG";
      Ls_676 = "BULLISH";
      Li_692 = 65280;
   }
   if (Ls_596 == "UP" && Ls_624 == "UP" && Ls_644 == "DOWN") {
      Ls_unused_660 = "UP";
      Ls_unused_668 = "WEAK";
      Ls_676 = "MEDIUM UP";
      Li_692 = 2263842;
   }
   if (Ls_596 == "UP" && Ls_624 == "DOWN" && Ls_644 == "UP") {
      Ls_unused_660 = "UP";
      Ls_unused_668 = "WEAK";
      Ls_676 = "SIDEWAY";
      Li_692 = 12632256;
   }
   if (Ls_596 == "UP" && Ls_624 == "DOWN" && Ls_644 == "DOWN") {
      Ls_unused_660 = "DOWN";
      Li_unused_684 = 255;
      Ls_unused_668 = "WEAK";
      Li_unused_688 = 4678655;
      Ls_676 = "WEAK DOWN";
      Li_692 = 4678655;
   }
   if (Ls_596 == "DOWN" && Ls_624 == "DOWN" && Ls_644 == "DOWN") {
      Ls_unused_660 = "DOWN";
      Ls_unused_668 = "STRONG";
      Li_unused_688 = 255;
      Ls_676 = "BEARISH";
      Li_692 = 255;
   }
   if (Ls_596 == "DOWN" && Ls_624 == "DOWN" && Ls_644 == "UP") {
      Ls_unused_660 = "DOWN";
      Ls_unused_668 = "WEAK";
      Ls_676 = "MEDIUM DOWN";
      Li_692 = 4678655;
   }
   if (Ls_596 == "DOWN" && Ls_624 == "UP" && Ls_644 == "DOWN") {
      Ls_unused_660 = "DOWN";
      Ls_unused_668 = "WEAK";
      Ls_676 = "SIDEWAY";
      Li_692 = 12632256;
   }
   if (Ls_596 == "DOWN" && Ls_624 == "UP" && Ls_644 == "UP") {
      Ls_unused_660 = "UP";
      Ls_unused_668 = "WEAK";
      Ls_676 = "WEAK UP";
      Li_692 = 2263842;
   }
   int Li_696 = Gi_216;
   int Li_700 = Gi_220;
   if (Gi_188 == FALSE) Li_696 = -430;
   if (Gi_296) {
      f0_4("BBackground3", 0, "g", 163, "Webdings", Gi_532, 0, Shift_UP_DN + 20 + Li_696, Shift_SIDEWAYS + 8 + Li_700);
      f0_4("ABackground3", 0, "g", 169, "Webdings", Gi_536, 0, Shift_UP_DN + 16 + Li_696, Shift_SIDEWAYS + 4 + Li_700);
      f0_4("BBackground", 0, "g", 166, "Webdings", Gi_532, 0, Shift_UP_DN + 18, Shift_SIDEWAYS + 6);
      f0_4("BBackground1", 0, "g", 166, "Webdings", Gi_532, 0, Shift_UP_DN + 150, Shift_SIDEWAYS + 6);
      f0_4("BBackground2", 0, "g", 166, "Webdings", Gi_532, 0, Shift_UP_DN + 228, Shift_SIDEWAYS + 6);
      f0_4("ABackground", 0, "g", 163, "Webdings", Gi_536, 0, Shift_UP_DN + 20, Shift_SIDEWAYS + 8);
      f0_4("ABackground1", 0, "g", 163, "Webdings", Gi_536, 0, Shift_UP_DN + 150, Shift_SIDEWAYS + 8);
      f0_4("ABackground2", 0, "g", 169, "Webdings", Gi_536, 0, Shift_UP_DN + 226, Shift_SIDEWAYS + 4);
   }
   double imacd_796 = iMACD(NULL, G_timeframe_320, 8, 17, 9, PRICE_CLOSE, MODE_SIGNAL, 0);
   double imacd_804 = iMACD(NULL, G_timeframe_320, 8, 17, 9, PRICE_CLOSE, MODE_MAIN, 0);
   if (imacd_796 < imacd_804) {
      Ls_768 = "UP";
      Li_784 = 65280;
      Ld_704 = 1;
      Ld_736 = 0;
   }
   if (imacd_796 > imacd_804) {
      Ls_768 = "DOWN";
      Li_784 = 255;
      Ld_704 = 0;
      Ld_736 = 1;
   }
   if (imacd_796 == imacd_804) {
      Ls_768 = "DOWN";
      Li_784 = 12632256;
      Ld_704 = 0;
      Ld_736 = 0;
   }
   double imacd_812 = iMACD(NULL, G_timeframe_324, 8, 17, 9, PRICE_CLOSE, MODE_SIGNAL, 0);
   double imacd_820 = iMACD(NULL, G_timeframe_324, 8, 17, 9, PRICE_CLOSE, MODE_MAIN, 0);
   if (imacd_812 < imacd_820) {
      Ls_776 = "UP";
      Li_792 = 65280;
      Ld_712 = 1;
      Ld_744 = 0;
   }
   if (imacd_812 > imacd_820) {
      Ls_776 = "DOWN";
      Li_792 = 255;
      Ld_712 = 0;
      Ld_744 = 1;
   }
   if (imacd_812 == imacd_820) {
      Ls_776 = "DOWN";
      Li_792 = 12632256;
      Ld_712 = 0;
      Ld_744 = 0;
   }
   double irsi_848 = iRSI(NULL, G_timeframe_320, 5, PRICE_MEDIAN, 0);
   double irsi_856 = iRSI(NULL, G_timeframe_320, 9, PRICE_MEDIAN, 0);
   if (irsi_848 > irsi_856) {
      Ls_828 = "UP";
      Li_788 = 65280;
      Ld_720 = 1;
      Ld_752 = 0;
   }
   if (irsi_848 < irsi_856) {
      Ls_828 = "DOWN";
      Li_788 = 255;
      Ld_720 = 0;
      Ld_752 = 1;
   }
   if (irsi_848 == irsi_856) {
      Ls_828 = "DOWN";
      Li_788 = 12632256;
      Ld_720 = 0;
      Ld_752 = 0;
   }
   double irsi_864 = iRSI(NULL, G_timeframe_324, 5, PRICE_MEDIAN, 0);
   double irsi_872 = iRSI(NULL, G_timeframe_324, 9, PRICE_MEDIAN, 0);
   if (irsi_864 > irsi_872) {
      Ls_836 = "UP";
      Li_844 = 65280;
      Ld_728 = 1;
      Ld_760 = 0;
   }
   if (irsi_864 < irsi_872) {
      Ls_836 = "DOWN";
      Li_844 = 255;
      Ld_728 = 0;
      Ld_760 = 1;
   }
   if (irsi_864 == irsi_872) {
      Ls_836 = "DOWN";
      Li_844 = 12632256;
      Ld_728 = 0;
      Ld_760 = 0;
   }
   double Ld_880 = Ld_704 + Ld_712 + Ld_720 + Ld_728;
   double Ld_888 = Ld_736 + Ld_744 + Ld_752 + Ld_760;
   string dbl2str_896 = DoubleToStr(100.0 * (Ld_880 / 4.0), 0);
   string dbl2str_904 = DoubleToStr(100 - StrToDouble(dbl2str_896), 0);
   if (Ls_768 == "UP" && Ls_776 == "UP" && Ls_828 == "UP" && Ls_836 == "UP") {
      Ls_912 = " SHORT BUY ENTRY";
      Li_920 = 65280;
   } else {
      if (Ls_768 == "DOWN" && Ls_776 == "DOWN" && Ls_828 == "DOWN" && Ls_836 == "DOWN") {
         Ls_912 = " SHORT SELL ENTRY";
         Li_920 = 255;
      } else {
         Ls_912 = "UP " + dbl2str_896 + "%   DOWN " + dbl2str_904 + "%";
         Li_920 = 12632256;
      }
   }
   if (Arrow_Indicator) {
      Ld_1236 = 0;
      if (G_bars_504 >= Bars) G_bars_504 = Bars;
      if (G_bars_504 >= 1000) G_bars_504 = 950;
      SetIndexDrawBegin(0, Bars - G_bars_504 + 12);
      SetIndexDrawBegin(1, Bars - G_bars_504 + 12);
      ind_counted_1252 = IndicatorCounted();
      if (ind_counted_1252 < 0) return (-1);
      if (ind_counted_1252 < 1) {
         for (int Li_1244 = 1; Li_1244 <= G_bars_504; Li_1244++) G_ibuf_76[G_bars_504 - Li_1244] = 0.0;
         for (Li_1244 = 1; Li_1244 <= G_bars_504; Li_1244++) G_ibuf_80[G_bars_504 - Li_1244] = 0.0;
      }
      for (int bars_1248 = G_bars_504; bars_1248 >= 0; bars_1248--) {
         G_iadx_92 = iADX(NULL, 0, ADXbars, PRICE_CLOSE, MODE_PLUSDI, bars_1248 - 1);
         G_iadx_100 = iADX(NULL, 0, ADXbars, PRICE_CLOSE, MODE_PLUSDI, bars_1248);
         G_iadx_108 = iADX(NULL, 0, ADXbars, PRICE_CLOSE, MODE_MINUSDI, bars_1248 - 1);
         G_iadx_116 = iADX(NULL, 0, ADXbars, PRICE_CLOSE, MODE_MINUSDI, bars_1248);
         if (G_iadx_92 > G_iadx_108 && G_iadx_100 < G_iadx_116) {
            if (bars_1248 == 1 && Gi_84 == FALSE) {
               Gi_84 = TRUE;
               Gi_88 = FALSE;
            }
            G_ibuf_76[bars_1248] = Low[bars_1248] - 5.0 * Point;
         }
         if (G_iadx_92 < G_iadx_108 && G_iadx_100 > G_iadx_116) {
            if (bars_1248 == 1 && Gi_88 == FALSE) {
               Gi_88 = TRUE;
               Gi_84 = FALSE;
            }
            G_ibuf_80[bars_1248] = High[bars_1248] + 5.0 * Point;
         }
      }
      if (Gi_84 == TRUE && TimeCurrent() > GlobalVariableGet("AlertTime" + Symbol() + Period()) && GlobalVariableGet("SignalType" + Symbol() + Period()) != 0.0) {
         if (AlertOn) {
            Alert("BUY signal Alert on - ", TerminalName(), " - ", Symbol(), " (M", Period(), ") ", 
               "\nDate & Time = ", TimeToStr(TimeCurrent(), TIME_DATE) + " @ " + TimeToStr(TimeCurrent(), TIME_SECONDS), 
            "\n (From : Ultimate Trend Signals)");
         }
         if (EmailON) {
            SendMail("BUY signal Alert on", TimeToStr(TimeCurrent(), TIME_DATE) + " " + TimeHour(TimeCurrent()) + ":" + TimeMinute(TimeCurrent()) + " Symbol=" + Symbol() + " Period=" +
               Period() + " - " + TerminalName() + " - " + "(From : Ultimate Trend Signals)");
                  if (PushAlert) {
             SendNotification ("BUY signal Alert on"+ TimeToStr(TimeCurrent()+ TIME_DATE) + " " + TimeHour(TimeCurrent()) + ":" + TimeMinute(TimeCurrent()) + " Symbol=" + Symbol() + " Period=" +
               Period() + " - " + TerminalName() + " - " + "(From : Ultimate Trend Signals)");
         }
         Ld_1236 = TimeCurrent() + 60.0 * (Period() - MathMod(Minute(), Period()));
         GlobalVariableSet("AlertTime" + Symbol() + Period(), Ld_1236);
         GlobalVariableSet("SignalType" + Symbol() + Period(), 0);
         GlobalVariableSet("LastAlert" + Symbol() + Period(), 1);
      }
      if (Gi_88 == TRUE && TimeCurrent() > GlobalVariableGet("AlertTime" + Symbol() + Period()) && GlobalVariableGet("SignalType" + Symbol() + Period()) != 1.0) {
         if (AlertOn) {
            Alert("SELL signal Alert on - ", TerminalName(), " - ", Symbol(), " (M", Period(), ") ", 
               "\nDate & Time = ", TimeToStr(TimeCurrent(), TIME_DATE) + " @ " + TimeToStr(TimeCurrent(), TIME_SECONDS), 
            "\n (From : Ultimate Trend Signals)");
         }
         if (EmailON) {
            SendMail("SELL signal Alert on", TimeToStr(TimeCurrent(), TIME_DATE) + " " + TimeHour(TimeCurrent()) + ":" + TimeMinute(TimeCurrent()) + " Symbol=" + Symbol() + " Period=" +
               Period() + " - " + TerminalName() + " - " + "(From : Ultimate Trend Signals)");
         if (PushAlert) {
             SendNotification ("SELL signal Alert on"+ TimeToStr(TimeCurrent()+ TIME_DATE) + " " + TimeHour(TimeCurrent()) + ":" + TimeMinute(TimeCurrent()) + " Symbol=" + Symbol() + " Period=" +
               Period() + " - " + TerminalName() + " - " + "(From : Ultimate Trend Signals)");
         }
         Ld_1236 = TimeCurrent() + 60.0 * (Period() - MathMod(Minute(), Period()));
         GlobalVariableSet("AlertTime" + Symbol() + Period(), Ld_1236);
         GlobalVariableSet("SignalType" + Symbol() + Period(), 1);
         GlobalVariableSet("LastAlert" + Symbol() + Period(), -1);
      }
   }
   if (Gi_212) {
      f0_4("FX66", 0, "" + Gs_836 + " Trend ", 9, Ls_16, DarkOrange, 0, Shift_UP_DN + 50 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX64", 0, Ls_676, 9, Ls_16, Li_692, 0, Shift_UP_DN + 50 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX132", 0, "ULTIMATE TREND SIGNALS", 11, "Arial Bold", Gold, 0, Shift_UP_DN + 25 + Li_696, Shift_SIDEWAYS + 16 + Li_700);
      f0_4("FX55", 0, "_________________________________", 8, "Arial Bold", DodgerBlue, 0, Shift_UP_DN + 33 + Li_696, Shift_SIDEWAYS + 18 + Li_700);
      f0_4("FX133", 0, "_________________________________", 8, "Arial Bold", DodgerBlue, 0, Shift_UP_DN + 58 + Li_696, Shift_SIDEWAYS + 18 + Li_700);
      f0_4("FX57", 0, " " + Gs_812 + " ", 13, Ls_16, Li_280, 0, Shift_UP_DN + 90 + Li_696, Shift_SIDEWAYS + 192 + Li_700);
      f0_4("FX58", 0, Ls_256, 9, Ls_16, Li_280, 0, Shift_UP_DN + 74 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX59", 0, Ls_264, 9, Ls_16, Li_284, 0, Shift_UP_DN + 91 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX60", 0, Ls_272, 9, Ls_16, Li_288, 0, Shift_UP_DN + 109 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX61", 0, "Analysis", 9, Ls_16, Silver, 0, Shift_UP_DN + 74 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX62", 0, "Strength", 9, Ls_16, Silver, 0, Shift_UP_DN + 91 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX63", 0, "Trend", 9, Ls_16, Silver, 0, Shift_UP_DN + 109 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX65", 0, "_________________________________", 8, "Arial Bold", DodgerBlue, 0, Shift_UP_DN + 117 + Li_696, Shift_SIDEWAYS + 18 + Li_700);
      f0_4("FX101", 0, "" + Gs_804 + " ", 13, Ls_16, Li_300, 0, Shift_UP_DN + 150 + Li_696, Shift_SIDEWAYS + 185 + Li_700);
      f0_4("FX102", 0, Ls_292, 9, Ls_16, Li_300, 0, Shift_UP_DN + 134 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX103", 0, Ls_304, 9, Ls_16, Li_312, 0, Shift_UP_DN + 152 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX104", 0, Ls_316, 9, Ls_16, Li_324, 0, Shift_UP_DN + 170 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX105", 0, "Analysis", 9, Ls_16, Silver, 0, Shift_UP_DN + 134 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX106", 0, "Strength", 9, Ls_16, Silver, 0, Shift_UP_DN + 152 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX107", 0, "Trend", 9, Ls_16, Silver, 0, Shift_UP_DN + 170 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX108", 0, "_________________________________", 8, "Arial", DodgerBlue, 0, Shift_UP_DN + 178 + Li_696, Shift_SIDEWAYS + 18 + Li_700);
      f0_4("FX109", 0, "" + Gs_796 + " ", 13, Ls_16, Li_412, 0, Shift_UP_DN + 212 + Li_696, Shift_SIDEWAYS + 185 + Li_700);
      f0_4("FX110", 0, Ls_404, 9, Ls_16, Li_412, 0, Shift_UP_DN + 195 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX111", 0, Ls_416, 9, Ls_16, Li_424, 0, Shift_UP_DN + 213 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX112", 0, Ls_428, 9, Ls_16, Li_436, 0, Shift_UP_DN + 233 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX113", 0, "Analysis", 9, Ls_16, Silver, 0, Shift_UP_DN + 195 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX114", 0, "Strength", 9, Ls_16, Silver, 0, Shift_UP_DN + 213 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX115", 0, "Trend", 9, Ls_16, Silver, 0, Shift_UP_DN + 233 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX116", 0, "_________________________________", 8, "Arial", DodgerBlue, 0, Shift_UP_DN + 241 + Li_696, Shift_SIDEWAYS + 18 + Li_700);
      f0_4("FX117", 0, "" + Gs_788 + " ", 13, Ls_16, Li_508, 0, Shift_UP_DN + 275 + Li_696, Shift_SIDEWAYS + 190 + Li_700);
      f0_4("FX118", 0, Ls_500, 9, Ls_16, Li_508, 0, Shift_UP_DN + 258 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX119", 0, Ls_512, 9, Ls_16, Li_520, 0, Shift_UP_DN + 277 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX120", 0, Ls_524, 9, Ls_16, Li_532, 0, Shift_UP_DN + 297 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX121", 0, "Analysis", 9, Ls_16, Silver, 0, Shift_UP_DN + 258 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX122", 0, "Strength", 9, Ls_16, Silver, 0, Shift_UP_DN + 277 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX123", 0, "Trend", 9, Ls_16, Silver, 0, Shift_UP_DN + 297 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX124", 0, "_________________________________", 8, "Arial", DodgerBlue, 0, Shift_UP_DN + 305 + Li_696, Shift_SIDEWAYS + 18 + Li_700);
      f0_4("FX125", 0, "" + Gs_780 + " ", 13, Ls_16, Li_244, 0, Shift_UP_DN + 340 + Li_696, Shift_SIDEWAYS + 190 + Li_700);
      f0_4("FX126", 0, Ls_220, 9, Ls_16, Li_244, 0, Shift_UP_DN + 322 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX127", 0, Ls_228, 9, Ls_16, Li_248, 0, Shift_UP_DN + 341 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX128", 0, Ls_236, 9, Ls_16, Li_252, 0, Shift_UP_DN + 361 + Li_696, Shift_SIDEWAYS + 105 + Li_700);
      f0_4("FX129", 0, "Analysis", 9, Ls_16, Silver, 0, Shift_UP_DN + 322 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX130", 0, "Strength", 9, Ls_16, Silver, 0, Shift_UP_DN + 341 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX131", 0, "Trend", 9, Ls_16, Silver, 0, Shift_UP_DN + 361 + Li_696, Shift_SIDEWAYS + 20 + Li_700);
      f0_4("FX134", 0, "_________________________________", 8, "Arial", DodgerBlue, 0, Shift_UP_DN + 370 + Li_696, Shift_SIDEWAYS + 18 + Li_700);
      f0_4("FX67", 0, "" + "         --  Entry Signal  --", 10, Ls_16, Gold, 0, Shift_UP_DN + 386 + Li_696, Shift_SIDEWAYS + 27 + Li_700);
      f0_4("FX68", 0, Ls_912, 10, Ls_16, Li_920, 0, Shift_UP_DN + 405 + Li_696, Shift_SIDEWAYS + 52 + Li_700);
      f0_4("FX69", 0, "g", 9, "Webdings", Li_784, 0, Shift_UP_DN + 424 + Li_696, Shift_SIDEWAYS + 82 + Li_700);
      f0_4("FX70", 0, "g", 9, "Webdings", Li_788, 0, Shift_UP_DN + 424 + Li_696, Shift_SIDEWAYS + 102 + Li_700);
      f0_4("FX71", 0, "g", 9, "Webdings", Li_792, 0, Shift_UP_DN + 424 + Li_696, Shift_SIDEWAYS + 122 + Li_700);
      f0_4("FX72", 0, "g", 9, "Webdings", Li_844, 0, Shift_UP_DN + 424 + Li_696, Shift_SIDEWAYS + 142 + Li_700);
   }
   Li_956 = IndicatorCounted();
   if (Li_956 < 0) return (-1);
   if (Li_956 > 0) Li_956--;
   int Li_1256 = Bars - Li_956;
   Li_1256 = MathMax(Li_1256, G_timeframe_516 / Period());
   Li_1256 = MathMin(Li_1256, Gi_520);
   for (int index_1260 = 0; index_1260 < Li_1256; index_1260++) {
      shift_924 = iBarShift(NULL, G_timeframe_516, Time[index_1260]);
      if (G_timeframe_516 < Period()) G_timeframe_516 = Period();
   }}}
   return (0);
}

// C221A17B360C36A473B962FBBDF51DA3
void f0_2() {
   GlobalVariableDel("AlertTime" + Symbol() + Period());
   GlobalVariableDel("SignalType" + Symbol() + Period());
   ObjectDelete("Pivot");
   ObjectDelete("Open");
   ObjectDelete("FX");
   ObjectDelete("FX1");
   ObjectDelete("FX2");
   ObjectDelete("FX3");
   ObjectDelete("FX4");
   ObjectDelete("FX5");
   ObjectDelete("FX6");
   ObjectDelete("FX7");
   ObjectDelete("FX8");
   ObjectDelete("FX9");
   ObjectDelete("FX10");
   ObjectDelete("FX11");
   ObjectDelete("FX12");
   ObjectDelete("FX13");
   ObjectDelete("FX14");
   ObjectDelete("FX15");
   ObjectDelete("FX16");
   ObjectDelete("FX17");
   ObjectDelete("FX18");
   ObjectDelete("FX19");
   ObjectDelete("FX20");
   ObjectDelete("FX21");
   ObjectDelete("FX22");
   ObjectDelete("FX23");
   ObjectDelete("FX24");
   ObjectDelete("FX25");
   ObjectDelete("FX26");
   ObjectDelete("FX27");
   ObjectDelete("FX28");
   ObjectDelete("FX29");
   ObjectDelete("FX30");
   ObjectDelete("FX31");
   ObjectDelete("FX32");
   ObjectDelete("FX33");
   ObjectDelete("FX34");
   ObjectDelete("FX35");
   ObjectDelete("FX36");
   ObjectDelete("FX37");
   ObjectDelete("FX38");
   ObjectDelete("FX39");
   ObjectDelete("FX40");
   ObjectDelete("FX41");
   ObjectDelete("FX42");
   ObjectDelete("FX43");
   ObjectDelete("FX44");
   ObjectDelete("FX45");
   ObjectDelete("FX46");
   ObjectDelete("FX47");
   ObjectDelete("FX48");
   ObjectDelete("FX49");
   ObjectDelete("FX50");
   ObjectDelete("FX51");
   ObjectDelete("FX52");
   ObjectDelete("FX53");
   ObjectDelete("FX54");
   ObjectDelete("FX55");
   ObjectDelete("FX56");
   ObjectDelete("FX57");
   ObjectDelete("FX58");
   ObjectDelete("FX59");
   ObjectDelete("FX60");
   ObjectDelete("FX61");
   ObjectDelete("FX62");
   ObjectDelete("FX63");
   ObjectDelete("FX64");
   ObjectDelete("FX65");
   ObjectDelete("FX66");
   ObjectDelete("FX67");
   ObjectDelete("FX68");
   ObjectDelete("FX69");
   ObjectDelete("FX70");
   ObjectDelete("FX71");
   ObjectDelete("FX72");
   ObjectDelete("FX73");
   ObjectDelete("FX74");
   ObjectDelete("FX75");
   ObjectDelete("FX76");
   ObjectDelete("FX77");
   ObjectDelete("FX78");
   ObjectDelete("FX79");
   ObjectDelete("FX80");
   ObjectDelete("FX81");
   ObjectDelete("FX82");
   ObjectDelete("FX83");
   ObjectDelete("FX84");
   ObjectDelete("FX85");
   ObjectDelete("FX86");
   ObjectDelete("FX87");
   ObjectDelete("FX88");
   ObjectDelete("Signal1");
   ObjectDelete("Signal2");
   ObjectDelete("Signal3");
   ObjectDelete("PHIGH");
   ObjectDelete("PLOW");
   ObjectDelete("BBackground");
   ObjectDelete("BBackground1");
   ObjectDelete("BBackground2");
   ObjectDelete("BBackground3");
   ObjectDelete("ABackground");
   ObjectDelete("ABackground1");
   ObjectDelete("ABackground2");
   ObjectDelete("ABackground3");
   ObjectDelete("Pivotline");
   ObjectDelete("Pivotline1");
   ObjectDelete("HiLow");
   ObjectDelete("HiLow1");
   ObjectDelete("OpenLine");
   ObjectDelete("Webdings");
   ObjectDelete("FX101");
   ObjectDelete("FX102");
   ObjectDelete("FX103");
   ObjectDelete("FX104");
   ObjectDelete("FX105");
   ObjectDelete("FX106");
   ObjectDelete("FX107");
   ObjectDelete("FX108");
   ObjectDelete("FX109");
   ObjectDelete("FX110");
   ObjectDelete("FX111");
   ObjectDelete("FX112");
   ObjectDelete("FX113");
   ObjectDelete("FX114");
   ObjectDelete("FX115");
   ObjectDelete("FX116");
   ObjectDelete("FX117");
   ObjectDelete("FX118");
   ObjectDelete("FX119");
   ObjectDelete("FX120");
   ObjectDelete("FX121");
   ObjectDelete("FX122");
   ObjectDelete("FX123");
   ObjectDelete("FX124");
   ObjectDelete("FX125");
   ObjectDelete("FX126");
   ObjectDelete("FX127");
   ObjectDelete("FX128");
   ObjectDelete("FX129");
   ObjectDelete("FX130");
   ObjectDelete("FX131");
   ObjectDelete("FX132");
   ObjectDelete("FX133");
   ObjectDelete("FX134");
}