#property copyright "Copyright � 2011, www.eaMidas.com"
#property link      "http://www.eamidas.com"
/*
#import "EAMidas.dll"
   string httpPOST(string a0, string a1, int& a2[]);
#import
*/
//educated by 4words (WWI)
//string reccomend = "EA is made for EURUSD M1";
string gs_76 = "0123456789ABCDEF";
///extern string SiteWeb = "www.EAMidas.com";
////extern string Email = "support@eamidas.com";
//extern string Pass = "";
double g_minlot_108;
double gd_116;
 int vStopLevel = 10;
int gi_128 = 15;

bool gi_140 = TRUE;
 double vLot = 1;
bool gi_152 = FALSE;
double gd_156 = 1.5;
int gi_164 = 2;
int gi_168 = 1;
int g_period_172 = 5;
int g_period_176 = 50;
bool gi_180 = TRUE;
int g_period_184 = 50;
int gi_188 = 2;
bool gi_192 = TRUE;
int g_period_196 = 5;
int g_period_200 = 3;
int g_slowing_204 = 3;
int gi_208 = 1;
int g_period_212 = 9;
int gi_216 = 70;
int gi_220 = 30;
int g_order_total_224;
int g_hist_total_228;
int g_pos_232;
int g_count_236;
int gi_240;
int g_cmd_244;
int gi_248;
int gi_252 = 0;
double gd_256;
double g_minlot_264;
double gd_272;
double g_stoplevel_280;
double g_order_lots_288;
double g_order_open_price_296;
double gd_304;
double gd_312;
double gd_320;
string g_price_328;
string gs_336 = "";
string gs_344;
string gs_dummy_352;

// C7B3B66A18A2F81233CBB99F95246259
string f0_10(string as_0) {
   string ls_24;
   int li_32;
   int str_len_8 = StringLen(as_0);
   string str_concat_12 = "";
   for (int li_20 = 0; li_20 < str_len_8; li_20++) {
      ls_24 = StringSubstr(as_0, li_20, 1);
      li_32 = StringGetChar(ls_24, 0);
      if ((li_32 > '/' && li_32 < ':') || (li_32 > '@' && li_32 < '[') || (li_32 > '`' && li_32 < '{')) str_concat_12 = StringConcatenate(str_concat_12, ls_24);
      else {
         if (li_32 == ' ') str_concat_12 = StringConcatenate(str_concat_12, "+");
         else str_concat_12 = StringConcatenate(str_concat_12, "%", f0_8(li_32));
      }
   }
   return (str_concat_12);
}

// 09BA5B44D2BE597CB46112113C2992FD
string f0_0(string asa_0[][]) {
   string ls_12;
   string ls_20;
   string str_concat_4 = "";
   int li_28 = ArrayRange(asa_0, 0);
   for (int index_32 = 0; index_32 < li_28; index_32++) {
      ls_12 = f0_10(asa_0[index_32][0]);
      ls_20 = f0_10(asa_0[index_32][1]);
      str_concat_4 = StringConcatenate(str_concat_4, ls_12, "=", ls_20);
      if (index_32 + 1 < li_28) str_concat_4 = StringConcatenate(str_concat_4, "&");
   }
   return (str_concat_4);
}

// 175C39C88861B8F594EBB58C83FA0836
void f0_1(string as_0, string as_8, string &asa_16[][]) {
   int li_20 = ArrayRange(asa_16, 0);
   if (ArrayResize(asa_16, li_20 + 1) > -1) {
      asa_16[li_20][0] = as_0;
      asa_16[li_20][1] = as_8;
   }
}

// B8D1B43EAE73587BA56BAEF574709ECB
string f0_8(int ai_0) {
   string str_concat_4 = "";
   int li_12 = ai_0 % 16;
   int li_16 = (ai_0 - li_12) / 16;
   if (li_16 > 15) str_concat_4 = StringConcatenate(f0_8(li_16), StringSubstr(gs_76, li_12, 1));
   else str_concat_4 = StringConcatenate(StringSubstr(gs_76, li_16, 1), StringSubstr(gs_76, li_12, 1));
   return (str_concat_4);
}

