/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Copyright 2011, Auto Trade Fusion"
#property link      ""

#property indicator_chart_window

int gi_unused_76 = 0;
int gi_unused_80 = 0;
int gi_unused_84 = 0;
int gi_unused_88 = 0;
int gi_unused_92 = 0;
double gd_unused_96 = 0.0;
double gd_unused_104 = 0.0;
double gd_unused_112 = 0.0;
bool gi_unused_120 = TRUE;
bool gi_unused_124 = TRUE;
bool gi_unused_128 = TRUE;
bool gi_unused_132 = TRUE;
bool gi_unused_136 = TRUE;
bool gi_unused_140 = TRUE;
bool gi_unused_144 = TRUE;
bool gi_unused_148 = TRUE;
int gi_unused_152 = 7384410;
int gi_unused_156 = 7384411;
int gi_unused_160 = 7384412;
int gi_unused_164 = 7384413;
bool gi_168 = FALSE;
bool gi_172 = FALSE;
int gi_unused_176 = 3;
int gi_unused_180 = 75;
int gi_184 = 70;
int gi_188 = 77;
int gi_192 = 109;
int gi_196 = 52;
extern double Target = 25.0;
extern double StopL = 25.0;
int g_time_216 = 0;
string gs_dummy_220;
string gs_market1_228 = "Market1";
string gs_market2_236 = "Market2";
string gs_252 = "alert.wav";
string gs_260 = "alert2.wav";
bool gi_unused_268 = TRUE;
bool gi_unused_272 = TRUE;
bool gi_unused_276 = TRUE;
bool gi_unused_280 = TRUE;
bool gi_unused_284 = TRUE;
bool gi_unused_288 = TRUE;
bool gi_unused_292 = TRUE;
bool gi_unused_296 = TRUE;
int gi_unused_300 = 0;
int gi_unused_320 = 0;
int gi_unused_324 = 0;
int gi_unused_328 = 0;
int gi_unused_332 = 0;
int gi_unused_336 = 0;
string gs_unused_340 = "alert.wav";
string gs_unused_348 = "alert2.wav";
double g_point_356;
int gi_unused_364 = 0;
int gi_unused_368 = 0;
int gi_unused_372 = 0;
int gi_unused_376 = 0;
int gi_unused_380 = 0;
int gi_unused_384 = 0;
int gi_unused_388 = 0;
int gi_unused_392 = 0;
int gi_unused_396 = 0;
int gi_unused_400 = 0;
double gd_unused_404 = 0.0;
double gd_unused_412 = 0.0;
double gd_unused_420 = 0.0;
double gd_unused_428 = 0.0;
double gd_unused_436 = 0.0;
double gd_unused_444 = 0.0;
double gd_unused_452 = 0.0;
double gd_unused_460 = 0.0;
double gd_unused_468 = 0.0;
double gd_unused_476 = 0.0;
string gs_484;
string gs_dummy_492;
int gi_unused_516 = 0;
double gd_unused_520 = 0.0;
int gi_unused_528 = 0;
string gs_dummy_532;
double gda_576[] = {0, 0, 0, 0, 0, 0, 0};
double gda_580[] = {0, 0, 0, 0, 0, 0, 0};
int gia_584[] = {0, 0, 0, 0, 0, 0, 0};
int gia_588[] = {0, 0, 0, 0, 0, 0, 0};
int gia_592[] = {0, 0, 0, 0, 0, 0, 0};
int gia_596[] = {0, 0, 0, 0, 0, 0, 0};
int gia_600[] = {0, 0, 0, 0, 0, 0, 0};
double gda_604[] = {0, 0, 0, 0, 0, 0, 0};
double gda_608[] = {0, 0, 0, 0, 0, 0, 0};
double gda_612[] = {0, 0, 0, 0, 0, 0, 0};
double gda_616[] = {0, 0, 0, 0, 0, 0, 0};
int gia_620[] = {0, 0, 0, 0, 0, 0, 0};
int gia_624[] = {0, 0, 0, 0, 0, 0, 0};
int gia_628[] = {0, 0, 0, 0, 0, 0, 0};
int gia_632[] = {0, 0, 0, 0, 0, 0, 0};
double gd_unused_636 = 0.0;
double gd_unused_644 = 0.0;
int gi_unused_652 = 0;
int gi_unused_656 = 0;
int gi_unused_660 = 0;
double gd_unused_664 = 0.0;
double gd_unused_672 = 0.0;
double gd_unused_680 = 0.0;
double gd_unused_688 = 0.0;
double gd_unused_696 = 0.0;
int gi_unused_704 = 240;
string gs_unused_708 = "00:00:00";
string gs_unused_716 = "23:59:59";
int gi_unused_724 = 0;
int gi_unused_728 = 6;
bool gi_unused_732 = FALSE;
int gi_unused_736 = 10;
bool gi_unused_740 = FALSE;
bool gi_unused_744 = FALSE;
int gi_unused_748 = 100;

