Navigation:Home > Content >

Al_Maram_V5.9_extended.mq4

Time: 2012-01-18 | Download file:Al_Maram_V5.9_extended.mq4

#property copyright "Copyright © 2007, DrGMSoftware Corp."
#property link      "mailto:[email protected]"

#property indicator_chart_window

double gd_76 = 13101987.0;
extern int Alerts = 0;
extern int BackTest = 0;
extern bool FiboExLines = TRUE;
extern int GMT = 0;
bool gi_100 = FALSE;
double gd_104 = 3.0;
double gd_112;
double gd_120;
int gi_128 = 1;
int gi_unused_132;
double g_price_136 = 0.0;
double gd_unused_144 = 0.0;
double g_price_152;
double gd_unused_160;
double gd_unused_168;
double gd_unused_176;
double gd_unused_184;
double gd_unused_192;
double gd_unused_200;
double gd_unused_208;
double gd_unused_216;
double gd_unused_224;
double gd_unused_232;
double gd_unused_240;
double gd_unused_248;
double gd_unused_256;
double gd_unused_264;
double gd_unused_272;
double gd_unused_280 = 0.0;
double gd_unused_288 = 0.0;
double gd_unused_296 = 0.0;
double gda_unused_304[2][6];

int init() {
   if (Symbol() == "GBPJPY" || Symbol() == "EURJPY" || Symbol() == "USDJPY" || Symbol() == "GOLD") gi_unused_132 = 2;
   else gi_unused_132 = 4;
   g_price_152 = 0;
   gd_unused_160 = 0;
   gd_unused_168 = 0;
   gd_unused_176 = 0;
   gd_unused_184 = 0;
   gd_unused_192 = 0;
   gd_unused_200 = 0;
   gd_unused_208 = 0;
   gd_unused_216 = 0;
   gd_unused_224 = 0;
   gd_unused_232 = 0;
   gd_unused_240 = 0;
   gd_unused_248 = 0;
   gd_unused_256 = 0;
   gd_unused_264 = 0;
   gd_unused_272 = 0;
   return (0);
}

int deinit() {
   ObjectDelete("Buy Label");
   ObjectDelete("Buy Line");
   ObjectDelete("BuyTP Label");
   ObjectDelete("BuyTP Line");
   ObjectDelete("Sell Label");
   ObjectDelete("Sell Line");
   ObjectDelete("SellTP Label");
   ObjectDelete("SellTP Line");
   ObjectDelete("P Label");
   ObjectDelete("P Line");
   ObjectDelete("Ex Label");
   ObjectDelete("Daily Extream Resistance ");
   ObjectDelete("Daily Extream Support ");
   ObjectDelete("F382Ul");
   ObjectDelete("F382Uline");
   ObjectDelete("F236Ul");
   ObjectDelete("F236Uline");
   ObjectDelete("F618Ul");
   ObjectDelete("F618Uline");
   ObjectDelete("F1618Ul");
   ObjectDelete("F1618Uline");
   ObjectDelete("F2618Ul");
   ObjectDelete("F2618Uline");
   ObjectDelete("F4236Ul");
   ObjectDelete("F4236Uline");
   ObjectDelete("F382Dl");
   ObjectDelete("F382Dline");
   ObjectDelete("F236Dl");
   ObjectDelete("F236Dline");
   ObjectDelete("F618Dl");
   ObjectDelete("F618Dline");
   ObjectDelete("F1618Dl");
   ObjectDelete("F1618Dline");
   ObjectDelete("F2618Dl");
   ObjectDelete("F2618Dline");
   ObjectDelete("F4236Dl");
   ObjectDelete("F4236Dline");
   Comment(g_price_152);
   return (0);
}

