/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Copyright © 2010, MqlRobots.com "
#property link      "http://www.4xTrader.net"

#property indicator_chart_window

extern int Spread = 10;
extern string Top_Left_0__Top_Right__1 = "  Bottom Left_2  Bottom Right_3";
extern int Position = 3;
double g_bid_92;
int gi_100;
int gi_116;
int gi_120;
int gi_124;
int gi_128;
int gi_132;
int gi_136;
int gi_140;
int gi_144;
int gi_160;
int gi_164;
int gi_168;
int gi_172;
int gi_176;
int gi_180;
int gi_184;
int gi_188;
int gi_192;
int gi_196;
int gi_200;
int gi_204;

int init() {
   Comment("");
   if (Position == 0) {
      gi_100 = 10;
      gi_132 = 10;
      gi_116 = 45;
      gi_120 = 125;
      gi_124 = 145;
      gi_128 = 153;
      gi_136 = 2;
      gi_140 = 33;
      gi_144 = 50;
      gi_168 = 2;
      gi_172 = 9;
      gi_176 = 16;
      gi_180 = 23;
      gi_184 = 30;
      gi_188 = 37;
      gi_192 = 44;
      gi_196 = 51;
      gi_160 = 40;
      gi_164 = 20;
      gi_200 = 55;
      gi_204 = 70;
   } else {
      if (Position == 1) {
         gi_100 = 150;
         gi_132 = 90;
         gi_116 = 100;
         gi_120 = 60;
         gi_124 = 5;
         gi_128 = 15;
         gi_136 = 2;
         gi_140 = 33;
         gi_144 = 50;
         gi_168 = 2;
         gi_172 = 9;
         gi_176 = 16;
         gi_180 = 23;
         gi_184 = 30;
         gi_188 = 37;
         gi_192 = 44;
         gi_196 = 51;
         gi_160 = 40;
         gi_164 = 20;
         gi_200 = 35;
         gi_204 = 70;
      } else {
         if (Position == 2) {
            gi_100 = 10;
            gi_132 = 10;
            gi_116 = 45;
            gi_120 = 125;
            gi_124 = 145;
            gi_128 = 153;
            gi_136 = 38;
            gi_140 = 20;
            gi_144 = 2;
            gi_196 = 2;
            gi_192 = 9;
            gi_188 = 16;
            gi_184 = 23;
            gi_180 = 30;
            gi_176 = 37;
            gi_172 = 44;
            gi_168 = 51;
            gi_160 = 10;
            gi_164 = 25;
            gi_200 = 55;
            gi_204 = 70;
         } else {
            gi_100 = 150;
            gi_132 = 90;
            gi_116 = 100;
            gi_120 = 60;
            gi_124 = 5;
            gi_128 = 15;
            gi_136 = 38;
            gi_140 = 20;
            gi_144 = 2;
            gi_196 = 2;
            gi_192 = 9;
            gi_188 = 16;
            gi_184 = 23;
            gi_180 = 30;
            gi_176 = 37;
            gi_172 = 44;
            gi_168 = 51;
            gi_160 = 20;
            gi_164 = 35;
            gi_200 = 55;
            gi_204 = 61;
         }
      }
   }
   int li_0 = 85;
   for (int li_4 = 0; li_4 < li_0; li_4 += 8) for (int li_8 = 0; li_8 < 200; li_8 += 8) objectCreate(". box" + li_4 + "-" + li_8, li_8, li_4, CharToStr(110), 11, "Wingdings", Black);
   return (0);
}

int deinit() {
   ObjectsDeleteAll();
   return (0);
}