int init() {
   return (0);
}

int deinit() {
   ObjectsDeleteAll();
   return (0);
}

int start() {
   int lia_0[1];
   int lia_4[1];
   int lia_8[1];
   int lia_12[1];
   int lia_16[1];
   int lia_20[1];
   int lia_24[1];
   int lia_28[1];
   int lia_32[1];
   int lia_36[1];
   int lia_40[1];
   int lia_44[1];
   int lia_48[1];
   int lia_52[1];
   int lia_56[1];
   int lia_60[1];
   int lia_64[1];
   int lia_68[1];
   int lia_72[1];
   int lia_76[1];
   int lia_80[1];
   int lia_84[1];
   int lia_88[1];
   int lia_92[1];
   int lia_96[1];
   int lia_100[1];
   double lda_104[1];
   double lda_108[1];
   double lda_112[1];
   double lda_116[1];
   double lda_120[1];
   double lda_124[1];
   double lda_128[1];
   double lda_132[1];
   double lda_136[1];
   double lda_140[1];
   double lda_144[1];
   double lda_148[1];
   double lda_152[1];
   double lda_156[1];
   double lda_160[1];
   double lda_164[1];
   double lda_168[1];
   int lia_172[1];
   int lia_176[1];
   int lia_180[1];
   int lia_508[100];
   int lia_512[100];
   int lia_516[100];
   int lia_520[100];
   string ls_unused_580;
   double lda_588[];
   double lda_592[];
   double lda_632[];
   string ls_unused_680;
   if (Point == 0.00001) g_point_356 = 0.0001;
   else {
      if (Point == 0.001) g_point_356 = 0.01;
      else g_point_356 = Point;
   }
   Comment("\n", 
      "\n", "FOREX SIGNALS SOFTWARE", 
      "\n", "Uploaded by : Www.ForexWinners.Ru ", 
      "\n", "Account Curency:", AccountCurrency(), 
      "\n", "Account free margin is " + DoubleToStr(AccountFreeMargin(), 2), 
      "\n", "...................................... ", 
      "\n", "Account Balance:", AccountBalance(), 
      "\n", "Currency Spread is ", MarketInfo(Symbol(), MODE_SPREAD), 
      "\n", "Leverage 1:", AccountLeverage(), 
      "\n", "Digits:", MarketInfo(Symbol(), MODE_DIGITS), 
      "\n", "...................................... ", 
      "\n", "" + gs_484 + "", 
      "\n", "...................................... ", 
   "\n", "Broker Time Is ", TimeToStr(TimeCurrent()));
   int li_unused_192 = 200;
   int li_unused_196 = -1;
   int li_unused_200 = 240;
   int li_unused_204 = -4;
   double ld_unused_208 = 0.3;
   int li_unused_216 = 21;
   int li_unused_220 = 1;
   int li_unused_224 = 5;
   int li_unused_228 = 53;
   int li_unused_232 = 25;
   int li_unused_236 = 75;
   int li_unused_240 = 3;
   int li_unused_244 = 100;
   int li_unused_248 = 2;
   int li_unused_252 = 135;
   int li_unused_256 = 0;
   int li_unused_260 = 210;
   int li_unused_264 = -1;
   int li_unused_268 = 245;
   int li_unused_272 = -4;
   double ld_unused_276 = 0.2;
   if (Time[0] == g_time_216) return (0);
   g_time_216 = Time[0];
   HideTestIndicators(TRUE);
   double l_imacd_284 = iMACD(Symbol(), 0, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 0);
   double l_imacd_292 = iMACD(Symbol(), 0, 12, 26, 9, PRICE_CLOSE, MODE_SIGNAL, 0);
   double l_iclose_300 = iClose(Symbol(), PERIOD_M15, 0);
   double l_iopen_308 = iOpen(Symbol(), PERIOD_M15, 0);
   double l_ilow_316 = iLow(Symbol(), PERIOD_M15, 0);
   double l_ihigh_324 = iHigh(Symbol(), PERIOD_M15, 0);
   double l_irsi_332 = iRSI(NULL, PERIOD_M15, 6, PRICE_CLOSE, 0);
   double l_irsi_340 = iRSI(NULL, PERIOD_M1, 20, PRICE_CLOSE, 0);
   double ld_348 = NormalizeDouble(iMA(NULL, 0, 8, 0, MODE_SMA, PRICE_WEIGHTED, 1), 4);
   double ld_356 = NormalizeDouble(iMA(NULL, 0, 8, 0, MODE_SMA, PRICE_WEIGHTED, 1), 4);
   double l_icci_364 = iCCI(Symbol(), PERIOD_M15, 14, PRICE_CLOSE, 0);
   double l_icci_372 = iCCI(Symbol(), PERIOD_M5, 42, PRICE_CLOSE, 0);
   double l_icci_380 = iCCI(Symbol(), PERIOD_M1, 210, PRICE_CLOSE, 0);
   double l_icci_388 = iCCI(Symbol(), PERIOD_M1, 80, PRICE_CLOSE, 0);
   double l_ima_396 = iMA(NULL, PERIOD_M5, 12, 0, MODE_SMA, PRICE_CLOSE, 0);
   double l_ima_404 = iMA(NULL, PERIOD_H1, 54, 0, MODE_SMA, PRICE_CLOSE, 1);
   HideTestIndicators(FALSE);
   int li_unused_412 = -1;
   int li_unused_416 = 250;
   int li_unused_420 = -4;
   double ld_unused_424 = 0.35;
   int li_unused_432 = 50;
   int li_unused_436 = 8;
   int li_unused_440 = 6;
   int li_unused_444 = 30;
   int li_unused_448 = 20;
   int li_unused_452 = 36;
   int li_unused_456 = 20;
   int li_unused_460 = 5;
   int li_unused_464 = 0;
   int li_unused_468 = 0;
   int li_unused_472 = 4;
   int li_unused_476 = 3;
   int li_unused_480 = 150;
   int li_unused_484 = 21;
   int li_unused_488 = 40;
   int li_unused_492 = 21;
   int li_unused_496 = 1;
   int li_unused_500 = 1;
   int li_unused_524 = 2;
   int li_unused_528 = 1;
   if (l_ima_396 < l_ima_404 && l_imacd_284 < 0.0 && l_imacd_292 < l_imacd_284 && geopad_23434() < 0.0) AutoSellAlerts();
   gi_172 = FALSE;
   if (gi_168 == FALSE) {
      SetPrice(Yellow);
      pLines(Yellow);
      gi_168 = TRUE;
   }
   int li_unused_596 = 10;
   int li_unused_600 = 400;
   int li_unused_604 = 1;
   int li_unused_608 = 3;
   int li_unused_612 = 380;
   int li_unused_616 = 65535;
   int li_unused_620 = 16777215;
   int li_unused_624 = 0;
   int li_unused_636 = 0;
   int li_unused_640 = 9;
   int li_unused_644 = -5;
   int li_unused_648 = 0;
   int li_unused_652 = 1;
   int li_unused_656 = 0;
   int li_unused_660 = 0;
   int li_unused_664 = 0;
   int li_unused_668 = 0;
   int li_unused_672 = 0;
   int li_unused_676 = 0;
   int li_unused_688 = 10;
   int li_unused_692 = 0;
   int li_unused_696 = 0;
   int li_unused_700 = 24;
   int li_unused_708 = 0;
   int li_unused_712 = 0;
   if (l_ima_396 > l_ima_404 && l_imacd_284 > 0.0 && l_imacd_292 > l_imacd_284 && geopad_23434() > 0.0) AutoBuyAlerts();
   gi_168 = FALSE;
   if (gi_172 == FALSE) {
      SetPrice(Yellow);
      pLines(Yellow);
      gi_172 = TRUE;
   }
   return (0);
}

