/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "ServerUang"
#property link      "http://www.indofx-trader.net/"

#property indicator_chart_window

extern string Settings_n_1 = "--------------------------";
extern int Side = 1;
extern int MP_Y = 0;
extern int MP_X = 0;
extern string Settings_n_2 = "--------------------------";
extern string Colors_Setting = "Setting for Colors";
extern color Highest_Color = Blue;
extern color Distance_from_Highest_Color = DodgerBlue;
extern color Lowest_Color = Red;
extern color Distance_from_Lowest_Color = OrangeRed;
extern color Hi_to_Lo_Color = Peru;
extern color Daily_Av_Up_Color = Blue;
extern color Daily_Av_Dn_Color = Red;
extern color Time_n_Spread_Color = LimeGreen;
extern color PipsToOpen_Up_Color = Blue;
extern color PipsToOpen_Dn_Color = Red;
extern string Settings_n_3 = "--------------------------";
extern string Signals_Settings = "Settings for Signals";
extern bool Show_Signals = TRUE;
extern string BuySeLL_Settings = "--------------------------";
extern int MAFast_Period = 1;
extern int MAFast_Method = 0;
extern int MAFast_Apply_To = 0;
extern int MAFast_Shift = 0;
extern int MASlow_Period = 4;
extern int MASlow_Method = 0;
extern int MASlow_Apply_To = 1;
extern int MASlow_Shift = 0;
extern string TRend_Settings = "--------------------------";
extern int TMAFast_Period = 1;
extern int TMAFast_Method = 0;
extern int TMAFast_Apply_To = 0;
extern int TMAFast_Shift = 0;
extern int TMASlow_Period = 20;
extern int TMASlow_Method = 0;
extern int TMASlow_Apply_To = 0;
extern int TMASlow_Shift = 0;
extern string Strength_Settings = "--------------------------";
extern int RSI_Period = 5;
extern int RSI_PRICE_TYPE = 0;
extern int CCI_Period = 20;
extern int CCI_PRICE_TYPE = 0;
extern int STOCH_K_Period = 5;
extern int STOCH_D_Period = 3;
extern int STOCH_Slowing = 3;
extern int STOCH_MA_MODE = 0;
extern int STOCH_Price_Field = 0;
extern string Settings_n_4 = "--------------------------";
extern color LegendColor = Gainsboro;
extern color PriceColor_Up = Lime;
extern color PriceColor_Dn = Red;
extern color NeutralColor = LightGray;
extern color Arrow_Up = Lime;
extern color Arrow_Dn = Red;
extern color Arrow_Nt = White;
double gd_332;
double gd_340;
double gd_348;
double g_timeframe_356;
int gi_384;
int gi_388;
int gi_392;
int gi_396;
int gi_400;
int gi_404;
int gi_408;
int gi_412;
int gi_416;
int gi_420;
string gs_424;
string gs_432;
string g_dbl2str_440;
string g_dbl2str_448;
string gs_unused_456 = "ñ";
string gs_unused_464 = "ò";
string gs_unused_472 = "«";
string gs_480;
int g_color_488;
int gi_512;
string gs_unused_520 = "";
string gs_unused_528 = "";

int init() {
   return (0);
}

int deinit() {
   string l_name_4;
   for (int li_0 = ObjectsTotal() - 1; li_0 >= 0; li_0--) {
      l_name_4 = ObjectName(li_0);
      if (StringSubstr(l_name_4, 0, 4) == "MP14") ObjectDelete(l_name_4);
   }
   return (0);
}

