TRUE Forex

Просмотр кода форекс индикатора !Mur_VM-2.01.mq4

/*
   G e n e r a t e d  by ex4-to-mq4 decompiler FREEWARE 4.0.509.5
   Website: Ht t P:/ /WWW .meTa q Uo t ES. neT
   E-mail :  S uPPO R t @ mETa q U o te s .n et
*/
#property copyright "Copyright © 2009,  Silen, v 2.01"
#property link      "http://fx-vladmih.ru"

#property indicator_chart_window
#property indicator_buffers 7
#property indicator_color1 Black
#property indicator_color2 Black
#property indicator_color3 Black
#property indicator_color4 Black
#property indicator_color5 Black
#property indicator_color6 Black
#property indicator_color7 Black

extern int Длина_Истории_в_барах = 5000;
extern bool Рисовать_ДопЛинии_7п = FALSE;
extern bool Рисовать_как_Фон = FALSE;
extern bool Округлять_до_4х = TRUE;
extern color Цвет_доп_линий = OliveDrab;
extern color Цвет_линий_08 = Yellow;
extern color Цвет_линий_26 = Red;
extern color Цвет_линий_4T08 = Blue;
extern color Цвет_линий_ост = DarkGreen;
extern int Ширина_линий_048 = 2;
extern int Ширина_линий_26 = 1;
int Gi_120 = 8;
int Gi_124 = 64;
int Gi_128 = 13;
int Gi_132 = 158;
double G_ibuf_136[];
double G_ibuf_140[];
double G_ibuf_144[];
double G_ibuf_148[];
double G_ibuf_152[];
double G_ibuf_156[];
double G_ibuf_160[];
double Gda_164[13];
int G_digits_176;
double Gd_180;
int Gia_188[6] = {1, 5, 15, 30, 60, 240};
int G_bars_192 = 0;
int G_count_196;
int G_count_200;
int G_datetime_204;
bool Gi_208;
double Gd_212;
double Gd_220;
int Gi_unused_228 = 0;
int Gia_232[13][2];
string Gsa_236[13];

