Navigation:Home > Content >

Murrey_Method_lines__LabelLevels.mq4

Time: 2010-02-11 | Download file:Murrey_Method_lines__LabelLevels.mq4

/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link      " Modified by cja "

#property indicator_chart_window

extern int P = 64;
extern int StepBack = 0;
extern bool Comments = FALSE;
double gd_88 = 0.0;
double gd_unused_96 = 0.0;
double gd_104 = 0.0;
double gd_112 = 0.0;
double gd_120 = 0.0;
double gd_128 = 0.0;
double gd_136 = 0.0;
double gd_144 = 0.0;
double gd_152 = 0.0;
double gd_160 = 0.0;
double gd_168 = 0.0;
double gd_176 = 0.0;
double gd_184 = 0.0;
double gd_192 = 0.0;
double gd_200 = 0.0;
double gd_208 = 0.0;
double gd_216 = 0.0;
double gd_224 = 0.0;
double gd_232 = 0.0;
double gd_240 = 0.0;
double gd_248 = 0.0;
double gd_256 = 0.0;
double gd_264 = 0.0;
double gd_272 = 0.0;
double gda_280[13];
string gsa_284[13];
string g_name_288 = "";
int g_lowest_296 = 0;
int g_highest_300 = 0;
int gi_304 = 13;
int gi_unused_308 = 8;
int gia_312[13];
int g_price_316 = 3;
int gi_320 = 0;
int g_timeframe_324 = 0;
int gi_unused_328 = 0;
int g_index_332 = 0;

int init() {
   gsa_284[0] = "                          [-2/8]Extreme Overshoot";
   gsa_284[1] = "             [-1/8]Overshoot";
   gsa_284[2] = "                     [0/8]Ultimate Support";
   gsa_284[3] = "                           [1/8]Weak Stall & Reverse";
   gsa_284[4] = "                    [2/8]Reversal - Major";
   gsa_284[5] = "                               [3/8]Bottom - Trading Range";
   gsa_284[6] = "                                  [4/8]Major Support/Resistance";
   gsa_284[7] = "                       [5/8]Top Trading Range";
   gsa_284[8] = "                 [6/8]Reversal Major";
   gsa_284[9] = "                           [7/8]Weak Stall & Reverse";
   gsa_284[10] = "                         [8/8]Ulitimate Resistance";
   gsa_284[11] = "             [+1/8]Overshoot";
   gsa_284[12] = "                          [+2/8]Extreme Overshoot";
   g_price_316 = 35;
   gi_unused_308 = 3;
   gia_312[0] = 11829830;
   gia_312[1] = 8721863;
   gia_312[2] = 8421376;
   gia_312[3] = 2139610;
   gia_312[4] = 3937500;
   gia_312[5] = 32768;
   gia_312[6] = 16711680;
   gia_312[7] = 32768;
   gia_312[8] = 3937500;
   gia_312[9] = 2139610;
   gia_312[10] = 8421376;
   gia_312[11] = 8721863;
   gia_312[12] = 11829830;
   return (0);
}

int deinit() {
   Comment(" ");
   for (g_index_332 = 0; g_index_332 < gi_304; g_index_332++) {
      g_name_288 = "mml" + g_index_332;
      ObjectDelete(g_name_288);
      g_name_288 = "mml_txt" + g_index_332;
      ObjectDelete(g_name_288);
   }
   return (0);
}