// DEDAC63528AE0B391CFD165E86CE7FE5
int f0_13(string as_0, string as_8) {
   string str_concat_16;
   string lsa_24[][2];
   int lia_28[1];
   string ls_32;
   string ls_40;
   if (IsTesting() == FALSE) {
      str_concat_16 = StringConcatenate("1.1/", AccountNumber(), "/ /", OrderTicket(), "/", OrderProfit(), "/", AccountBalance(), "/", g_minlot_108, "/", as_0,
         "/", g_price_328, "/", TimeCurrent(), "/", as_8, "/", AccountCompany(), "/", Bid);
      ArrayResize(lsa_24, 0);
      f0_1("Token", "lP19A1ZOT1DN-*/d1F4RsDs", lsa_24);
      f0_1("Az1d8P1qmBX73wO5Za", str_concat_16, lsa_24);
      ls_32 = f0_0(lsa_24);
      //ls_40 = httpPOST("http://eamidas.com/index.php", ls_32, lia_28);
      ls_40 = "OK";
      if (lia_28[0] != 200) gs_344 = "Conexion Fallida";
      if (ls_40 == "700") gs_344 = "\nStatus: OK NO TRADER\n";
      if (ls_40 == "701") gs_344 = "\nStatus: OK NO TRADER los VIERNES\nYa puede apagar su computadora\n";
      if (ls_40 == "600") gs_336 = "Status: ERROR 600 Cuenta Suspendida, Factura pendiente\nwww.eamidas.com";
      if (ls_40 == "601") gs_336 = "Status: ERROR 601 Cuenta Suspendida\nwww.eamidas.com";
      if (ls_40 == "400") gs_336 = "Nueva Version Disponible www.eamidas.com";
      if (ls_40 == "401") gs_336 = "Status: ERROR 401 Pass Incorrecto\nwww.eamidas.com";
      if (ls_40 == "402") gs_336 = "Status: ERROR 402 Cuenta incorrecta\nwww.eamidas.com";
      if (ls_40 == "OK") {
         gs_344 = "\nStatus: OK";
         return (5);
      }
   } else {
      gs_344 = "\nStatus: OK\nModo Testing";
      return (5);
   }
   return (0);
}