int init() {
   G_digits_176 = MarketInfo(Symbol(), MODE_DIGITS);
   Gd_180 = MathPow(10, G_digits_176 - 4);
   G_bars_192 = MathMax(Bars - Длина_Истории_в_барах, Gi_124 + 2);
   G_count_196 = 0;
   G_count_200 = 0;
   Gi_208 = TRUE;
   G_datetime_204 = iTime(NULL, 0, Bars - G_bars_192);
   if (G_digits_176 != 4) Gi_120 = Gi_120 * Gd_180;
   if (Ask > 3.0) Рисовать_ДопЛинии_7п = FALSE;
   Delete_All_Objects();
   Gia_232[0][0] = Цвет_линий_ост;
   Gia_232[1][0] = Цвет_линий_ост;
   Gia_232[2][0] = Цвет_линий_08;
   Gia_232[3][0] = Цвет_линий_ост;
   Gia_232[4][0] = Цвет_линий_26;
   Gia_232[5][0] = Цвет_линий_ост;
   Gia_232[6][0] = Цвет_линий_4T08;
   Gia_232[7][0] = Цвет_линий_ост;
   Gia_232[8][0] = Цвет_линий_26;
   Gia_232[9][0] = Цвет_линий_ост;
   Gia_232[10][0] = Цвет_линий_08;
   Gia_232[11][0] = Цвет_линий_ост;
   Gia_232[12][0] = Цвет_линий_ост;
   Gia_232[0][1] = Цвет_линий_ост;
   Gia_232[1][1] = Цвет_линий_ост;
   Gia_232[2][1] = Цвет_линий_4T08;
   Gia_232[3][1] = Цвет_линий_ост;
   Gia_232[4][1] = Цвет_линий_26;
   Gia_232[5][1] = Цвет_линий_ост;
   Gia_232[6][1] = Цвет_линий_4T08;
   Gia_232[7][1] = Цвет_линий_ост;
   Gia_232[8][1] = Цвет_линий_26;
   Gia_232[9][1] = Цвет_линий_ост;
   Gia_232[10][1] = Цвет_линий_4T08;
   Gia_232[11][1] = Цвет_линий_ост;
   Gia_232[12][1] = Цвет_линий_ост;
   SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID, 1, Gia_232[0][0]);
   SetIndexBuffer(0, G_ibuf_136);
   SetIndexArrow(0, Gi_132);
   SetIndexDrawBegin(0, Gi_124 + 1);
   SetIndexEmptyValue(0, 0.0);
   SetIndexLabel(0, "-2 ");
   SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID, Ширина_линий_048, Gia_232[2][0]);
   SetIndexBuffer(1, G_ibuf_140);
   SetIndexArrow(1, Gi_132);
   SetIndexDrawBegin(1, Gi_124 + 1);
   SetIndexEmptyValue(1, 0.0);
   SetIndexLabel(1, "0 ");
   SetIndexStyle(2, DRAW_ARROW, STYLE_SOLID, Ширина_линий_26, Gia_232[4][0]);
   SetIndexBuffer(2, G_ibuf_144);
   SetIndexArrow(2, Gi_132);
   SetIndexDrawBegin(2, Gi_124 + 1);
   SetIndexEmptyValue(2, 0.0);
   SetIndexLabel(2, "2 ");
   SetIndexStyle(3, DRAW_ARROW, STYLE_SOLID, Ширина_линий_048, Gia_232[6][0]);
   SetIndexBuffer(3, G_ibuf_148);
   SetIndexArrow(3, Gi_132);
   SetIndexDrawBegin(3, Gi_124 + 1);
   SetIndexEmptyValue(3, 0.0);
   SetIndexLabel(3, "4 ");
   SetIndexStyle(4, DRAW_ARROW, STYLE_SOLID, Ширина_линий_26, Gia_232[8][0]);
   SetIndexBuffer(4, G_ibuf_152);
   SetIndexArrow(4, Gi_132);
   SetIndexDrawBegin(4, Gi_124 + 1);
   SetIndexEmptyValue(4, 0.0);
   SetIndexLabel(4, "6 ");
   SetIndexStyle(5, DRAW_ARROW, STYLE_SOLID, Ширина_линий_048, Gia_232[10][0]);
   SetIndexBuffer(5, G_ibuf_156);
   SetIndexArrow(5, Gi_132);
   SetIndexDrawBegin(5, Gi_124 + 1);
   SetIndexEmptyValue(5, 0.0);
   SetIndexLabel(5, "8 ");
   SetIndexStyle(6, DRAW_ARROW, STYLE_SOLID, 1, Gia_232[12][0]);
   SetIndexBuffer(6, G_ibuf_160);
   SetIndexArrow(6, Gi_132);
   SetIndexDrawBegin(6, Gi_124 + 1);
   SetIndexEmptyValue(6, 0.0);
   SetIndexLabel(6, "+2 ");
   Gsa_236[0] = "                  -2";
   Gsa_236[1] = "                  -1";
   Gsa_236[2] = "                   0";
   Gsa_236[3] = "                   1";
   Gsa_236[4] = "                   2";
   Gsa_236[5] = "                   3";
   Gsa_236[6] = "                   4";
   Gsa_236[7] = "                   5";
   Gsa_236[8] = "                   6";
   Gsa_236[9] = "                   7";
   Gsa_236[10] = "                   8";
   Gsa_236[11] = "                  +1";
   Gsa_236[12] = "                  +2";
   return (0);
}

int deinit() {
   Delete_All_Objects();
   return (0);
}

int start() {
   int Li_0;
   if (Bars != G_bars_192) {
      Li_0 = Bars - G_bars_192 - 1;
      for (int Li_4 = Li_0; Li_4 >= 0; Li_4--) MUR_Calc(Li_4);
      G_bars_192 = Bars;
   }
   return (0);
}