int start() {
   if (gi_320 != Time[0] || g_timeframe_324 != Period()) {
      g_lowest_296 = iLowest(NULL, 0, MODE_LOW, P + StepBack, 0);
      g_highest_300 = iHighest(NULL, 0, MODE_HIGH, P + StepBack, 0);
      gd_112 = Low[g_lowest_296];
      gd_120 = High[g_highest_300];
      Comment("\n", "MURREYMATH ", 
         "\n", "HighClose = ", gd_120, 
         "\n", "LowClose = ", gd_112, 
      "\n");
      if (gd_120 <= 250000.0 && gd_120 > 25000.0) gd_248 = 100000;
      else {
         if (gd_120 <= 25000.0 && gd_120 > 2500.0) gd_248 = 10000;
         else {
            if (gd_120 <= 2500.0 && gd_120 > 250.0) gd_248 = 1000;
            else {
               if (gd_120 <= 250.0 && gd_120 > 25.0) gd_248 = 100;
               else {
                  if (gd_120 <= 25.0 && gd_120 > 12.5) gd_248 = 12.5;
                  else {
                     if (gd_120 <= 12.5 && gd_120 > 6.25) gd_248 = 12.5;
                     else {
                        if (gd_120 <= 6.25 && gd_120 > 3.125) gd_248 = 6.25;
                        else {
                           if (gd_120 <= 3.125 && gd_120 > 1.5625) gd_248 = 3.125;
                           else {
                              if (gd_120 <= 1.5625 && gd_120 > 0.390625) gd_248 = 1.5625;
                              else
                                 if (gd_120 <= 0.390625 && gd_120 > 0.0) gd_248 = 0.1953125;
                           }
                        }
                     }
                  }
               }
            }
         }
      }
      gd_256 = gd_120 - gd_112;
      gd_104 = MathFloor(MathLog(gd_248 / gd_256) / MathLog(2));
      gd_240 = gd_248 * MathPow(0.5, gd_104);
      gd_128 = MathFloor(gd_112 / gd_240) * gd_240;
      if (gd_128 + gd_240 > gd_120) gd_136 = gd_128 + gd_240;
      else gd_136 = gd_128 + 2.0 * gd_240;
      if (gd_112 >= 3.0 * (gd_136 - gd_128) / 16.0 + gd_128 && gd_120 <= 9.0 * (gd_136 - gd_128) / 16.0 + gd_128) gd_152 = gd_128 + (gd_136 - gd_128) / 2.0;
      else gd_152 = 0;
      if (gd_112 >= gd_128 - (gd_136 - gd_128) / 8.0 && gd_120 <= 5.0 * (gd_136 - gd_128) / 8.0 + gd_128 && gd_152 == 0.0) gd_144 = gd_128 + (gd_136 - gd_128) / 2.0;
      else gd_144 = 0;
      if (gd_112 >= gd_128 + 7.0 * (gd_136 - gd_128) / 16.0 && gd_120 <= 13.0 * (gd_136 - gd_128) / 16.0 + gd_128) gd_168 = gd_128 + 3.0 * (gd_136 - gd_128) / 4.0;
      else gd_168 = 0;
      if (gd_112 >= gd_128 + 3.0 * (gd_136 - gd_128) / 8.0 && gd_120 <= 9.0 * (gd_136 - gd_128) / 8.0 + gd_128 && gd_168 == 0.0) gd_176 = gd_136;
      else gd_176 = 0;
      if (gd_112 >= gd_128 + (gd_136 - gd_128) / 8.0 && gd_120 <= 7.0 * (gd_136 - gd_128) / 8.0 + gd_128 && gd_144 == 0.0 && gd_152 == 0.0 && gd_168 == 0.0 && gd_176 == 0.0) gd_160 = gd_128 + 3.0 * (gd_136 - gd_128) / 4.0;
      else gd_160 = 0;
      if (gd_144 + gd_152 + gd_160 + gd_168 + gd_176 == 0.0) gd_184 = gd_136;
      else gd_184 = 0;
      gd_264 = gd_144 + gd_152 + gd_160 + gd_168 + gd_176 + gd_184;
      if (gd_144 > 0.0) gd_192 = gd_128;
      else gd_192 = 0;
      if (gd_152 > 0.0) gd_200 = gd_128 + (gd_136 - gd_128) / 4.0;
      else gd_200 = 0;
      if (gd_160 > 0.0) gd_208 = gd_128 + (gd_136 - gd_128) / 4.0;
      else gd_208 = 0;
      if (gd_168 > 0.0) gd_216 = gd_128 + (gd_136 - gd_128) / 2.0;
      else gd_216 = 0;
      if (gd_176 > 0.0) gd_224 = gd_128 + (gd_136 - gd_128) / 2.0;
      else gd_224 = 0;
      if (gd_264 > 0.0 && gd_192 + gd_200 + gd_208 + gd_216 + gd_224 == 0.0) gd_232 = gd_128;
      else gd_232 = 0;
      gd_272 = gd_192 + gd_200 + gd_208 + gd_216 + gd_224 + gd_232;
      for (g_index_332 = 0; g_index_332 < gi_304; g_index_332++) gda_280[g_index_332] = 0;
      gd_88 = (gd_264 - gd_272) / 8.0;
      gda_280[0] = gd_272 - 2.0 * gd_88;
      for (g_index_332 = 1; g_index_332 < gi_304; g_index_332++) gda_280[g_index_332] = gda_280[g_index_332 - 1] + gd_88;
      for (g_index_332 = 0; g_index_332 < gi_304; g_index_332++) {
         g_name_288 = "mml" + g_index_332;
         if (ObjectFind(g_name_288) == -1) {
            ObjectCreate(g_name_288, OBJ_HLINE, 0, Time[0], gda_280[g_index_332]);
            ObjectSet(g_name_288, OBJPROP_STYLE, STYLE_SOLID);
            ObjectSet(g_name_288, OBJPROP_COLOR, gia_312[g_index_332]);
            ObjectMove(g_name_288, 0, Time[0], gda_280[g_index_332]);
         } else ObjectMove(g_name_288, 0, Time[0], gda_280[g_index_332]);
         g_name_288 = "mml_txt" + g_index_332;
         if (ObjectFind(g_name_288) == -1) {
            ObjectCreate(g_name_288, OBJ_TEXT, 0, Time[g_price_316], g_price_316);
            ObjectSetText(g_name_288, gsa_284[g_index_332], 9, "Verdana", gia_312[g_index_332]);
            ObjectMove(g_name_288, 0, Time[g_price_316], gda_280[g_index_332]);
         } else ObjectMove(g_name_288, 0, Time[g_price_316], gda_280[g_index_332]);
      }
      gi_320 = Time[0];
      g_timeframe_324 = Period();
   }
   return (0);
}

Recommend