// 8D064E85C91AC8B75AAD31932292B8F3
int f0_7() {
   g_order_total_224 = OrdersTotal();
   g_count_236 = 0;
   for (g_pos_232 = 0; g_pos_232 < g_order_total_224; g_pos_232++) {
      OrderSelect(g_pos_232, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
      g_count_236++;
   }
   return (g_count_236);
}

// 28B3E8E0430C589C817F0808DA451B75
int f0_2(int a_cmd_0, double a_lots_4, double a_price_12, color a_color_20) {
   f0_13("1 login", "ABRIR");
   if (f0_13("1 login", "ABRIR") == 5) return (OrderSend(Symbol(), a_cmd_0, a_lots_4, a_price_12, 3, 0, 0, "", 1234, 0, a_color_20));
   return (0);
}

// D949B60F6AFA2F90BAFE90C04EDE7C4D
int f0_11() {
   g_order_total_224 = OrdersTotal();
   for (g_pos_232 = g_order_total_224 - 1; g_pos_232 >= 0; g_pos_232--) {
      OrderSelect(g_pos_232, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
      switch (OrderType()) {
      case OP_BUY:
         OrderClose(OrderTicket(), OrderLots(), Bid, 1, CLR_NONE);
         g_price_328 = Bid;
         f0_13("Compra", "CERRAR");
         break;
      case OP_SELL:
         OrderClose(OrderTicket(), OrderLots(), Ask, 1, CLR_NONE);
         g_price_328 = Ask;
         f0_13("Venta", "CERRAR");
         break;
      case OP_BUYLIMIT:
         OrderDelete(OrderTicket());
         break;
      case OP_SELLLIMIT:
         OrderDelete(OrderTicket());
      }
   }
   return (0);
}

// 740A75755B3BF35A868194E8FEC2DF05
double f0_5() {
   g_order_total_224 = OrdersTotal();
   g_order_lots_288 = 0;
   for (g_pos_232 = 0; g_pos_232 < g_order_total_224; g_pos_232++) {
      OrderSelect(g_pos_232, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
      g_order_lots_288 = OrderLots();
   }
   return (g_order_lots_288);
}

// 8CB554127837A4002338C10A299289FB
double f0_6() {
   g_order_total_224 = OrdersTotal();
   gd_304 = 0;
   for (g_pos_232 = 0; g_pos_232 < g_order_total_224; g_pos_232++) {
      OrderSelect(g_pos_232, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
      gd_304 += OrderProfit();
   }
   return (gd_304);
}

// 521345A9FB579F52117F27BE6E0673EE
int f0_4() {
   double ima_0;
   double ima_8;
   double ima_16;
   double ibands_24;
   double ibands_32;
   double istochastic_40;
   double irsi_48;
   if (gi_168 == 0) {
      ima_0 = iMA(Symbol(), 0, g_period_172, 0, MODE_SMA, PRICE_CLOSE, 0);
      ima_8 = iMA(Symbol(), 0, g_period_172, 0, MODE_SMA, PRICE_CLOSE, 1);
      ima_16 = iMA(Symbol(), 0, g_period_176, 0, MODE_SMA, PRICE_CLOSE, 1);
      if (ima_0 > ima_8 && ima_8 > ima_16) return (-15);
      if (!(ima_0 < ima_8 && ima_8 < ima_16)) return (0);
      return (15);
   }
   if (gi_168 == 1) {
      ibands_24 = iBands(Symbol(), 0, g_period_184, gi_188, 0, PRICE_CLOSE, MODE_UPPER, 0);
      ibands_32 = iBands(Symbol(), 0, g_period_184, gi_188, 0, PRICE_CLOSE, MODE_LOWER, 0);
      istochastic_40 = iStochastic(Symbol(), 0, g_period_196, g_period_200, g_slowing_204, MODE_SMA, 0, MODE_SIGNAL, 0);
      irsi_48 = iRSI(Symbol(), 0, g_period_212, PRICE_CLOSE, 0);
      if (gi_180 && (!gi_192) && (!gi_208)) {
         if (Close[0] > ibands_24) return (15);
         if (Close[0] >= ibands_32) return (0);
         return (-15);
      }
      if ((!gi_180) && gi_192 && (!gi_208)) {
         if (istochastic_40 > gi_216) return (15);
         if (istochastic_40 >= gi_220) return (0);
         return (-15);
      }
      if ((!gi_180) && !gi_192 && gi_208) {
         if (irsi_48 > gi_216) return (15);
         if (irsi_48 >= gi_220) return (0);
         return (-15);
      }
      if (gi_180 && gi_192 && (!gi_208)) {
         if (Close[0] > ibands_24 && istochastic_40 > gi_216) return (15);
         if (!(Close[0] < ibands_32 && istochastic_40 < gi_220)) return (0);
         return (-15);
      }
      if (gi_180 && (!gi_192) && gi_208) {
         if (Close[0] > ibands_24 && irsi_48 > gi_216) return (15);
         if (!(Close[0] < ibands_32 && irsi_48 < gi_220)) return (0);
         return (-15);
      }
      if ((!gi_180) && gi_192 && gi_208) {
         if (istochastic_40 > gi_216 && irsi_48 > gi_216) return (15);
         if (!(istochastic_40 < gi_220 && irsi_48 < gi_220)) return (0);
         return (-15);
      }
      if (gi_180 && gi_192 && gi_208) {
         if (Close[0] > ibands_24 && istochastic_40 > gi_216 && irsi_48 > gi_216) return (15);
         if (!(Close[0] < ibands_32 && istochastic_40 < gi_220 && irsi_48 < gi_220)) return (0);
         return (-15);
      }
   }
   return (0);
}

// D9BDC6167AC6238FD81100A25A25B121
int f0_12() {
   if (f0_6() >= gd_116) f0_11();
   if (f0_7() == 0 && f0_5() == 0.0) {
      if (f0_4() == -15)
         if (f0_2(OP_BUY, g_minlot_108, Ask, Blue) > 0) return (0);
      if (f0_4() == 15)
         if (f0_2(OP_SELL, g_minlot_108, Bid, Red) > 0) return (0);
   }
   if (f0_7() > 0 && f0_7() < gi_128) {
      g_cmd_244 = -1;
      g_order_open_price_296 = 0;
      g_order_total_224 = OrdersTotal();
      for (g_pos_232 = 0; g_pos_232 < g_order_total_224; g_pos_232++) {
         OrderSelect(g_pos_232, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
         g_cmd_244 = OrderType();
         g_order_open_price_296 = OrderOpenPrice();
      }
      if (g_cmd_244 == OP_BUY) {
         if (Ask > g_order_open_price_296 - vStopLevel * gd_256) return (0);
         if (gi_140) {
            if (NormalizeDouble(g_minlot_108 * MathPow(vLot, f0_7()), gi_240) > gd_272) return (0);
            if (f0_2(OP_BUY, NormalizeDouble(g_minlot_108 * MathPow(vLot, f0_7()), gi_240), Ask, Blue) > 0) return (0);
         }
         if (gi_152) {
            if (NormalizeDouble(g_minlot_108 + (f0_5() + gd_156), gi_240) > gd_272) return (0);
            gi_248 = f0_2(OP_BUY, NormalizeDouble(f0_5() + gd_156, gi_240), Ask, Blue);
         }
      }
      if (g_cmd_244 == OP_SELL) {
         if (Bid < g_order_open_price_296 + vStopLevel * gd_256) return (0);
         if (gi_140) {
            if (NormalizeDouble(g_minlot_108 * MathPow(vLot, f0_7()), gi_240) > gd_272) return (0);
            if (f0_2(OP_SELL, NormalizeDouble(g_minlot_108 * MathPow(vLot, f0_7()), gi_240), Bid, Red) > 0) return (0);
         }
         if (gi_152) {
            if (NormalizeDouble(g_minlot_108 + (f0_5() + gd_156), gi_240) > gd_272) return (0);
            if (f0_2(OP_SELL, NormalizeDouble(g_minlot_108 + gd_156 * g_pos_232, gi_240), Bid, Blue) > 0) return (0);
         }
      }
   }
   return (0);
}

// 40C0B8D1F989BF649779529AD30940B2
int f0_3() {
   if (f0_7() == 0) gi_252 = 0;
   g_hist_total_228 = OrdersHistoryTotal();
   g_order_total_224 = OrdersTotal();
   gd_304 = 0;
   for (g_pos_232 = g_hist_total_228 - gi_252; g_pos_232 < g_hist_total_228; g_pos_232++) {
      OrderSelect(g_pos_232, SELECT_BY_POS, MODE_HISTORY);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
      gd_304 += OrderProfit();
   }
   gd_320 = 0;
   for (g_pos_232 = 0; g_pos_232 < g_order_total_224; g_pos_232++) {
      OrderSelect(g_pos_232, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
      gd_320 += OrderProfit();
   }
   gd_312 = gd_304 + gd_320;
   if (gd_312 >= gd_116) f0_11();
   if (f0_7() == 0 && f0_5() == 0.0 && gi_252 == 0) {
      if (f0_4() == -15) {
         f0_13("4 login", "ABRIR");
         gi_248 = f0_2(OP_BUY, g_minlot_108, Ask, Blue);
         if (gi_248 > 0) {
            gi_252++;
            return (0);
         }
      }
      if (f0_4() == 15) {
         f0_13("5 login", "ABRIR");
         gi_248 = f0_2(OP_SELL, g_minlot_108, Bid, Red);
         if (gi_248 > 0) {
            gi_252++;
            return (0);
         }
      }
   }
   if (f0_7() > 0 && f0_7() < gi_128) {
      g_cmd_244 = -1;
      g_order_open_price_296 = 0;
      g_order_total_224 = OrdersTotal();
      for (g_pos_232 = 0; g_pos_232 < g_order_total_224; g_pos_232++) {
         OrderSelect(g_pos_232, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
         g_cmd_244 = OrderType();
         g_order_open_price_296 = OrderOpenPrice();
      }
      if (g_cmd_244 == OP_BUY) {
         if (Ask > g_order_open_price_296 - vStopLevel * gd_256) return (0);
         if (gi_140) {
            if (NormalizeDouble(g_minlot_108 * MathPow(vLot, gi_252), gi_240) > gd_272) return (0);
            gi_248 = f0_2(OP_BUY, NormalizeDouble(g_minlot_108 * MathPow(vLot, gi_252), gi_240), Ask, Blue);
            if (gi_248 > 0) {
               gi_252++;
               g_order_total_224 = OrdersTotal();
               for (g_pos_232 = 0; g_pos_232 < g_order_total_224; g_pos_232++) {
                  OrderSelect(g_pos_232, SELECT_BY_POS, MODE_TRADES);
                  if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
                  if (OrderTicket() != gi_248) OrderClose(OrderTicket(), OrderLots(), Bid, 3, CLR_NONE);
               }
            }
         }
         if (gi_152) {
            if (NormalizeDouble(g_minlot_108 + (f0_5() + gd_156), gi_240) > gd_272) return (0);
            gi_248 = f0_2(OP_BUY, NormalizeDouble(f0_5() + gd_156, gi_240), Ask, Blue);
            if (gi_248 > 0) {
               gi_252++;
               g_order_total_224 = OrdersTotal();
               for (g_pos_232 = 0; g_pos_232 < g_order_total_224; g_pos_232++) {
                  OrderSelect(g_pos_232, SELECT_BY_POS, MODE_TRADES);
                  if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
                  if (OrderTicket() != gi_248) OrderClose(OrderTicket(), OrderLots(), Bid, 3, CLR_NONE);
               }
            }
         }
      }
      if (g_cmd_244 == OP_SELL) {
         if (Bid < g_order_open_price_296 + vStopLevel * gd_256) return (0);
         if (gi_140) {
            if (NormalizeDouble(g_minlot_108 * MathPow(vLot, gi_252), gi_240) > gd_272) return (0);
            gi_248 = f0_2(OP_SELL, NormalizeDouble(g_minlot_108 * MathPow(vLot, gi_252), gi_240), Bid, Red);
            if (gi_248 > 0) {
               gi_252++;
               g_order_total_224 = OrdersTotal();
               for (g_pos_232 = 0; g_pos_232 < g_order_total_224; g_pos_232++) {
                  OrderSelect(g_pos_232, SELECT_BY_POS, MODE_TRADES);
                  if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
                  if (OrderTicket() != gi_248) OrderClose(OrderTicket(), OrderLots(), Ask, 3, CLR_NONE);
               }
            }
         }
         if (gi_152) {
            if (NormalizeDouble(g_minlot_108 + (f0_5() + gd_156), gi_240) > gd_272) return (0);
            gi_248 = f0_2(OP_SELL, NormalizeDouble(g_minlot_108 + gd_156 * gi_252, gi_240), Bid, Blue);
            if (gi_248 > 0) {
               gi_252++;
               g_order_total_224 = OrdersTotal();
               for (g_pos_232 = 0; g_pos_232 < g_order_total_224; g_pos_232++) {
                  OrderSelect(g_pos_232, SELECT_BY_POS, MODE_TRADES);
                  if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
                  if (OrderTicket() != gi_248) OrderClose(OrderTicket(), OrderLots(), Ask, 3, CLR_NONE);
               }
            }
         }
      }
   }
   return (0);
}

// C22A7D2592F1E77038DCD3F05BE37669
int f0_9() {
   if (f0_6() >= gd_116) f0_11();
   if (f0_7() == 0 && f0_5() == 0.0) {
      if (f0_4() == -15) {
         f0_13("Comprar", "ABRIR");
         if (f0_2(OP_BUY, g_minlot_108, Ask, Blue) > 0) return (0);
      }
      if (f0_4() == 15) {
         f0_13("Vender", "ABRIR");
         if (f0_2(OP_SELL, g_minlot_108, Bid, Red) > 0) return (0);
      }
   }
   if (f0_7() == 1 && f0_5() == g_minlot_108) {
      g_cmd_244 = -1;
      g_order_open_price_296 = 0;
      g_order_total_224 = OrdersTotal();
      for (g_pos_232 = 0; g_pos_232 < g_order_total_224; g_pos_232++) {
         OrderSelect(g_pos_232, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != 1234) continue;
         g_cmd_244 = OrderType();
         g_order_open_price_296 = OrderOpenPrice();
      }
      if (g_cmd_244 == OP_BUY) {
         for (g_pos_232 = 1; g_pos_232 <= gi_128; g_pos_232++) {
            if (gi_140) {
               if (NormalizeDouble(g_minlot_108 * MathPow(vLot, g_pos_232), gi_240) > gd_272) return (0);
               f0_2(OP_BUYLIMIT, NormalizeDouble(g_minlot_108 * MathPow(vLot, g_pos_232), gi_240), Ask - vStopLevel * g_pos_232 * gd_256, Blue);
            }
            if (gi_152) {
               if (NormalizeDouble(g_minlot_108 + gd_156 * g_pos_232, gi_240) > gd_272) return (0);
               f0_2(OP_BUYLIMIT, NormalizeDouble(g_minlot_108 + gd_156 * g_pos_232, gi_240), Ask - vStopLevel * g_pos_232 * gd_256, Blue);
            }
         }
      }
      if (g_cmd_244 == OP_SELL) {
         for (g_pos_232 = 1; g_pos_232 <= gi_128; g_pos_232++) {
            if (gi_140) {
               if (NormalizeDouble(g_minlot_108 * MathPow(vLot, g_pos_232), gi_240) > gd_272) return (0);
               f0_2(OP_SELLLIMIT, NormalizeDouble(g_minlot_108 * MathPow(vLot, g_pos_232), gi_240), Bid + vStopLevel * g_pos_232 * gd_256, Red);
            }
            if (gi_152) {
               if (NormalizeDouble(g_minlot_108 + gd_156 * g_pos_232, gi_240) > gd_272) return (0);
               f0_2(OP_SELLLIMIT, NormalizeDouble(g_minlot_108 + gd_156 * g_pos_232, gi_240), Bid + vStopLevel * g_pos_232 * gd_256, Blue);
            }
         }
      }
   }
   return (0);
}

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   if (Digits == 3 || Digits == 5) gd_256 = 10.0 * Point;
   else gd_256 = Point;
   g_minlot_264 = MarketInfo(Symbol(), MODE_MINLOT);
   if (g_minlot_264 == 0.01) gi_240 = 2;
   else {
      if (g_minlot_264 == 0.1) gi_240 = 1;
      else gi_240 = 0;
   }
   if (g_minlot_108 <= g_minlot_264) g_minlot_108 = g_minlot_264;
   g_stoplevel_280 = MarketInfo(Symbol(), MODE_STOPLEVEL);
   if (vStopLevel <= g_stoplevel_280) vStopLevel = g_stoplevel_280;
   double leverage_0 = AccountLeverage();
   if (AccountLeverage() <= 200) g_minlot_108 = NormalizeDouble(AccountBalance() / 10000.0 * (leverage_0 / 200.0), 2);
   else g_minlot_108 = NormalizeDouble(AccountBalance() / 10000.0, 2);
   gd_116 = 150.0 * g_minlot_108;
   gd_272 = 4.0 * g_minlot_108;
   return (0);
}

// 52D46093050F38C27267BCE42543EF60
int deinit() {
   Comment("");
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   string ls_0;
   //if (IsDemo() == TRUE) gs_336 = "Error: EAMidas Solo funciona con cuentas REALES\n";
   //if (StringSubstr(Symbol(), 0, 6) != "EURUSD") gs_336 = "Error: EAMidas Solo funciona con EUR/USD";
   //if (Period() != PERIOD_M1) gs_336 = "Error: Ajusta la escala de tiempo a M1";
   if (AccountBalance() < 50.0) gs_336 = "ERROR: Fondos Insuficientes\nMinimo 50";
   //if (Pass == "") gs_336 = "ERROR: 401 PASS Incorecto\nwww.eamidas.com/error/401";
   if (IsDemo() == TRUE) ls_0 = "Cuenta: Demo";
   else ls_0 = "Cuenta: Real";
   if (gs_336 != "") {
      Alert(gs_336);
      Comment(gs_344);
      gs_336 = "";
   } else {
      switch (gi_164) {
      case 0:
         f0_12();
         Comment("\nAnalizando el Mercado");
         break;
      case 1:
         f0_3();
         Comment("\n Cerrando??");
         break;
      case 2:
         f0_9();
         Comment(gs_344, 
            "\nEA midas\nwww.EAMidas.com\nAnalizando el Mercado . . .\n", ls_0, 
         "\nApalancamiento: ", AccountLeverage());
      }
      return (0);
   }
   return (0);
}