int MUR_Calc(int Ai_0) {
   double Lda_204[13];
   double Ld_4 = 0;
   double Ld_unused_12 = 0;
   double Ld_20 = 0;
   double ilow_28 = 0;
   double ihigh_36 = 0;
   double Ld_44 = 0;
   double Ld_52 = 0;
   double Ld_60 = 0;
   double Ld_68 = 0;
   double Ld_76 = 0;
   double Ld_84 = 0;
   double Ld_92 = 0;
   double Ld_100 = 0;
   double Ld_108 = 0;
   double Ld_116 = 0;
   double Ld_124 = 0;
   double Ld_132 = 0;
   double Ld_140 = 0;
   double Ld_148 = 0;
   double Ld_156 = 0;
   double Ld_164 = 0;
   double Ld_172 = 0;
   double Ld_180 = 0;
   double Ld_188 = 0;
   int lowest_196 = 0;
   int highest_200 = 0;
   int timeframe_208 = 0;
   lowest_196 = iLowest(NULL, timeframe_208, MODE_LOW, Gi_124, Ai_0);
   highest_200 = iHighest(NULL, timeframe_208, MODE_HIGH, Gi_124, Ai_0);
   ilow_28 = iLow(NULL, timeframe_208, lowest_196);
   ihigh_36 = iHigh(NULL, timeframe_208, highest_200);
   if (ihigh_36 <= 250000.0 && ihigh_36 > 25000.0) Ld_164 = 100000;
   else {
      if (ihigh_36 <= 25000.0 && ihigh_36 > 2500.0) Ld_164 = 10000;
      else {
         if (ihigh_36 <= 2500.0 && ihigh_36 > 250.0) Ld_164 = 1000;
         else {
            if (ihigh_36 <= 250.0 && ihigh_36 > 25.0) Ld_164 = 100;
            else {
               if (ihigh_36 <= 25.0 && ihigh_36 > 12.5) Ld_164 = 12.5;
               else {
                  if (ihigh_36 <= 12.5 && ihigh_36 > 6.25) Ld_164 = 12.5;
                  else {
                     if (ihigh_36 <= 6.25 && ihigh_36 > 3.125) Ld_164 = 6.25;
                     else {
                        if (ihigh_36 <= 3.125 && ihigh_36 > 1.5625) Ld_164 = 3.125;
                        else {
                           if (ihigh_36 <= 1.5625 && ihigh_36 > 0.390625) Ld_164 = 1.5625;
                           else
                              if (ihigh_36 <= 0.390625 && ihigh_36 > 0.0) Ld_164 = 0.1953125;
                        }
                     }
                  }
               }
            }
         }
      }
   }
   Ld_172 = ihigh_36 - ilow_28;
   Ld_20 = MathFloor(MathLog(Ld_164 / Ld_172) / MathLog(2));
   Ld_156 = Ld_164 * MathPow(0.5, Ld_20);
   Ld_44 = MathFloor(ilow_28 / Ld_156) * Ld_156;
   if (Ld_44 + Ld_156 > ihigh_36) Ld_52 = Ld_44 + Ld_156;
   else Ld_52 = Ld_44 + 2.0 * Ld_156;
   if (ilow_28 >= 3.0 * (Ld_52 - Ld_44) / 16.0 + Ld_44 && ihigh_36 <= 9.0 * (Ld_52 - Ld_44) / 16.0 + Ld_44) Ld_68 = Ld_44 + (Ld_52 - Ld_44) / 2.0;
   else Ld_68 = 0;
   if (ilow_28 >= Ld_44 - (Ld_52 - Ld_44) / 8.0 && ihigh_36 <= 5.0 * (Ld_52 - Ld_44) / 8.0 + Ld_44 && Ld_68 == 0.0) Ld_60 = Ld_44 + (Ld_52 - Ld_44) / 2.0;
   else Ld_60 = 0;
   if (ilow_28 >= Ld_44 + 7.0 * (Ld_52 - Ld_44) / 16.0 && ihigh_36 <= 13.0 * (Ld_52 - Ld_44) / 16.0 + Ld_44) Ld_84 = Ld_44 + 3.0 * (Ld_52 - Ld_44) / 4.0;
   else Ld_84 = 0;
   if (ilow_28 >= Ld_44 + 3.0 * (Ld_52 - Ld_44) / 8.0 && ihigh_36 <= 9.0 * (Ld_52 - Ld_44) / 8.0 + Ld_44 && Ld_84 == 0.0) Ld_92 = Ld_52;
   else Ld_92 = 0;
   if (ilow_28 >= Ld_44 + (Ld_52 - Ld_44) / 8.0 && ihigh_36 <= 7.0 * (Ld_52 - Ld_44) / 8.0 + Ld_44 && Ld_60 == 0.0 && Ld_68 == 0.0 && Ld_84 == 0.0 && Ld_92 == 0.0) Ld_76 = Ld_44 + 3.0 * (Ld_52 - Ld_44) / 4.0;
   else Ld_76 = 0;
   if (Ld_60 + Ld_68 + Ld_76 + Ld_84 + Ld_92 == 0.0) Ld_100 = Ld_52;
   else Ld_100 = 0;
   Ld_180 = Ld_60 + Ld_68 + Ld_76 + Ld_84 + Ld_92 + Ld_100;
   if (Ld_60 > 0.0) Ld_108 = Ld_44;
   else Ld_108 = 0;
   if (Ld_68 > 0.0) Ld_116 = Ld_44 + (Ld_52 - Ld_44) / 4.0;
   else Ld_116 = 0;
   if (Ld_76 > 0.0) Ld_124 = Ld_44 + (Ld_52 - Ld_44) / 4.0;
   else Ld_124 = 0;
   if (Ld_84 > 0.0) Ld_132 = Ld_44 + (Ld_52 - Ld_44) / 2.0;
   else Ld_132 = 0;
   if (Ld_92 > 0.0) Ld_140 = Ld_44 + (Ld_52 - Ld_44) / 2.0;
   else Ld_140 = 0;
   if (Ld_180 > 0.0 && Ld_108 + Ld_116 + Ld_124 + Ld_132 + Ld_140 == 0.0) Ld_148 = Ld_44;
   else Ld_148 = 0;
   Ld_188 = Ld_108 + Ld_116 + Ld_124 + Ld_132 + Ld_140 + Ld_148;
   Ld_4 = (Ld_180 - Ld_188) / 8.0;
   Lda_204[0] = Ld_188 - 2.0 * Ld_4;
   for (int Li_212 = 1; Li_212 < Gi_128; Li_212++) Lda_204[Li_212] = Lda_204[Li_212 - 1] + Ld_4;
   G_ibuf_136[Ai_0] = Lda_204[0];
   G_ibuf_140[Ai_0] = Lda_204[2];
   G_ibuf_144[Ai_0] = Lda_204[4];
   G_ibuf_148[Ai_0] = Lda_204[6];
   G_ibuf_152[Ai_0] = Lda_204[8];
   G_ibuf_156[Ai_0] = Lda_204[10];
   G_ibuf_160[Ai_0] = Lda_204[12];
   Mur_Levels_Draw(Ai_0, Ld_180, Ld_188);
   return (0);
}