int start() {
   double lda_0[1][6];
   double ld_4;
   double ld_12;
   double ld_20;
   double ld_200;
   double ld_600;
   double ld_664;
   double ld_672;
   double ld_680;
   double ld_688;
   double ld_696;
   double ld_704;
   double ld_712;
   double ld_720;
   double ld_728;
   double l_price_736;
   double ld_744;
   double ld_752;
   double l_price_760;
   double ld_768;
   double ld_776;
   double l_price_784;
   double ld_792;
   double ld_800;
   double ld_808;
   double ld_816;
   double l_price_824;
   double l_price_832;
   double l_price_840;
   double l_price_848;
   double l_price_856;
   double l_price_864;
   double l_price_872;
   double l_price_880;
   double l_price_888;
   double l_price_896;
   double l_price_904;
   double l_price_912;
   string ls_976;
   double ld_1008;
   ArrayCopyRates(lda_0, Symbol(), PERIOD_D1);
   if (DayOfWeek() == 1) {
      if (TimeDayOfWeek(iTime(Symbol(), PERIOD_D1, BackTest + 1)) == 5) {
         ld_4 = lda_0[1][4];
         ld_12 = lda_0[1][3];
         ld_20 = lda_0[1][2];
      } else {
         for (int li_28 = 5; li_28 >= 0; li_28--) {
            if (TimeDayOfWeek(iTime(Symbol(), PERIOD_D1, li_28 + BackTest)) == 5) {
               ld_4 = lda_0[li_28][4];
               ld_12 = lda_0[li_28][3];
               ld_20 = lda_0[li_28][2];
            }
         }
      }
   } else {
      ld_4 = lda_0[1][4];
      ld_12 = lda_0[1][3];
      ld_20 = lda_0[1][2];
   }
   double ld_32 = ld_12 - ld_20;
   double ld_40 = (ld_12 + ld_20 + ld_4) / 3.0;
   double ld_48 = ld_40 + 1.0 * ld_32;
   double ld_56 = ld_40 + 0.618 * ld_32;
   double ld_64 = ld_40 + ld_32 / 2.0;
   double ld_72 = (ld_48 + ld_56 + ld_64) / 3.0;
   double ld_80 = ld_40 - ld_32 / 2.0;
   double ld_88 = ld_40 - 0.618 * ld_32;
   double ld_96 = ld_40 - 1.0 * ld_32;
   double ld_104 = (ld_80 + ld_88 + ld_96) / 3.0;
   drawLine(ld_72, "R1", Lime, 0);
   drawLabel("Daily Extream Resistance ", ld_72, Lime);
   drawLine(ld_104, "S1", Maroon, 0);
   drawLabel("Daily Extream Support ", ld_104, Maroon);
   int li_112 = 0;
   int li_116 = 0;
   int li_120 = 0;
   int li_124 = 0;
   int li_128 = 0;
   bool li_132 = FALSE;
   bool li_136 = FALSE;
   bool li_140 = FALSE;
   bool li_144 = FALSE;
   double ld_148 = 0;
   double ld_156 = 0;
   double l_ilow_164 = 0;
   double l_ihigh_172 = 0;
   string ls_180 = "";
   int l_count_188 = 0;
   li_112 = (iHigh(NULL, PERIOD_D1, BackTest + 1) - iLow(NULL, PERIOD_D1, BackTest + 1)) / Point;
   for (l_count_188 = 1; l_count_188 <= 5; l_count_188++) li_116 = li_116 + (iHigh(NULL, PERIOD_D1, l_count_188 + BackTest) - iLow(NULL, PERIOD_D1, l_count_188 + BackTest)) / Point;
   for (l_count_188 = 1; l_count_188 <= 10; l_count_188++) li_120 = li_120 + (iHigh(NULL, PERIOD_D1, l_count_188 + BackTest) - iLow(NULL, PERIOD_D1, l_count_188 + BackTest)) / Point;
   for (l_count_188 = 1; l_count_188 <= 20; l_count_188++) li_124 = li_124 + (iHigh(NULL, PERIOD_D1, l_count_188 + BackTest) - iLow(NULL, PERIOD_D1, l_count_188 + BackTest)) / Point;
   li_116 /= 5;
   li_120 /= 10;
   li_124 /= 20;
   li_128 = (li_112 + li_116 + li_120 + li_124) / 4;
   l_ilow_164 = iLow(NULL, PERIOD_D1, BackTest + 0);
   l_ihigh_172 = iHigh(NULL, PERIOD_D1, BackTest + 0);
   li_132 = li_128 - (Bid - l_ilow_164) / Point;
   li_136 = li_128 - (l_ihigh_172 - Bid) / Point;
   li_140 = li_132 / gd_104;
   ld_148 = Bid - li_140 * Point;
   li_144 = li_136 / gd_104;
   ld_156 = Bid + li_144 * Point;
   double ld_192 = 24 * BackTest;
   double ld_208 = Hour();
   if (ld_208 < 5.0 && BackTest < 1) {
      gi_128 = 0;
      ObjectDelete("Buy Label");
      ObjectDelete("Buy Line");
      ObjectDelete("BuyTP Label");
      ObjectDelete("BuyTP Line");
      ObjectDelete("Sell Label");
      ObjectDelete("Sell Line");
      ObjectDelete("SellTP Label");
      ObjectDelete("SellTP Line");
      ObjectDelete("P Label");
      ObjectDelete("P Line");
      ObjectDelete("Ex Label");
      ObjectDelete("Daily Extream Resistance ");
      ObjectDelete("Daily Extream Support ");
      ObjectDelete("F382Ul");
      ObjectDelete("F382Uline");
      ObjectDelete("F236Ul");
      ObjectDelete("F236Uline");
      ObjectDelete("F618Ul");
      ObjectDelete("F618Uline");
      ObjectDelete("F1618Ul");
      ObjectDelete("F1618Uline");
      ObjectDelete("F2618Ul");
      ObjectDelete("F2618Uline");
      ObjectDelete("F4236Ul");
      ObjectDelete("F4236Uline");
      ObjectDelete("F382Dl");
      ObjectDelete("F382Dline");
      ObjectDelete("F236Dl");
      ObjectDelete("F236Dline");
      ObjectDelete("F618Dl");
      ObjectDelete("F618Dline");
      ObjectDelete("F1618Dl");
      ObjectDelete("F1618Dline");
      ObjectDelete("F2618Dl");
      ObjectDelete("F2618Dline");
      ObjectDelete("F4236Dl");
      ObjectDelete("F4236Dline");
      ObjectDelete("s1");
      ObjectDelete("r1");
      ObjectsDeleteAll();
      Comment("...");
   }
   if (ld_208 < 5.0) ld_200 = 0;
   if (ld_208 == 5.0) ld_200 = 0;
   if (ld_208 == 6.0) ld_200 = 1;
   if (ld_208 == 7.0) ld_200 = 2;
   if (ld_208 == 8.0) ld_200 = 3;
   if (ld_208 == 9.0) ld_200 = 4;
   if (ld_208 == 10.0) ld_200 = 5;
   if (ld_208 == 11.0) ld_200 = 6;
   if (ld_208 == 12.0) ld_200 = 7;
   if (ld_208 == 13.0) ld_200 = 8;
   if (ld_208 == 14.0) ld_200 = 9;
   if (ld_208 == 15.0) ld_200 = 10;
   if (ld_208 == 16.0) ld_200 = 11;
   if (ld_208 == 17.0) ld_200 = 12;
   if (ld_208 == 18.0) ld_200 = 13;
   if (ld_208 == 19.0) ld_200 = 14;
   if (ld_208 == 20.0) ld_200 = 15;
   if (ld_208 == 21.0) ld_200 = 16;
   if (ld_208 == 22.0) ld_200 = 17;
   if (ld_208 == 23.0) ld_200 = 18;
   if (ld_208 == 24.0) ld_200 = 19;
   double ld_unused_216 = BackTest;
   double l_ihigh_224 = iHigh(NULL, PERIOD_H1, ld_200 + 1.0 + ld_192 + GMT);
   double l_ihigh_232 = iHigh(NULL, PERIOD_H1, ld_200 + 2.0 + ld_192 + GMT);
   double l_ihigh_240 = iHigh(NULL, PERIOD_H1, ld_200 + 3.0 + ld_192 + GMT);
   double l_ihigh_248 = iHigh(NULL, PERIOD_H1, ld_200 + 4.0 + ld_192 + GMT);
   double l_ihigh_256 = iHigh(NULL, PERIOD_H1, ld_200 + 5.0 + ld_192 + GMT);
   double l_iopen_264 = iOpen(NULL, PERIOD_H1, ld_200 + 1.0 + ld_192 + GMT);
   double l_iopen_272 = iOpen(NULL, PERIOD_H1, ld_200 + 2.0 + ld_192 + GMT);
   double l_iopen_280 = iOpen(NULL, PERIOD_H1, ld_200 + 3.0 + ld_192 + GMT);
   double l_iopen_288 = iOpen(NULL, PERIOD_H1, ld_200 + 4.0 + ld_192 + GMT);
   double l_iopen_296 = iOpen(NULL, PERIOD_H1, ld_200 + 5.0 + ld_192 + GMT);
   double l_ilow_304 = iLow(NULL, PERIOD_H1, ld_200 + 1.0 + ld_192 + GMT);
   double l_ilow_312 = iLow(NULL, PERIOD_H1, ld_200 + 2.0 + ld_192 + GMT);
   double l_ilow_320 = iLow(NULL, PERIOD_H1, ld_200 + 3.0 + ld_192 + GMT);
   double l_ilow_328 = iLow(NULL, PERIOD_H1, ld_200 + 4.0 + ld_192 + GMT);
   double l_ilow_336 = iLow(NULL, PERIOD_H1, ld_200 + 5.0 + ld_192 + GMT);
   double l_iclose_344 = iClose(NULL, PERIOD_H1, ld_200 + 1.0 + ld_192 + GMT);
   double l_iclose_352 = iClose(NULL, PERIOD_H1, ld_200 + 2.0 + ld_192 + GMT);
   double l_iclose_360 = iClose(NULL, PERIOD_H1, ld_200 + 3.0 + ld_192 + GMT);
   double l_iclose_368 = iClose(NULL, PERIOD_H1, ld_200 + 4.0 + ld_192 + GMT);
   double l_iclose_376 = iClose(NULL, PERIOD_H1, ld_200 + 5.0 + ld_192 + GMT);
   double ld_384 = MathMax(l_ihigh_224, l_ihigh_232);
   double ld_392 = MathMax(ld_384, l_ihigh_240);
   double ld_400 = MathMax(ld_392, l_ihigh_248);
   double ld_408 = MathMax(ld_400, l_ihigh_256);
   double ld_416 = MathMin(l_ilow_304, l_ilow_312);
   double ld_424 = MathMin(ld_384, l_ilow_320);
   double ld_432 = MathMin(ld_392, l_ilow_328);
   double ld_440 = MathMin(ld_400, l_ilow_336);
   double ld_448 = ld_408 - ld_440;
   double ld_456 = ld_408 - ld_448;
   double ld_464 = l_ihigh_224 + l_ihigh_232 + l_ihigh_240 + l_ihigh_248 + l_ihigh_256;
   double ld_472 = 0.2 * ld_464;
   double ld_480 = l_ilow_304 + l_ilow_312 + l_ilow_320 + l_ilow_328 + l_ilow_336;
   double ld_488 = 0.2 * ld_480;
   double ld_496 = l_iopen_264 + l_iopen_272 + l_iopen_280 + l_iopen_288 + l_iopen_296;
   double ld_504 = 0.2 * ld_496;
   double ld_512 = l_iclose_344 + l_iclose_352 + l_iclose_360 + l_iclose_368 + l_iclose_376;
   double ld_520 = 0.2 * ld_512;
   double ld_528 = ld_472 + ld_488 + ld_504 + ld_520;
   double ld_536 = ld_528 / 4.0;
   double ld_544 = ld_456 + ld_504;
   double ld_552 = ld_544 / 2.0;
   double ld_560 = ld_536 + ld_552;
   double ld_568 = ld_560 / 2.0;
   double ld_576 = ld_536 + ld_568;
   double ld_584 = ld_576 / 2.0;
   double ld_592 = ld_584;
   if (Symbol() == "USDJPY" || Symbol() == "CADJPY" || Symbol() == "GBPJPY" || Symbol() == "GBPJPYm" || Symbol() == "EURJPYm" || Symbol() == "EURJPY" || Symbol() == "NZDJPYm" ||
      Symbol() == "NZDJPY" || Symbol() == "SGDJPY" || Symbol() == "CHFJPY" || Symbol() == "AUDJPY" || Symbol() == "USDJPYm" || Symbol() == "CADJPYm" || Symbol() == "SGDJPYm" ||
      Symbol() == "CHFJPYm" || Symbol() == "AUDJPYm") ld_600 = 1;
   else ld_600 = 0;
   double l_ima_608 = iMA(NULL, PERIOD_D1, 240, 0, MODE_EMA, PRICE_HIGH, BackTest + 1);
   double l_ima_616 = iMA(NULL, PERIOD_D1, 240, 0, MODE_EMA, PRICE_OPEN, BackTest + 1);
   double l_ima_624 = iMA(NULL, PERIOD_D1, 240, 0, MODE_EMA, PRICE_CLOSE, BackTest + 1);
   double l_ima_632 = iMA(NULL, PERIOD_D1, 240, 0, MODE_EMA, PRICE_LOW, BackTest + 1);
   double ld_640 = MathRound(100.0 * (l_ima_608 - l_ima_632));
   double ld_648 = MathRound(100.0 * (l_ima_624 - l_ima_616));
   double ld_656 = ld_640;
   if (gi_100 == TRUE) ld_672 = (ld_640 + li_128) / 2.0 * gi_128;
   else ld_672 = li_128 * gi_128;
   if (ld_600 > 0.0) ld_664 = MathRound(100.0 * ld_656);
   else ld_664 = MathRound(10000.0 * ld_656);
   if (ld_600 > 0.0) {
      if (Symbol() == "GBPJPY" || Symbol() == "GBPJPYm") {
         gd_112 = 0.003;
         gd_120 = 0.0037;
      } else {
         if (Symbol() == "EURJPY" || Symbol() == "EURJPYm") {
            gd_112 = 0.003;
            gd_120 = 0.0033;
         } else {
            if (Symbol() == "USDJPY" || Symbol() == "USDJPYm") {
               gd_112 = 0.0023;
               gd_120 = 0.003;
            } else {
               if (Symbol() == "NZDJPY" || Symbol() == "NZDJPYm") {
                  gd_112 = 0.00382;
                  gd_120 = 0.005;
               } else {
                  if (Symbol() == "AUDJPY" || Symbol() == "AUDJPYm") {
                     gd_112 = 0.003;
                     gd_120 = 0.0037;
                  } else {
                     if (Symbol() == "SGDJPY" || Symbol() == "SGDJPYm") {
                        gd_112 = 0.003;
                        gd_120 = 0.0037;
                     } else {
                        if (Symbol() == "CHFJPY" || Symbol() == "CHFJPYm") {
                           gd_112 = 0.003;
                           gd_120 = 0.0037;
                        } else {
                           if (Symbol() == "CADJPY" || Symbol() == "CADJPYm") {
                              gd_112 = 0.003;
                              gd_120 = 0.0037;
                           }
                        }
                     }
                  }
               }
            }
         }
      }
      ld_680 = ld_672 * gd_112;
      ld_688 = 100.0 * (ld_592 + ld_680);
      ld_696 = MathRound(ld_688);
      ld_704 = ld_696 / 100.0;
      ld_712 = ld_672 * gd_120;
      ld_720 = 100.0 * (ld_704 + ld_712);
      ld_728 = MathRound(ld_720);
      l_price_736 = ld_728 / 100.0;
      ld_744 = 100.0 * (ld_592 - ld_680);
      ld_752 = MathRound(ld_744);
      l_price_760 = ld_752 / 100.0;
      ld_768 = 100.0 * (l_price_760 - ld_712);
      ld_776 = MathRound(ld_768);
      l_price_784 = ld_776 / 100.0;
      ld_792 = MathRound(100.0 * ld_592) / 100.0;
      ld_800 = 100.0 * (l_price_736 - ld_704);
      ld_808 = 100.0 * (ld_704 - ld_792);
   }
   if (ld_600 < 1.0) {
      if (Symbol() == "GBPUSD" || Symbol() == "GBPUSDm") {
         gd_112 = 0.0000382;
         gd_120 = 0.00005;
      } else {
         if (Symbol() == "EURGBP" || Symbol() == "EURGBPm") {
            gd_112 = 0.0000618;
            gd_120 = 0.0001;
         } else {
            if (Symbol() == "EURUSD" || Symbol() == "EURUSDm") {
               gd_112 = 0.00003;
               gd_120 = 0.0000618;
            } else {
               if (Symbol() == "USDCAD" || Symbol() == "USDCADm") {
                  gd_112 = 0.00004;
                  gd_120 = 0.00005;
               } else {
                  if (Symbol() == "NZDUSD" || Symbol() == "NZDUSDm") {
                     gd_112 = 0.0000382;
                     gd_120 = 0.00005;
                  } else {
                     if (Symbol() == "GBPCHF" || Symbol() == "GBPCHFm") {
                        gd_112 = 0.0000382;
                        gd_120 = 0.00005;
                     } else {
                        if (Symbol() == "EURCAD" || Symbol() == "EURCADm") {
                           gd_112 = 0.0000382;
                           gd_120 = 0.00005;
                        }
                     }
                  }
               }
            }
         }
      }
      ld_680 = ld_672 * gd_112;
      ld_688 = 10000.0 * (ld_592 + ld_680);
      ld_696 = MathRound(ld_688);
      ld_704 = ld_696 / 10000.0;
      ld_712 = ld_672 * gd_120;
      ld_720 = 10000.0 * (ld_704 + ld_712);
      ld_728 = MathRound(ld_720);
      l_price_736 = ld_728 / 10000.0;
      ld_744 = 10000.0 * (ld_592 - ld_680);
      ld_752 = MathRound(ld_744);
      l_price_760 = ld_752 / 10000.0;
      ld_768 = 10000.0 * (l_price_760 - ld_712);
      ld_776 = MathRound(ld_768);
      l_price_784 = ld_776 / 10000.0;
      ld_792 = MathRound(10000.0 * ld_592) / 10000.0;
      ld_800 = 10000.0 * (l_price_736 - ld_704);
      ld_808 = 10000.0 * (ld_704 - ld_792);
   }
   if (FiboExLines == TRUE) {
      ld_816 = 2.0 * ld_680;
      l_price_824 = 0.236 * ld_816 + l_price_760;
      l_price_832 = ld_816 / 2.0 + l_price_760;
      l_price_840 = 0.618 * ld_816 + l_price_760;
      l_price_848 = 0;
      l_price_856 = 2.618 * ld_816 + l_price_760;
      l_price_864 = 4.236 * ld_816 + l_price_760;
      l_price_872 = ld_704 - 0.236 * ld_816;
      l_price_880 = ld_704 - ld_816 / 2.0;
      l_price_888 = ld_704 - 0.618 * ld_816;
      l_price_896 = 0;
      l_price_904 = ld_704 - 2.618 * ld_816;
      l_price_912 = ld_704 - 4.236 * ld_816;
      if (ObjectFind("F236Ul") != 0) {
         ObjectCreate("F236Ul", OBJ_TEXT, 0, Time[10], l_price_824);
         ObjectSetText("F236Ul", "Fibo 23.6%", 9, "Arial", Gainsboro);
      } else ObjectMove("F236Ul", 0, Time[10], l_price_824);
      if (ObjectFind("F236Uline") != 0) {
         ObjectCreate("F236Uline", OBJ_HLINE, 0, Time[40], l_price_824);
         ObjectSet("F236Uline", OBJPROP_STYLE, STYLE_DOT);
         ObjectSet("F236Uline", OBJPROP_WIDTH, 1);
         ObjectSet("F236Uline", OBJPROP_COLOR, Gainsboro);
      } else ObjectMove("F236Uline", 0, Time[40], l_price_824);
      if (ObjectFind("F382Ul") != 0) {
         ObjectCreate("F382Ul", OBJ_TEXT, 0, Time[10], l_price_832);
         ObjectSetText("F382Ul", "Fibo 38.2%", 9, "Arial", Gainsboro);
      } else ObjectMove("F382Ul", 0, Time[10], l_price_832);
      if (ObjectFind("F382Uline") != 0) {
         ObjectCreate("F382Uline", OBJ_HLINE, 0, Time[40], l_price_832);
         ObjectSet("F382Uline", OBJPROP_STYLE, STYLE_DOT);
         ObjectSet("F382Uline", OBJPROP_WIDTH, 1);
         ObjectSet("F382Uline", OBJPROP_COLOR, Gainsboro);
      } else ObjectMove("F382Uline", 0, Time[40], l_price_832);
      if (ObjectFind("F618Ul") != 0) {
         ObjectCreate("F618Ul", OBJ_TEXT, 0, Time[10], l_price_840);
         ObjectSetText("F618Ul", "Fibo 61.8%", 9, "Arial", Gainsboro);
      } else ObjectMove("F618Ul", 0, Time[10], l_price_840);
      if (ObjectFind("F618Uline") != 0) {
         ObjectCreate("F618Uline", OBJ_HLINE, 0, Time[40], l_price_840);
         ObjectSet("F618Uline", OBJPROP_STYLE, STYLE_DOT);
         ObjectSet("F618Uline", OBJPROP_WIDTH, 1);
         ObjectSet("F618Uline", OBJPROP_COLOR, Gainsboro);
      } else ObjectMove("F618Uline", 0, Time[40], l_price_840);
      if (ObjectFind("F1618Ul") != 0) {
         ObjectCreate("F1618Ul", OBJ_TEXT, 0, Time[10], l_price_848);
         ObjectSetText("F1618Ul", "Fibo 161.8%", 9, "Arial", Gainsboro);
      } else ObjectMove("F1618Ul", 0, Time[10], l_price_848);
      if (ObjectFind("F1618Uline") != 0) {
         ObjectCreate("F1618Uline", OBJ_HLINE, 0, Time[40], l_price_848);
         ObjectSet("F1618Uline", OBJPROP_STYLE, STYLE_DOT);
         ObjectSet("F1618Uline", OBJPROP_WIDTH, 1);
         ObjectSet("F1618Uline", OBJPROP_COLOR, Gainsboro);
      } else ObjectMove("F1618Uline", 0, Time[40], l_price_848);
      if (ObjectFind("F2618Ul") != 0) {
         ObjectCreate("F2618Ul", OBJ_TEXT, 0, Time[10], l_price_856);
         ObjectSetText("F2618Ul", "Fibo 261.8%", 9, "Arial", Gainsboro);
      } else ObjectMove("F2618Ul", 0, Time[10], l_price_856);
      if (ObjectFind("F2618Uline") != 0) {
         ObjectCreate("F2618Uline", OBJ_HLINE, 0, Time[40], l_price_856);
         ObjectSet("F2618Uline", OBJPROP_STYLE, STYLE_DOT);
         ObjectSet("F2618Uline", OBJPROP_WIDTH, 1);
         ObjectSet("F2618Uline", OBJPROP_COLOR, Gainsboro);
      } else ObjectMove("F1618Uline", 0, Time[40], l_price_856);
      if (ObjectFind("F4236Ul") != 0) {
         ObjectCreate("F4236Ul", OBJ_TEXT, 0, Time[10], l_price_864);
         ObjectSetText("F4236Ul", "Fibo 423.6%", 9, "Arial", Gainsboro);
      } else ObjectMove("F4236Ul", 0, Time[10], l_price_864);
      if (ObjectFind("F4236Uline") != 0) {
         ObjectCreate("F4236Uline", OBJ_HLINE, 0, Time[40], l_price_864);
         ObjectSet("F4236Uline", OBJPROP_STYLE, STYLE_DOT);
         ObjectSet("F4236Uline", OBJPROP_WIDTH, 1);
         ObjectSet("F4236Uline", OBJPROP_COLOR, Gainsboro);
      } else ObjectMove("F4236Uline", 0, Time[40], l_price_864);
      if (ObjectFind("F236Dl") != 0) {
         ObjectCreate("F236Dl", OBJ_TEXT, 0, Time[10], l_price_872);
         ObjectSetText("F236Dl", "Fibo 23.6%", 9, "Arial", Gainsboro);
      } else ObjectMove("F236Dl", 0, Time[10], l_price_872);
      if (ObjectFind("F236Dline") != 0) {
         ObjectCreate("F236Dline", OBJ_HLINE, 0, Time[40], l_price_872);
         ObjectSet("F236Dline", OBJPROP_STYLE, STYLE_DOT);
         ObjectSet("F236Dline", OBJPROP_WIDTH, 1);
         ObjectSet("F236Dline", OBJPROP_COLOR, Gainsboro);
      } else ObjectMove("F236Dline", 0, Time[40], l_price_872);
      if (ObjectFind("F382Dl") != 0) {
         ObjectCreate("F382Dl", OBJ_TEXT, 0, Time[10], l_price_880);
         ObjectSetText("F382Dl", "Fibo 38.2%", 9, "Arial", Gainsboro);
      } else ObjectMove("F382Dl", 0, Time[10], l_price_880);
      if (ObjectFind("F382Dline") != 0) {
         ObjectCreate("F382Dline", OBJ_HLINE, 0, Time[40], l_price_880);
         ObjectSet("F382Dline", OBJPROP_STYLE, STYLE_DOT);
         ObjectSet("F382Dline", OBJPROP_WIDTH, 1);
         ObjectSet("F382Dline", OBJPROP_COLOR, Gainsboro);
      } else ObjectMove("F382Dline", 0, Time[40], l_price_880);
      if (ObjectFind("F618Dl") != 0) {
         ObjectCreate("F618Dl", OBJ_TEXT, 0, Time[10], l_price_888);
         ObjectSetText("F618Dl", "Fibo 61.8%", 9, "Arial", Gainsboro);
      } else ObjectMove("F618Dl", 0, Time[10], l_price_888);
      if (ObjectFind("F618Dline") != 0) {
         ObjectCreate("F618Dline", OBJ_HLINE, 0, Time[40], l_price_888);
         ObjectSet("F618Dline", OBJPROP_STYLE, STYLE_DOT);
         ObjectSet("F618Dline", OBJPROP_WIDTH, 1);
         ObjectSet("F618Dline", OBJPROP_COLOR, Gainsboro);
      } else ObjectMove("F618Dline", 0, Time[40], l_price_888);
      if (ObjectFind("F1618Dl") != 0) {
         ObjectCreate("F1618Dl", OBJ_TEXT, 0, Time[10], l_price_896);
         ObjectSetText("F1618Dl", "Fibo 161.8%", 9, "Arial", Gainsboro);
      } else ObjectMove("F1618Dl", 0, Time[10], l_price_896);
      if (ObjectFind("F1618Dline") != 0) {
         ObjectCreate("F1618Dline", OBJ_HLINE, 0, Time[40], l_price_896);
         ObjectSet("F1618Dline", OBJPROP_STYLE, STYLE_DOT);
         ObjectSet("F1618Dline", OBJPROP_WIDTH, 1);
         ObjectSet("F1618Dline", OBJPROP_COLOR, Gainsboro);
      } else ObjectMove("F1618Dline", 0, Time[40], l_price_896);
      if (ObjectFind("F2618Dl") != 0) {
         ObjectCreate("F2618Dl", OBJ_TEXT, 0, Time[10], l_price_904);
         ObjectSetText("F2618Dl", "Fibo 261.8%", 9, "Arial", Gainsboro);
      } else ObjectMove("F2618Dl", 0, Time[10], l_price_904);
      if (ObjectFind("F2618Dline") != 0) {
         ObjectCreate("F2618Dline", OBJ_HLINE, 0, Time[40], l_price_904);
         ObjectSet("F2618Dline", OBJPROP_STYLE, STYLE_DOT);
         ObjectSet("F2618Dline", OBJPROP_WIDTH, 1);
         ObjectSet("F2618Dline", OBJPROP_COLOR, Gainsboro);
      } else ObjectMove("F2618Dline", 0, Time[40], l_price_904);
      if (ObjectFind("F4236Dl") != 0) {
         ObjectCreate("F4236Dl", OBJ_TEXT, 0, Time[10], l_price_912);
         ObjectSetText("F4236Dl", "Fibo 423.6%", 9, "Arial", Gainsboro);
      } else ObjectMove("F4236Dl", 0, Time[10], l_price_912);
      if (ObjectFind("F4236Dline") != 0) {
         ObjectCreate("F4236Dline", OBJ_HLINE, 0, Time[40], l_price_912);
         ObjectSet("F4236Dline", OBJPROP_STYLE, STYLE_DOT);
         ObjectSet("F4236Dline", OBJPROP_WIDTH, 1);
         ObjectSet("F4236Dline", OBJPROP_COLOR, Gainsboro);
      } else ObjectMove("F4236Dline", 0, Time[40], l_price_912);
   }
   g_price_136 = ld_792;
   g_price_152 = ld_704;
   if (ObjectFind("P label") != 0) {
      ObjectCreate("P label", OBJ_TEXT, 0, Time[0], g_price_136);
      ObjectSetText("P label", "Stoploss", 10, "Arial", Red);
   } else ObjectMove("P label", 0, Time[0], g_price_136);
   if (ObjectFind("P line") != 0) {
      ObjectCreate("P line", OBJ_HLINE, 0, Time[40], g_price_136);
      ObjectSet("P line", OBJPROP_STYLE, STYLE_DASH);
      ObjectSet("P line", OBJPROP_WIDTH, 0);
      ObjectSet("P line", OBJPROP_COLOR, Red);
   } else ObjectMove("P line", 0, Time[40], g_price_136);
   if (ObjectFind("Buy label") != 0) {
      ObjectCreate("Buy label", OBJ_TEXT, 0, Time[10], g_price_152);
      ObjectSetText("Buy label", "Buy Level", 9, "Arial", Blue);
   } else ObjectMove("Buy label", 0, Time[10], g_price_152);
   if (ObjectFind("Buy line") != 0) {
      ObjectCreate("Buy line", OBJ_HLINE, 0, Time[40], g_price_152);
      ObjectSet("Buy line", OBJPROP_STYLE, STYLE_SOLID);
      ObjectSet("Buy line", OBJPROP_WIDTH, 1);
      ObjectSet("Buy line", OBJPROP_COLOR, Blue);
   } else ObjectMove("Buy line", 0, Time[40], g_price_152);
   if (ObjectFind("BuyTP label") != 0) {
      ObjectCreate("BuyTP label", OBJ_TEXT, 0, Time[10], l_price_736);
      ObjectSetText("BuyTP label", "Buy Take Profit", 9, "Arial", Green);
   } else ObjectMove("BuyTP label", 0, Time[10], l_price_736);
   if (ObjectFind("BuyTP line") != 0) {
      ObjectCreate("BuyTP line", OBJ_HLINE, 0, Time[40], l_price_736);
      ObjectSet("BuyTP line", OBJPROP_STYLE, STYLE_SOLID);
      ObjectSet("BuyTP line", OBJPROP_WIDTH, 1);
      ObjectSet("BuyTP line", OBJPROP_COLOR, Green);
   } else ObjectMove("BuyTP line", 0, Time[40], l_price_736);
   if (ObjectFind("Sell label") != 0) {
      ObjectCreate("Sell label", OBJ_TEXT, 0, Time[10], l_price_760);
      ObjectSetText("Sell label", "Sell Level", 9, "Arial", Blue);
   } else ObjectMove("Sell label", 0, Time[10], l_price_760);
   if (ObjectFind("Sell line") != 0) {
      ObjectCreate("Sell line", OBJ_HLINE, 0, Time[40], l_price_760);
      ObjectSet("Sell line", OBJPROP_STYLE, STYLE_SOLID);
      ObjectSet("Sell line", OBJPROP_WIDTH, 1);
      ObjectSet("Sell line", OBJPROP_COLOR, Blue);
   } else ObjectMove("Sell line", 0, Time[40], l_price_760);
   if (ObjectFind("SellTP label") != 0) {
      ObjectCreate("SellTP label", OBJ_TEXT, 0, Time[10], l_price_784);
      ObjectSetText("SellTP label", "Sell Take Profit", 9, "Arial", Green);
   } else ObjectMove("SellTP label", 0, Time[10], l_price_784);
   if (ObjectFind("SellTP line") != 0) {
      ObjectCreate("SellTP line", OBJ_HLINE, 0, Time[40], l_price_784);
      ObjectSet("SellTP line", OBJPROP_STYLE, STYLE_SOLID);
      ObjectSet("SellTP line", OBJPROP_WIDTH, 1);
      ObjectSet("SellTP line", OBJPROP_COLOR, Green);
   } else ObjectMove("SellTP line", 0, Time[40], l_price_784);
   double l_price_920 = (l_price_736 - ld_704) / 2.0 + ld_704;
   double l_price_928 = l_price_760 - (l_price_760 - l_price_784) / 2.0;
   if (ObjectFind("STP60") != 0) {
      ObjectCreate("STP60", OBJ_TEXT, 0, Time[10], l_price_928);
      ObjectSetText("STP60", "TP1", 7, "Arial", DarkGreen);
   } else ObjectMove("STP60", 0, Time[10], l_price_928);
   if (ObjectFind("STP60 line") != 0) {
      ObjectCreate("STP60 line", OBJ_HLINE, 0, Time[40], l_price_928);
      ObjectSet("STP60 line", OBJPROP_STYLE, STYLE_DOT);
      ObjectSet("STP60 line", OBJPROP_WIDTH, 1);
      ObjectSet("STP60 line", OBJPROP_COLOR, DarkGreen);
   } else ObjectMove("STP60 line", 0, Time[40], l_price_928);
   if (ObjectFind("BTP60") != 0) {
      ObjectCreate("BTP60", OBJ_TEXT, 0, Time[10], l_price_920);
      ObjectSetText("BTP60", "TP1", 7, "Arial", DarkGreen);
   } else ObjectMove("BTP60", 0, Time[10], l_price_920);
   if (ObjectFind("BTP60 line") != 0) {
      ObjectCreate("BTP60 line", OBJ_HLINE, 0, Time[40], l_price_920);
      ObjectSet("BTP60 line", OBJPROP_STYLE, STYLE_DOT);
      ObjectSet("BTP60 line", OBJPROP_WIDTH, 1);
      ObjectSet("BTP60 line", OBJPROP_COLOR, DarkGreen);
   } else ObjectMove("BTP60 line", 0, Time[40], l_price_920);
   double l_imomentum_936 = iMomentum(NULL, PERIOD_W1, 14, PRICE_WEIGHTED, 0);
   double l_imomentum_944 = iMomentum(NULL, PERIOD_D1, 14, PRICE_WEIGHTED, 0);
   double l_imomentum_952 = iMomentum(NULL, PERIOD_H4, 14, PRICE_WEIGHTED, 0);
   double l_imomentum_960 = iMomentum(NULL, PERIOD_H1, 14, PRICE_WEIGHTED, 0);
   double ld_968 = 0.2 * (l_imomentum_936 + l_imomentum_944 + l_imomentum_952 + l_imomentum_952 + l_imomentum_960);
   if (ld_968 > 101.0) ls_976 = "Strong Up Trend";
   if (ld_968 < 99.0) ls_976 = "Strong Down Trend";
   if (ld_968 > 99.0 && ld_968 < 101.0) ls_976 = "sideway";
   if (Alerts == 1 && (Ask > ld_704 - 0.1 && Ask < ld_704 + 0.1) || (Bid > l_price_760 - 0.1 && Bid < l_price_760 + 0.1)) Alert("Alert Incoming Signal Soon ", Symbol(), "-", Period());
   string ls_984 = "";
   if (BackTest > 0) {
      ls_984 = "You are in Back testing mode!! " 
         + "\n" 
      + BackTest + " day(s) back!! ";
   } else ls_984 = "You are in Live mode";
   string ls_992 = "";
   if (perceptron() > 1.0) ls_992 = "Strong Up Trend";
   if (perceptron() < -1.0) ls_992 = "Strong DownTrend";
   if (perceptron() > -1.0 && perceptron() < 1.0) ls_992 = "Sideway movement";
   string ls_1000 = "";
   if (perceptronD() > 1.0) ls_1000 = "Strong Up Trend";
   if (perceptronD() < -1.0) ls_1000 = "Strong DownTrend";
   if (perceptronD() > -1.0 && perceptronD() < 1.0) ls_1000 = "Sideway movement";
   string ls_unused_1016 = "";
   if (ld_600 > 0.0) ld_1008 = MathRound(ld_664 / ld_672);
   else ld_1008 = MathRound(ld_664 / ld_672);
   double ld_1024 = 4.0 * (ld_1008 - 87.0);
   if (ld_1024 > 0.0) ls_unused_1016 = "Safe Market";
   else ls_unused_1016 = "Dangrous Market";
   double ld_1032 = Year();
   double ld_1040 = Month();
   double ld_1048 = 13101987;
   int li_unused_1056 = 112332;
   int l_acc_number_1060 = AccountNumber();
   if ((ld_1032 == 2088.0 && ld_1040 == 3.0) || (ld_1032 == 2088.0 && ld_1040 > 3.0) || ld_1032 > 2088.0 || ld_1048 != gd_76) {
      ld_672 = 0;
      ld_1008 = 0;
      ls_180 = 0;
      ld_704 = 0;
      l_price_760 = 0;
      l_price_736 = 0;
      l_price_784 = 0;
      ld_792 = 0;
      ld_592 = 0;
      gi_128 = 0;
      li_128 = 0;
      gi_128 = 0;
      ls_180 = "";
      Alert("Expired Expired Expired Expired Expired Expired  ", Symbol(), "-", Period());
      ObjectDelete("Buy Label");
      ObjectDelete("Buy Line");
      ObjectDelete("BuyTP Label");
      ObjectDelete("BuyTP Line");
      ObjectDelete("Sell Label");
      ObjectDelete("Sell Line");
      ObjectDelete("SellTP Label");
      ObjectDelete("SellTP Line");
      ObjectDelete("P Label");
      ObjectDelete("P Line");
      ObjectDelete("Ex Label");
      ObjectDelete("Daily Extream Resistance ");
      ObjectDelete("Daily Extream Support ");
      ObjectDelete("F382Ul");
      ObjectDelete("F382Uline");
      ObjectDelete("F236Ul");
      ObjectDelete("F236Uline");
      ObjectDelete("F618Ul");
      ObjectDelete("F618Uline");
      ObjectDelete("F1618Ul");
      ObjectDelete("F1618Uline");
      ObjectDelete("F2618Ul");
      ObjectDelete("F2618Uline");
      ObjectDelete("F4236Ul");
      ObjectDelete("F4236Uline");
      ObjectDelete("F382Dl");
      ObjectDelete("F382Dline");
      ObjectDelete("F236Dl");
      ObjectDelete("F236Dline");
      ObjectDelete("F618Dl");
      ObjectDelete("F618Dline");
      ObjectDelete("F1618Dl");
      ObjectDelete("F1618Dline");
      ObjectDelete("F2618Dl");
      ObjectDelete("F2618Dline");
      ObjectDelete("F4236Dl");
      ObjectDelete("F4236Dline");
      ObjectDelete("s1");
      ObjectDelete("r1");
      ObjectsDeleteAll();
      Comment("...");
      Alert("Expired  ", Symbol(), "-", Period());
      if (ObjectFind("Ex label") != 0) {
         ObjectCreate("Ex label", OBJ_TEXT, 0, Time[10], g_price_152);
         ObjectSetText("Ex label", "Expired", 130, "Arial", Red);
      } else ObjectMove("Ex label", 0, Time[10], g_price_152);
   }
   string ls_unused_1064 = "";
   string ls_unused_1072 = "";
   string ls_unused_1080 = "";
   string ls_unused_1088 = "";
   string ls_unused_1096 = "";
   string ls_1104 = "(Version 5.9)";
   string ls_1112 = TimeToStr(TimeCurrent(), TIME_DATE);
   ls_180 = "::::::" + ls_1112 + "::::::" 
      + "\n" 
      + "::::::::::::::::::::::::::::  " 
      + "\n" 
      + "Buy Point: " + ld_704 
      + "\n" 
      + "Take Profit: " + l_price_736 
      + "\n" 
      + "Stop Loss: " + ld_792 
      + "\n" 
      + ":::::::::::::::::::::::::::: " 
      + "\n" 
      + "Take Profit Value: " + ld_800 
      + "\n" 
      + "Stop Loss Value: " + ld_808 
      + "\n" 
      + ":::::::::::::::::::::::::::: " 
      + "\n" 
      + "Sell Point: " + l_price_760 
      + "\n" 
      + "TakeProfit: " + l_price_784 
      + "\n" 
      + "StopLoss: " + ld_792 
      + "\n" 
      + ":::::::::::::::::::::::::::: " 
      + "\n" 
      + "General Momentum: " + ls_976 
      + "\n" 
      + "General Trend(hourly): " + ls_992 
      + "\n" 
      + "General Trend(Daily): " + ls_1000 
      + "\n" 
      + ls_984 
      + "\n" 
      + ":::::::::::::::::::::::::::: " 
      + "\n" 
      + "Programmed By Dr.GM (AKA : Dr.Mahmoud Adel) " 
      + "\n" 
      + "[email protected] " 
      + "\n" 
      + "+971508103820//+20111023421 " 
      + "\n" 
      + "Expire on 2008/Feb " + ls_1104 
      + "\n" 
      + "Account number : " + l_acc_number_1060 
      + "\n" 
      + "::::::::::::::::::::::::::::: " 
   + "\n";
   Comment(ls_180);
   return (0);
}