int start() {
   double l_spread_4;
   double ld_12;
   int l_ind_counted_0 = IndicatorCounted();
   if (Spread < 1) objectCreate("x", 150, 100, "Please use a valid spread amount", 20, "Tahoma", Lime);
   else {
      objectCreate("x", gi_132, gi_136, "", 20, "Tahoma", Lime);
      objectCreate("Line-8", gi_120, gi_168, CharToStr(103), 8, "Webdings", Black);
      objectCreate("Line-7", gi_120, gi_172, CharToStr(103), 8, "Webdings", Black);
      objectCreate("Line-6", gi_120, gi_176, CharToStr(103), 8, "Webdings", Black);
      objectCreate("Line-5", gi_120, gi_180, CharToStr(103), 8, "Webdings", Black);
      objectCreate("Line-4", gi_120, gi_184, CharToStr(103), 8, "Webdings", Black);
      objectCreate("Line-3", gi_120, gi_188, CharToStr(103), 8, "Webdings", Black);
      objectCreate("Line-2", gi_120, gi_192, CharToStr(103), 8, "Webdings", Black);
      objectCreate("Line-1", gi_120, gi_196, CharToStr(103), 8, "Webdings", Black);
      l_spread_4 = MarketInfo(Symbol(), MODE_SPREAD);
      ld_12 = Spread;
      if (l_spread_4 > 0.0) ObjectSet("Line-1", OBJPROP_COLOR, Lime);
      if (l_spread_4 > ld_12 / 2.0) ObjectSet("Line-2", OBJPROP_COLOR, LimeGreen);
      if (l_spread_4 > ld_12) ObjectSet("Line-3", OBJPROP_COLOR, Yellow);
      if (l_spread_4 > ld_12 / 0.8) ObjectSet("Line-4", OBJPROP_COLOR, Gold);
      if (l_spread_4 > 1.5 * ld_12) ObjectSet("Line-5", OBJPROP_COLOR, Orange);
      if (l_spread_4 > 1.75 * ld_12) ObjectSet("Line-6", OBJPROP_COLOR, Tomato);
      if (l_spread_4 > 2.0 * ld_12) ObjectSet("Line-7", OBJPROP_COLOR, Red);
      if (l_spread_4 > 2.5 * ld_12) ObjectSet("Line-8", OBJPROP_COLOR, Crimson);
      objectCreate("Symbol", gi_132, gi_136, StringSubstr(Symbol(), 0, 6), 10, "Tahoma", Lime);
      objectCreate("Bid", gi_100, gi_140, "Bid:", 10, "Tahoma", Gray);
      objectCreate("Ask", gi_100, gi_144, "Ask:", 10, "Tahoma", Gray);
      objectCreate("Bid-", gi_116, gi_140, DoubleToStr(Bid, Digits), 10, "Tahoma", Red);
      objectCreate("Ask-", gi_116, gi_144, DoubleToStr(Ask, Digits), 10, "Tahoma", Red);
      if (Bid > g_bid_92) {
         ObjectSet("Ask-", OBJPROP_COLOR, CornflowerBlue);
         ObjectSet("Bid-", OBJPROP_COLOR, CornflowerBlue);
      }
      objectCreate("SpeedLabel", gi_124, gi_160, "Spread", 9, "Tahoma", Gray);
      g_bid_92 = Bid;
      if (l_spread_4 <= Spread) objectCreate("Speedx", gi_128, gi_164, DoubleToStr(l_spread_4, 0), 10, "Tahoma", Lime);
      else objectCreate("Speedx", gi_128, gi_164, DoubleToStr(l_spread_4, 0), 12, "Tahoma", Red);
      objectCreate("4xTarder.net", gi_200, gi_204, "Leverage 1:" + AccountLeverage(), 9, "Tahoma", Gray);
   }
   return (0);
}

void objectCreate(string a_name_0, int a_x_8, int a_y_12, string a_text_16, int a_fontsize_24, string a_fontname_28, color a_color_36) {
   ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0);
   ObjectSet(a_name_0, OBJPROP_CORNER, Position);
   ObjectSet(a_name_0, OBJPROP_COLOR, a_color_36);
   ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_8);
   ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_12);
   ObjectSetText(a_name_0, a_text_16, a_fontsize_24, a_fontname_28, a_color_36);
}