void Mur_Рисовать_ДопЛинии_7п(double Ad_0, double Ad_8, int A_datetime_16, int A_datetime_20, int Ai_24) {
   string name_28;
   int Li_36;
   double price_40;
   if (Ad_8 - Ad_0 > Gi_120 * Point) {
      price_40 = (Ad_0 + Ad_8) / 2.0;
      Li_36 = G_count_200;
      G_count_200++;
      name_28 = Get_Line_Name(Ai_24 - 1, Li_36);
      ObjectCreate(name_28, OBJ_TREND, 0, A_datetime_16, price_40, A_datetime_20, price_40);
      ObjectSet(name_28, OBJPROP_COLOR, Цвет_доп_линий);
      ObjectSet(name_28, OBJPROP_STYLE, STYLE_DOT);
      ObjectSet(name_28, OBJPROP_RAY, FALSE);
      ObjectSet(name_28, OBJPROP_BACK, Рисовать_как_Фон);
      Mur_Рисовать_ДопЛинии_7п(Ad_0, price_40, A_datetime_16, A_datetime_20, Ai_24);
      Mur_Рисовать_ДопЛинии_7п(price_40, Ad_8, A_datetime_16, A_datetime_20, Ai_24);
   }
}

void Mur_Draw_Lines(int Ai_0, int Ai_4, double Ad_8, double Ad_16) {
   string name_24;
   string name_36;
   double Ld_52;
   double Ld_60;
   int datetime_72;
   int Li_80;
   string dbl2str_88;
   if (!Ai_0 && G_count_196 < 2) return;
   int datetime_68 = G_datetime_204;
   if (Ai_0 == 1) {
      Ld_52 = Ad_8;
      Ld_60 = Ad_16;
      Li_80 = G_count_196;
      datetime_72 = iTime(NULL, 0, Ai_4);
   } else {
      Ld_52 = Gd_212;
      Ld_60 = Gd_220;
      Li_80 = G_count_196 - 1;
      datetime_72 = iTime(NULL, 0, Ai_4 + 1);
   }
   G_count_200 = Gi_128;
   double Ld_44 = (Ld_52 - Ld_60) / 8.0;
   Gda_164[0] = Ld_60 - 2.0 * Ld_44;
   for (int index_84 = 1; index_84 < Gi_128; index_84++) {
      Gda_164[index_84] = Gda_164[index_84 - 1] + Ld_44;
      if (index_84 % 2 > 0) {
         name_24 = Get_Line_Name(Li_80 - 1, index_84);
         ObjectCreate(name_24, OBJ_TREND, 0, datetime_68, Gda_164[index_84], datetime_72, Gda_164[index_84]);
         ObjectSet(name_24, OBJPROP_COLOR, Gia_232[index_84][0]);
         ObjectSet(name_24, OBJPROP_STYLE, STYLE_DOT);
         ObjectSet(name_24, OBJPROP_RAY, FALSE);
         ObjectSet(name_24, OBJPROP_BACK, Рисовать_как_Фон);
      }
   }
   if (Period() == PERIOD_M1 || Period() == PERIOD_M5 && Рисовать_ДопЛинии_7п) for (index_84 = 0; index_84 < Gi_128 - 1; index_84++) Mur_Рисовать_ДопЛинии_7п(Gda_164[index_84], Gda_164[index_84 + 1], datetime_68, datetime_72, Li_80);
   if (Ai_4 == 0) {
      for (index_84 = 0; index_84 < Gi_128; index_84++) {
         if (Округлять_до_4х && G_digits_176 > 4) dbl2str_88 = DoubleToStr(NormalizeDouble(Gda_164[index_84], 4), 4);
         else dbl2str_88 = DoubleToStr(Gda_164[index_84], Digits);
         name_36 = "ML_txt" + index_84;
         if (ObjectFind(name_36) == -1) ObjectCreate(name_36, OBJ_TEXT, 0, Time[0], Gda_164[index_84] + 2.0 * Point);
         ObjectSetText(name_36, Gsa_236[index_84] + "-" + dbl2str_88, 8, "Tahoma", Gia_232[index_84][1]);
         ObjectMove(name_36, 0, Time[0], Gda_164[index_84] + 2.0 * Point);
      }
   }
}