void drawLabel(string a_name_0, double a_price_8, color a_color_16) {
   if (ObjectFind(a_name_0) != 0) {
      ObjectCreate(a_name_0, OBJ_TEXT, 0, Time[10], a_price_8);
      ObjectSetText(a_name_0, a_name_0, 8, "Arial", CLR_NONE);
      ObjectSet(a_name_0, OBJPROP_COLOR, a_color_16);
      return;
   }
   ObjectMove(a_name_0, 0, Time[10], a_price_8);
}

void drawLine(double a_price_0, string a_name_8, color a_color_16, int ai_20) {
   if (ObjectFind(a_name_8) != 0) {
      ObjectCreate(a_name_8, OBJ_HLINE, 0, Time[0], a_price_0, Time[0], a_price_0);
      if (ai_20 == 1) ObjectSet(a_name_8, OBJPROP_STYLE, STYLE_SOLID);
      else ObjectSet(a_name_8, OBJPROP_STYLE, STYLE_DOT);
      ObjectSet(a_name_8, OBJPROP_COLOR, a_color_16);
      ObjectSet(a_name_8, OBJPROP_WIDTH, 1);
      return;
   }
   ObjectDelete(a_name_8);
   ObjectCreate(a_name_8, OBJ_HLINE, 0, Time[0], a_price_0, Time[0], a_price_0);
   if (ai_20 == 1) ObjectSet(a_name_8, OBJPROP_STYLE, STYLE_SOLID);
   else ObjectSet(a_name_8, OBJPROP_STYLE, STYLE_DOT);
   ObjectSet(a_name_8, OBJPROP_COLOR, a_color_16);
   ObjectSet(a_name_8, OBJPROP_WIDTH, 1);
}