int start() {
   int l_ind_counted_0 = IndicatorCounted();
   gd_340 = Time[4] - Time[5] - MathMod(TimeCurrent(), Time[4] - Time[5]);
   gd_332 = gd_340 / 60.0;
   gd_340 = 60.0 * (gd_332 - MathFloor(gd_332));
   gd_332 = MathFloor(gd_332);
   g_dbl2str_440 = DoubleToStr(gd_332, 0);
   g_dbl2str_448 = DoubleToStr(gd_340, 0);
   gs_424 = g_dbl2str_440 + ":" + g_dbl2str_448;
   Write("MP14008", Side, MP_X + 100, MP_Y + 96, gs_424, 8, "Tahoma Bold", Yellow);
   gd_332 = (Ask - Bid) / Point;
   gs_424 = DoubleToStr(gd_332, Digits - 4);
   Write("MP14009", Side, MP_X + 100, MP_Y + 218, gs_424, 8, "Tahoma Bold", Yellow);
   if (Show_Signals) {
      gi_404 = MP_X + 115;
      gi_408 = MP_X + 99;
      gi_412 = MP_X + 76;
      gi_416 = MP_X + 40;
      gi_420 = MP_X + 10;
      gi_384 = gi_404;
      gi_388 = MP_Y + 106;
      gi_392 = 10;
      gs_432 = "Tahoma Narrow";
      gi_400 = 8;
      Write("MP14016", Side, gi_384, gi_388 + 0 * gi_392, "MN", gi_400, gs_432, LegendColor);
      Write("MP14017", Side, gi_384, gi_388 + 1 * gi_392, "W1", gi_400, gs_432, LegendColor);
      Write("MP14018", Side, gi_384, gi_388 + gi_392 * 2, "D1", gi_400, gs_432, LegendColor);
      Write("MP14019", Side, gi_384, gi_388 + gi_392 << 2, "H4", gi_400, gs_432, LegendColor);
      Write("MP14020", Side, gi_384, gi_388 + 5 * gi_392, "H1", gi_400, gs_432, LegendColor);
      Write("MP14021", Side, gi_384, gi_388 + 6 * gi_392, "M30", gi_400, gs_432, LegendColor);
      Write("MP14022", Side, gi_384, gi_388 + gi_392 << 3, "M15", gi_400, gs_432, LegendColor);
      Write("MP14023", Side, gi_384, gi_388 + 9 * gi_392, "M5", gi_400, gs_432, LegendColor);
      Write("MP14024", Side, gi_384, gi_388 + 10 * gi_392, "M1", gi_400, gs_432, LegendColor);
      gi_512 = 1;
      gi_388 = MP_Y + 106;
      gi_392 = 10;
      while (gi_512 <= 9) {
         switch (gi_512) {
         case 1:
            g_timeframe_356 = 43200;
            gi_396 = 0;
            break;
         case 2:
            g_timeframe_356 = 10080;
            gi_396 = 1;
            break;
         case 3:
            g_timeframe_356 = 1440;
            gi_396 = 2;
            break;
         case 4:
            g_timeframe_356 = 240;
            gi_396 = 4;
            break;
         case 5:
            g_timeframe_356 = 60;
            gi_396 = 5;
            break;
         case 6:
            g_timeframe_356 = 30;
            gi_396 = 6;
            break;
         case 7:
            g_timeframe_356 = 15;
            gi_396 = 8;
            break;
         case 8:
            g_timeframe_356 = 5;
            gi_396 = 9;
            break;
         case 9:
            g_timeframe_356 = 1;
            gi_396 = 10;
         }
         gd_348 = iClose(NULL, g_timeframe_356, 0) - iOpen(NULL, g_timeframe_356, 0);
         if (gd_348 > 0.0) {
            g_color_488 = PriceColor_Up;
            gs_480 = "n";
         } else {
            if (gd_348 < 0.0) {
               g_color_488 = PriceColor_Dn;
               gs_480 = "n";
            } else {
               g_color_488 = NeutralColor;
               gs_480 = "ª";
            }
         }
         Write("MP14028" + DoubleToStr(gi_512, 0), Side, gi_408 + 2, gi_388 + gi_396 * gi_392, gs_480, 10, "Wingdings", g_color_488);
         gi_512++;
      }
   } else Write("MP14030", Side, MP_X + 10, MP_Y + 90, "Created by ServerUang", 7, "Tahoma Narrow", Gray);
   return (0);
}

void Write(string a_name_0, double a_corner_8, int a_x_16, int a_y_20, string a_text_24, int a_fontsize_32, string a_fontname_36, color a_color_44 = -1) {
   ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0);
   ObjectSetText(a_name_0, a_text_24, a_fontsize_32, a_fontname_36, a_color_44);
   ObjectSet(a_name_0, OBJPROP_CORNER, a_corner_8);
   ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_16);
   ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_20);
}
