/*
   Generated by EX4-TO-MQ4 decompiler ONE FILE V4.0.217.1
   EX4 ID : B2AC6464EC17C8D1CA61C72474971545
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "PyramidEA™ ULTIMATE"
#property link      "http://www.PyramidRobotForex.com"

extern string PyramidEA = ".:: PyramidEA™ ULTIMATE v2008i ::.";
extern string AccountTypeInfo = "0=Standart(1 Lot), 1=Normal(0.1 Lot), 2=Micro(0.01 Lot)";
extern int AccountType = 1;
extern double Lots = 0.1;
double g_pips_104 = 200.0;
double g_pips_112 = 200.0;
double g_pips_120 = 80.0;
int gi_128 = 40;
int gi_132 = 10;
int gi_136 = 2;
int g_magic_140 = 1357924680;
int gi_144 = 109390;
string gs_148 = "2008.12.12";
bool gi_156 = TRUE;
bool gi_160 = TRUE;
double gd_164 = 0.0;
double gd_172 = 0.0;
double gd_180 = 0.0;
double gd_188 = 0.0;
double gd_196 = 0.0;
double gd_204 = 0.0;
double gd_212 = 0.0;
double gd_220 = 0.0;
double gd_228 = 0.0;
double gd_236 = 0.0;
double gd_244 = 0.0;
int gi_unused_252 = 0;
int gi_256 = 0;
int gi_unused_260 = 0;
int g_count_264 = 0;
int g_pos_268 = 0;
int g_slippage_272 = 5;
double g_price_276 = 0.0;
double g_price_284 = 0.0;
double g_ask_292 = 0.0;
double g_bid_300 = 0.0;
double gd_308 = 0.0;
double g_lots_316 = 0.0;
double gd_unused_324 = 0.0;
int g_cmd_332 = OP_BUY;
int gi_336 = 0;
bool gi_340 = TRUE;
double g_ord_open_price_344 = 0.0;
int gi_352 = 0;
double gd_356 = 0.0;
int g_ticket_364 = 0;
int gi_368 = 0;
double g_price_372 = 0.0;
double g_ord_lots_380 = 0.0;
double gd_unused_388 = 0.0;
string gs_396 = "";
int g_count_404 = 0;

int start() {
   int l_str2time_0;
   bool l_bool_4;
   int l_acc_number_8;
   /*if (gi_156) {
      l_str2time_0 = StrToTime(gs_148);
      if (TimeCurrent() >= l_str2time_0) {
         Alert("This EA has been expired!");
         return (0);
      }
   }*/
   if (gi_160) {
      l_bool_4 = IsDemo();
      if (!l_bool_4) {
         l_acc_number_8 = AccountNumber();
         if (l_acc_number_8 != gi_144) {
            Alert("Only Account Number " + gi_144 + " can use this EA !");
            return (0);
         }
      }
   }
   if (AccountType == 0) {
      gd_164 = 1;
      gd_172 = 2;
      gd_180 = 5;
      gd_188 = 8;
      gd_196 = 18;
      gd_204 = 33;
      gd_212 = 69;
      gd_220 = 96;
      gd_228 = 100;
      gd_236 = 100;
      gd_244 = 100;
   }
   if (AccountType == 1) {
      gd_164 = 0.1;
      gd_172 = 0.2;
      gd_180 = 0.5;
      gd_188 = 0.8;
      gd_196 = 1.8;
      gd_204 = 3.3;
      gd_212 = 6.9;
      gd_220 = 9.6;
      gd_228 = 10.0;
      gd_236 = 10.0;
      gd_244 = 10.0;
   }
   if (AccountType == 2) {
      gd_164 = 0.01;
      gd_172 = 0.02;
      gd_180 = 0.05;
      gd_188 = 0.08;
      gd_196 = 0.18;
      gd_204 = 0.33;
      gd_212 = 0.69;
      gd_220 = 0.96;
      gd_228 = 1.0;
      gd_236 = 1.0;
      gd_244 = 1.0;
   }
   double l_ima_12 = iMA(NULL, PERIOD_H1, 12, 0, MODE_EMA, PRICE_CLOSE, 0);
   double l_ima_20 = iMA(NULL, PERIOD_H1, 32, 0, MODE_SMA, PRICE_HIGH, 0);
   double l_ima_28 = iMA(NULL, PERIOD_H1, 32, 0, MODE_SMA, PRICE_CLOSE, 0);
   double l_ima_36 = iMA(NULL, PERIOD_H1, 32, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_44 = iMA(NULL, PERIOD_H1, 8, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_52 = iMA(NULL, PERIOD_H1, 26, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_60 = iMA(NULL, PERIOD_H1, 26, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_68 = iMA(NULL, PERIOD_H1, 26, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_76 = iMA(NULL, PERIOD_H1, 9, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_84 = iMA(NULL, PERIOD_H1, 28, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_92 = iMA(NULL, PERIOD_H1, 28, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_100 = iMA(NULL, PERIOD_H1, 28, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_108 = iMA(NULL, PERIOD_H1, 10, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_116 = iMA(NULL, PERIOD_H1, 30, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_124 = iMA(NULL, PERIOD_H1, 30, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_132 = iMA(NULL, PERIOD_H1, 30, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_140 = iMA(NULL, PERIOD_H1, 14, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_148 = iMA(NULL, PERIOD_H1, 34, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_156 = iMA(NULL, PERIOD_H1, 34, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_164 = iMA(NULL, PERIOD_H1, 34, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_172 = iMA(NULL, PERIOD_H1, 16, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_180 = iMA(NULL, PERIOD_H1, 36, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_188 = iMA(NULL, PERIOD_H1, 36, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_196 = iMA(NULL, PERIOD_H1, 36, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_204 = iMA(NULL, PERIOD_H1, 18, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_212 = iMA(NULL, PERIOD_H1, 38, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_220 = iMA(NULL, PERIOD_H1, 38, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_228 = iMA(NULL, PERIOD_H1, 38, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_236 = iMA(NULL, PERIOD_H1, 20, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_244 = iMA(NULL, PERIOD_H1, 40, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_252 = iMA(NULL, PERIOD_H1, 40, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_260 = iMA(NULL, PERIOD_H1, 40, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_268 = iMA(NULL, PERIOD_H1, 22, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_276 = iMA(NULL, PERIOD_H1, 44, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_284 = iMA(NULL, PERIOD_H1, 44, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_292 = iMA(NULL, PERIOD_H1, 44, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_300 = iMA(NULL, PERIOD_H1, 26, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_308 = iMA(NULL, PERIOD_H1, 50, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_316 = iMA(NULL, PERIOD_H1, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_324 = iMA(NULL, PERIOD_H1, 50, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_332 = iMA(NULL, PERIOD_H1, 30, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_340 = iMA(NULL, PERIOD_H1, 55, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_348 = iMA(NULL, PERIOD_H1, 55, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_356 = iMA(NULL, PERIOD_H1, 55, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_364 = iMA(NULL, PERIOD_H1, 33, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_372 = iMA(NULL, PERIOD_H1, 60, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_380 = iMA(NULL, PERIOD_H1, 60, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_388 = iMA(NULL, PERIOD_H1, 60, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_396 = iMA(NULL, PERIOD_H1, 36, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_404 = iMA(NULL, PERIOD_H1, 66, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_412 = iMA(NULL, PERIOD_H1, 66, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_420 = iMA(NULL, PERIOD_H1, 66, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_428 = iMA(NULL, PERIOD_H1, 40, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_436 = iMA(NULL, PERIOD_H1, 70, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_444 = iMA(NULL, PERIOD_H1, 70, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_452 = iMA(NULL, PERIOD_H1, 70, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_460 = iMA(NULL, PERIOD_H1, 50, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_468 = iMA(NULL, PERIOD_H1, 96, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_476 = iMA(NULL, PERIOD_H1, 96, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_484 = iMA(NULL, PERIOD_H1, 96, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_492 = iMA(NULL, PERIOD_H1, 55, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_500 = iMA(NULL, PERIOD_H1, 100, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_508 = iMA(NULL, PERIOD_H1, 100, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_516 = iMA(NULL, PERIOD_H1, 100, 0, MODE_SMA, PRICE_LOW, 0);
   double ld_unused_524 = iMA(NULL, PERIOD_H1, 15, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ld_unused_532 = iMA(NULL, PERIOD_H1, 14, 0, MODE_SMA, PRICE_HIGH, 0);
   double ld_unused_540 = iMA(NULL, PERIOD_H1, 14, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ld_unused_548 = iMA(NULL, PERIOD_H1, 14, 0, MODE_SMA, PRICE_LOW, 0);
   double l_icustom_556 = iCustom(NULL, PERIOD_M30, "PyramidIndicator1", 1, 12, 0, 0);
   double l_icustom_564 = iCustom(NULL, PERIOD_M30, "PyramidIndicator1", 1, 12, 1, 0);
   double l_icustom_572 = iCustom(NULL, PERIOD_H1, "PyramidIndicator2", 10, 0, 0);
   double l_icustom_580 = iCustom(NULL, PERIOD_H1, "PyramidIndicator2", 10, 1, 0);
   double l_icustom_588 = iCustom(NULL, PERIOD_H1, "PyramidIndicator2", 10, 2, 0);
   double ld_596 = NormalizeDouble(MarketInfo(Symbol(), MODE_MINLOT), 2);
   double ld_604 = NormalizeDouble(MarketInfo(Symbol(), MODE_MAXLOT), 2);
   double ld_unused_612 = NormalizeDouble(MarketInfo(Symbol(), MODE_LOTSIZE), 0);
   double ld_unused_620 = MarketInfo(Symbol(), MODE_TICKVALUE);
   if (gd_308 < ld_596) gd_308 = ld_596;
   if (gd_308 > ld_604) gd_308 = ld_604;
   g_count_264 = 0;
   g_count_404 = 0;
   for (g_pos_268 = 0; g_pos_268 < OrdersTotal(); g_pos_268++) {
      OrderSelect(g_pos_268, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_140) g_count_264++;
      if (OrderMagicNumber() == g_magic_140) g_count_404++;
   }
   if (gi_352 > g_count_264) {
      for (g_pos_268 = OrdersTotal(); g_pos_268 >= 0; g_pos_268--) {
         OrderSelect(g_pos_268, SELECT_BY_POS, MODE_TRADES);
         g_cmd_332 = OrderType();
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_140) {
            if (g_cmd_332 == OP_BUY) OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), g_slippage_272, Blue);
            if (g_cmd_332 == OP_SELL) OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), g_slippage_272, Red);
            return (0);
         }
      }
   }
   gi_352 = g_count_264;
   if (g_count_264 >= gi_132) gi_340 = FALSE;
   else gi_340 = TRUE;
   if (g_ord_open_price_344 == 0.0) {
      for (g_pos_268 = 0; g_pos_268 < OrdersTotal(); g_pos_268++) {
         OrderSelect(g_pos_268, SELECT_BY_POS, MODE_TRADES);
         g_cmd_332 = OrderType();
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_140) {
            g_ord_open_price_344 = OrderOpenPrice();
            if (g_cmd_332 == OP_BUY) gi_336 = 2;
            if (g_cmd_332 == OP_SELL) gi_336 = 1;
         }
      }
   }
   if (g_count_404 < 1) {
      gi_336 = 3;
      gi_256 = FALSE;
      if (l_ima_12 < l_ima_20 && l_ima_12 < l_ima_28 && l_ima_12 < l_ima_36 && l_icustom_556 >= l_icustom_564) gi_336 = 1;
      if (l_ima_12 > l_ima_36 && l_ima_12 > l_ima_28 && l_ima_12 > l_ima_20 && l_icustom_556 <= l_icustom_564) gi_336 = 2;
   }
   for (g_pos_268 = OrdersTotal(); g_pos_268 >= 0; g_pos_268--) {
      OrderSelect(g_pos_268, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_140) {
         if (OrderType() == OP_SELL) {
            if (g_pips_120 > 0.0) {
               if (OrderOpenPrice() - Ask >= g_pips_120 * Point + gi_128 * Point) {
                  if (OrderStopLoss() > Ask + Point * g_pips_120) {
                     OrderModify(OrderTicket(), OrderOpenPrice(), Ask + Point * g_pips_120, OrderClosePrice() - g_pips_104 * Point - g_pips_120 * Point, 0, Green);
                     gi_256 = TRUE;
                     return (0);
                  }
               }
            }
         }
         if (OrderType() == OP_BUY) {
            if (g_pips_120 > 0.0) {
               if (Bid - OrderOpenPrice() >= g_pips_120 * Point + gi_128 * Point) {
                  if (OrderStopLoss() < Bid - Point * g_pips_120) {
                     OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * g_pips_120, OrderClosePrice() + g_pips_104 * Point + g_pips_120 * Point, 0, Green);
                     gi_256 = TRUE;
                     return (0);
                  }
               }
            }
         }
      }
   }
   gd_356 = 0;
   g_ticket_364 = 0;
   gi_368 = FALSE;
   g_price_372 = 0;
   g_ord_lots_380 = 0;
   for (g_pos_268 = 0; g_pos_268 < OrdersTotal(); g_pos_268++) {
      OrderSelect(g_pos_268, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_140) {
         g_ticket_364 = OrderTicket();
         if (OrderType() == OP_BUY) gi_368 = FALSE;
         if (OrderType() == OP_SELL) gi_368 = TRUE;
         g_price_372 = OrderClosePrice();
         g_ord_lots_380 = OrderLots();
         if (gi_368 == FALSE) {
            if (OrderClosePrice() < OrderOpenPrice()) gd_356 -= (OrderOpenPrice() - OrderClosePrice()) * OrderLots() / Point;
            if (OrderClosePrice() > OrderOpenPrice()) gd_356 += (OrderClosePrice() - OrderOpenPrice()) * OrderLots() / Point;
         }
         if (gi_368 == TRUE) {
            if (OrderClosePrice() > OrderOpenPrice()) gd_356 -= (OrderClosePrice() - OrderOpenPrice()) * OrderLots() / Point;
            if (OrderClosePrice() < OrderOpenPrice()) gd_356 += (OrderOpenPrice() - OrderClosePrice()) * OrderLots() / Point;
         }
      }
   }
   if (gi_336 == 3) gs_396 = " | Waiting strong signal...";
   else gs_396 = "";
   Comment("Account: ", AccountNumber(), " | Name: ", AccountName(), " | Laverage: 1:", AccountLeverage(), " | Total Balance: ", DoubleToStr(AccountBalance(), 2), " | Profit: $", DoubleToStr(AccountProfit(), 2), "+/- ", gs_396, 
   "\n", PyramidEA);
   if (AccountEquity() > AccountBalance()) {
      if (gi_336 == 2 && (l_ima_12 <= l_ima_20 && l_ima_12 <= l_ima_28)) {
         OrderClose(g_ticket_364, g_ord_lots_380, g_price_372, g_slippage_272, Blue);
         gi_340 = FALSE;
         return (0);
      }
      if (gi_336 == 1 && (l_ima_12 >= l_ima_36 && l_ima_12 >= l_ima_28)) {
         OrderClose(g_ticket_364, g_ord_lots_380, g_price_372, g_slippage_272, Red);
         gi_340 = FALSE;
         return (0);
      }
      if (gi_256 == FALSE) {
         if (gi_336 == 2 && (g_count_264 >= gi_136 && Bid - g_ord_open_price_344 >= gi_128 * Point)) {
            OrderClose(g_ticket_364, g_ord_lots_380, g_price_372, g_slippage_272, Yellow);
            gi_340 = FALSE;
            return (0);
         }
         if (gi_336 == 1 && (g_count_264 >= gi_136 && g_ord_open_price_344 - Ask >= gi_128 * Point)) {
            OrderClose(g_ticket_364, g_ord_lots_380, g_price_372, g_slippage_272, Yellow);
            gi_340 = FALSE;
            return (0);
         }
      }
      if (gi_256 == TRUE) {
         if (gi_336 == 2 && (l_icustom_556 >= l_icustom_564 && l_icustom_588 == l_icustom_572)) {
            OrderClose(g_ticket_364, g_ord_lots_380, g_price_372, g_slippage_272, Green);
            gi_340 = FALSE;
            return (0);
         }
         if (gi_336 == 1 && (l_icustom_556 <= l_icustom_564 && l_icustom_580 == l_icustom_572)) {
            OrderClose(g_ticket_364, g_ord_lots_380, g_price_372, g_slippage_272, Green);
            gi_340 = FALSE;
            return (0);
         }
      }
   }
   if (gi_336 == 1 && gi_340) {
      if (Bid - g_ord_open_price_344 >= gi_128 * Point || g_count_264 < 1) {
         g_bid_300 = Bid;
         g_ord_open_price_344 = 0;
         if (g_pips_104 == 0.0) g_price_284 = 0;
         else g_price_284 = g_bid_300 - g_pips_104 * Point;
         if (g_pips_112 == 0.0) g_price_276 = 0;
         else g_price_276 = NormalizeDouble(g_bid_300 + g_pips_112 * Point + (gi_132 - g_count_264) * gi_128 * Point, Digits);
         if (g_count_264 != 0) {
            for (g_pos_268 = 1; g_pos_268 <= g_count_264; g_pos_268++) {
               if (g_count_264 == 1) g_lots_316 = NormalizeDouble(gd_172, AccountType);
               if (g_count_264 == 2) g_lots_316 = NormalizeDouble(gd_180, AccountType);
               if (g_count_264 == 3) g_lots_316 = NormalizeDouble(gd_188, AccountType);
               if (g_count_264 == 4) g_lots_316 = NormalizeDouble(gd_196, AccountType);
               if (g_count_264 == 5) g_lots_316 = NormalizeDouble(gd_204, AccountType);
               if (g_count_264 == 6) g_lots_316 = NormalizeDouble(gd_212, AccountType);
               if (g_count_264 == 7) g_lots_316 = NormalizeDouble(gd_220, AccountType);
               if (g_count_264 == 8) g_lots_316 = NormalizeDouble(gd_228, AccountType);
               if (g_count_264 == 9) g_lots_316 = NormalizeDouble(gd_236, AccountType);
               if (g_count_264 == 10) g_lots_316 = NormalizeDouble(gd_244, AccountType);
            }
         } else g_lots_316 = NormalizeDouble(gd_164, AccountType);
         if (g_lots_316 >= ld_604) g_lots_316 = ld_604;
         OrderSend(Symbol(), OP_SELL, g_lots_316, g_bid_300, g_slippage_272, g_price_276, g_price_284, "", g_magic_140, 0, Red);
         return (0);
      }
   }
   if (gi_336 == 2 && gi_340) {
      if (g_ord_open_price_344 - Ask >= gi_128 * Point || g_count_264 < 1) {
         g_ask_292 = Ask;
         g_ord_open_price_344 = 0;
         if (g_pips_104 == 0.0) g_price_284 = 0;
         else g_price_284 = g_ask_292 + g_pips_104 * Point;
         if (g_pips_112 == 0.0) g_price_276 = 0;
         else g_price_276 = NormalizeDouble(g_ask_292 - g_pips_112 * Point - (gi_132 - g_count_264) * gi_128 * Point, Digits);
         if (g_count_264 != 0) {
            for (g_pos_268 = 1; g_pos_268 <= g_count_264; g_pos_268++) {
               if (g_count_264 == 1) g_lots_316 = NormalizeDouble(gd_172, AccountType);
               if (g_count_264 == 2) g_lots_316 = NormalizeDouble(gd_180, AccountType);
               if (g_count_264 == 3) g_lots_316 = NormalizeDouble(gd_188, AccountType);
               if (g_count_264 == 4) g_lots_316 = NormalizeDouble(gd_196, AccountType);
               if (g_count_264 == 5) g_lots_316 = NormalizeDouble(gd_204, AccountType);
               if (g_count_264 == 6) g_lots_316 = NormalizeDouble(gd_212, AccountType);
               if (g_count_264 == 7) g_lots_316 = NormalizeDouble(gd_220, AccountType);
               if (g_count_264 == 8) g_lots_316 = NormalizeDouble(gd_228, AccountType);
               if (g_count_264 == 9) g_lots_316 = NormalizeDouble(gd_236, AccountType);
               if (g_count_264 == 10) g_lots_316 = NormalizeDouble(gd_244, AccountType);
            }
         } else g_lots_316 = NormalizeDouble(gd_164, AccountType);
         if (g_lots_316 >= ld_604) g_lots_316 = ld_604;
         OrderSend(Symbol(), OP_BUY, g_lots_316, g_ask_292, g_slippage_272, g_price_276, g_price_284, "", g_magic_140, 0, Blue);
         return (0);
      }
   }
   return (0);
}