double perceptron() {
   int li_0 = 156;
   int li_4 = 184;
   int li_8 = -4;
   int li_12 = 64;
   double ld_16 = li_0 - 100;
   double ld_24 = li_4 - 100;
   double ld_32 = li_8 - 100;
   double ld_40 = li_12 - 100;
   double l_iac_48 = iAC(Symbol(), PERIOD_H1, 0);
   double l_iac_56 = iAC(Symbol(), PERIOD_H1, 7);
   double l_iac_64 = iAC(Symbol(), PERIOD_H1, 14);
   double l_iac_72 = iAC(Symbol(), PERIOD_H1, 21);
   return (ld_16 * l_iac_48 + ld_24 * l_iac_56 + ld_32 * l_iac_64 + ld_40 * l_iac_72);
}

double perceptronD() {
   int li_0 = 156;
   int li_4 = 184;
   int li_8 = -4;
   int li_12 = 64;
   double ld_16 = li_0 - 100;
   double ld_24 = li_4 - 100;
   double ld_32 = li_8 - 100;
   double ld_40 = li_12 - 100;
   double l_iac_48 = iAC(Symbol(), PERIOD_D1, 0);
   double l_iac_56 = iAC(Symbol(), PERIOD_D1, 5);
   double l_iac_64 = iAC(Symbol(), PERIOD_D1, 10);
   double l_iac_72 = iAC(Symbol(), PERIOD_D1, 15);
   return (ld_16 * l_iac_48 + ld_24 * l_iac_56 + ld_32 * l_iac_64 + ld_40 * l_iac_72);
}

Recommend