double geopad_23434() {
   double ld_0 = gi_184 - 100;
   double ld_8 = gi_188 - 100;
   double ld_16 = gi_192 - 100;
   double ld_24 = gi_196 - 100;
   double ld_32 = Close[0] - Open[7];
   double ld_40 = Open[7] - Open[14];
   double ld_48 = Open[14] - Open[21];
   double ld_56 = Open[21] - Open[28];
   return (ld_0 * ld_32 + ld_8 * ld_40 + ld_16 * ld_48 + ld_24 * ld_56);
}

void AutoSellAlerts() {
   PlaySound(gs_252);
   Alert(Symbol(), "", " SELL Now @ : ", Bid, ", TP @ : ", Bid - Target * g_point_356, ",", " SL @ : ", Ask + StopL * g_point_356);
   gs_484 = " SELL @ : " + Bid + " TP @ : " + ((Bid - Target * g_point_356)) + " SL @ : " + ((Ask + StopL * g_point_356));
   double l_price_0 = Bid + StopL * g_point_356;
   ObjectCreate("SellStopLine", OBJ_HLINE, 0, 0, l_price_0);
   ObjectSet("SellStopLine", OBJPROP_COLOR, Yellow);
   double l_price_8 = Bid - Target * g_point_356;
   ObjectCreate("SellTargetLine", OBJ_HLINE, 0, 0, l_price_8);
   ObjectSet("SellTargetLine", OBJPROP_COLOR, DarkOrange);
   ObjectCreate("signal", OBJ_LABEL, 0, 0, 0, 0, 0);
   ObjectSet("signal", OBJPROP_XDISTANCE, 1066);
   ObjectSet("signal", OBJPROP_YDISTANCE, 44);
   ObjectSetText("signal", "Sell Signal", 14, "Tahoma", Yellow);
}