void Mur_Levels_Draw(int Ai_0, double Ad_4, double Ad_12) {
   string name_20;
   string name_28;
   if (Ai_0 > Длина_Истории_в_барах || Ai_0 == Bars) {
      Gd_212 = Ad_4;
      Gd_220 = Ad_12;
      return;
   }
   if (Ad_4 != Gd_212 || Ad_12 != Gd_220 || (Gi_208 && Ai_0 == 0)) {
      G_count_196++;
      if (Gi_208) Mur_Draw_Lines(!Gi_208, Ai_0, Ad_4, Ad_12);
      G_datetime_204 = iTime(NULL, 0, Ai_0 + 1);
      if (Gi_208 && Ai_0 == 0) Gi_208 = FALSE;
      if (!Gi_208) Mur_Draw_Lines(!Gi_208, Ai_0, Ad_4, Ad_12);
   } else {
      if (!Gi_208) {
         for (int Li_36 = 1; Li_36 < 13; Li_36 += 2) {
            name_20 = Get_Line_Name(G_count_196 - 1, Li_36);
            ObjectMove(name_20, 1, iTime(NULL, 0, Ai_0), ObjectGet(name_20, OBJPROP_PRICE1));
         }
         for (Li_36 = 13; Li_36 < G_count_200; Li_36++) {
            name_20 = Get_Line_Name(G_count_196 - 1, Li_36);
            ObjectMove(name_20, 1, iTime(NULL, 0, Ai_0), ObjectGet(name_20, OBJPROP_PRICE1));
         }
         for (int count_40 = 0; count_40 < Gi_128; count_40++) {
            name_28 = "ML_txt" + count_40;
            ObjectMove(name_28, 0, Time[0], ObjectGet(name_28, OBJPROP_PRICE1));
         }
      }
   }
   Gd_212 = Ad_4;
   Gd_220 = Ad_12;
}

string Get_Line_Name(int Ai_0, int Ai_4) {
   if (Ai_4 < 13) return (StringTrimLeft(Gsa_236[Ai_4]) + "            " + "ML_" + StringSubstr(DoubleToStr(Ai_0 + 1000000, 0), 1));
   return ("ML_" + StringSubstr(DoubleToStr(Ai_0 + 1000000, 0), 1) + "_" + StringSubstr(DoubleToStr(Ai_4 + 1000000, 0), 1));
}

void Delete_All_Objects() {
   int count_0 = 0;
   int count_4 = 1;
   for (string name_8 = Get_Line_Name(count_0, count_4); ObjectFind(name_8) > -1; name_8 = Get_Line_Name(count_0, count_4)) {
      while (ObjectFind(name_8) > -1) {
         ObjectDelete(name_8);
         if (count_4 < 13) count_4++;
         count_4++;
         name_8 = Get_Line_Name(count_0, count_4);
      }
      count_4 = 1;
      count_0++;
   }
   count_4 = 0;
   for (name_8 = "ML_txt" + count_4; ObjectFind(name_8) > -1; name_8 = "ML_txt" + count_4) {
      ObjectDelete(name_8);
      count_4++;
   }
}

Комментарии к исходному коду форекс индикатора !Mur_VM-2.01.mq4
В целях безопасности и борьбы со спамом в тексте комментариев запрещено размещать html-теги и ссылки. Благодарим за понимание.

  • X
  • 0% загружено
« индикатор !MoneyLine2.mq4
индикатор !PriceStat.mq4 »