void AutoBuyAlerts() {
   PlaySound(gs_260);
   Alert(Symbol(), "", " BUY Now @ : ", Bid, ", TP @ : ", Bid + Target * g_point_356, ",", " SL @ : ", Bid - StopL * g_point_356);
   gs_484 = " BUY @ : " + Bid + " TP @ : " + ((Bid + Target * g_point_356)) + " SL @ : " + ((Bid - StopL * g_point_356));
   double l_price_0 = Bid - StopL * g_point_356;
   ObjectCreate("BuyStopLine", OBJ_HLINE, 0, 0, l_price_0);
   ObjectSet("BuyStopLine", OBJPROP_COLOR, Yellow);
   double l_price_8 = Bid + Target * g_point_356;
   ObjectCreate("BuyTargetLine", OBJ_HLINE, 0, 0, l_price_8);
   ObjectSet("BuyTargetLine", OBJPROP_COLOR, DarkOrange);
   ObjectCreate("signal", OBJ_LABEL, 0, 0, 0, 0, 0);
   ObjectSet("signal", OBJPROP_XDISTANCE, 1066);
   ObjectSet("signal", OBJPROP_YDISTANCE, 44);
   ObjectSetText("signal", "Buy Signal", 14, "Tahoma", Yellow);
}

void pLines(color a_color_0) {
   if (ObjectFind(gs_market1_228) == -1) {
      ObjectCreate(gs_market1_228, OBJ_HLINE, 0, g_time_216, iClose(Symbol(), 0, 0));
      ObjectSet(gs_market1_228, OBJPROP_STYLE, STYLE_DOT);
      ObjectSet(gs_market1_228, OBJPROP_COLOR, a_color_0);
      return;
   }
   ObjectSet(gs_market1_228, OBJPROP_TIME1, g_time_216);
   ObjectSet(gs_market1_228, OBJPROP_PRICE1, iClose(Symbol(), 0, 0));
   ObjectSet(gs_market1_228, OBJPROP_COLOR, a_color_0);
}

void SetPrice(color a_color_0) {
   if (ObjectFind(gs_market1_228) == -1) {
      ObjectCreate(gs_market2_236, OBJ_ARROW, 0, g_time_216, iClose(Symbol(), 0, 0));
      ObjectSet(gs_market2_236, OBJPROP_COLOR, a_color_0);
      ObjectSet(gs_market2_236, OBJPROP_WIDTH, 1);
      ObjectSet(gs_market2_236, OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE);
      return;
   }
   ObjectSet(gs_market2_236, OBJPROP_TIME1, g_time_216);
   ObjectSet(gs_market2_236, OBJPROP_PRICE1, iClose(Symbol(), 0, 0));
   ObjectSet(gs_market2_236, OBJPROP_COLOR, a_color_0);
   ObjectSet(gs_market2_236, OBJPROP_WIDTH, 1);
   ObjectSet(gs_market2_236, OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE);
   if (ObjectFind("Time") == -1) ObjectCreate("Time", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Time", OBJPROP_CORNER, 1);
   ObjectSet("Time", OBJPROP_XDISTANCE, 15);
   ObjectSet("Time", OBJPROP_YDISTANCE, 75);
   ObjectSet("Time", OBJPROP_BACK, TRUE);
   int li_4 = Time[0] + 60 * Period() - TimeCurrent();
   int li_8 = li_4 % 60;
   li_4 = (li_4 - li_4 % 60) / 60;
   string l_text_12 = li_4 + " minutes " + li_8 + " seconds left to bar end ";
   ObjectSetText("Time", l_text_12, 10, "Tahoma", Yellow);
}
