Navigation:Home > Content >

BARACUDE_VOLUME_NEXT_v.5_cracked.mq4

Time: 2015-05-10 | Download file:BARACUDE_VOLUME_NEXT_v.5_cracked.mq4

#property indicator_chart_window

extern bool DrawVolumeMore200 = TRUE;
extern bool DrawVolumeMore300 = TRUE;
extern bool DrawVolumeMore400 = TRUE;
extern bool DrawVolumeMore500 = TRUE;
extern bool DrawCustomVolume = TRUE;
extern int CustomVolumeSize = 600;
extern bool DrawLineVolume = TRUE;
extern bool DrawLineMaxVolume = TRUE;
extern bool AlertMaxVolume = TRUE;
extern bool UseStartTime = TRUE;
extern string StartTime = "03:00";
extern int HistoryDepth = 400;
extern color UpColor = Lime;
extern color DwColor = Red;
extern bool UseNumbOfDays = FALSE;
extern int numb_of_days = 2;
extern bool UseOpenDayLine = FALSE;
extern bool MaxVolumeCurrentWeek = FALSE;
extern bool MaxVolumeLastWeek = FALSE;
extern bool MaxVolumeCurrentMonth = FALSE;
extern bool MaxVolumeLastMonth = FALSE;
extern bool DrawValueMaxVolume = FALSE;
extern bool DrawLineCurrentMaxVolume = FALSE;
double Gd_172;
bool Gi_180;
int G_datetime_184;
int G_datetime_188;

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   if (Digits == 5 || Digits == 3) Gd_172 = 10.0 * Point;
   else Gd_172 = Point;
   Gi_180 = TRUE;
   if (!f0_3()) return (0);
   f0_7();
   int Li_0 = HistoryDepth;
   if (UseNumbOfDays) Li_0 = iBarShift(NULL, 0, iTime(NULL, PERIOD_D1, numb_of_days - 1));
   f0_8(Li_0);
   return (0);
}

// 52D46093050F38C27267BCE42543EF60
int deinit() {
   f0_7();
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   if (!Gi_180) return (0);
   G_datetime_184 = iTime(NULL, 0, 0);
   if (G_datetime_184 == G_datetime_188) return (0);
   G_datetime_188 = G_datetime_184;
   f0_8();
   return (0);
}

// A9B24A824F70CC1232D1C2BA27039E8D
void f0_8(int Ai_0 = 1) {
   double iclose_4;
   double iopen_12;
   double Ld_20;
   double Ld_28;
   double Ld_36;
   double Ld_44;
   double Ld_52;
   int color_60;
   bool Li_64;
   int Li_68;
   int Li_72;
   int datetime_76;
   int datetime_80;
   int Li_84;
   int datetime_88;
   int shift_92;
   int shift_96;
   int highest_100;
   int highest_104;
   int shift_108;
   int Li_112;
   int shift_116;
   int Li_120;
   if (UseOpenDayLine) {
      f0_5(iOpen(NULL, PERIOD_D1, 0), DeepSkyBlue, STYLE_SOLID);
      f0_4("open_day", iTime(NULL, 0, 0), iOpen(NULL, PERIOD_D1, 0), DeepSkyBlue, "Open Day");
   }
   if (MaxVolumeCurrentWeek) {
      Li_112 = 1;
      shift_116 = iBarShift(NULL, 0, iTime(NULL, PERIOD_W1, 0));
      Li_120 = 0;
      for (int Li_124 = Li_112; Li_124 <= shift_116; Li_124++)
         if (iVolume(NULL, 0, Li_124) > iVolume(NULL, 0, Li_120)) Li_120 = Li_124;
      if (iClose(NULL, 0, Li_120) >= iOpen(NULL, 0, Li_120)) {
         f0_0("current_week", iTime(NULL, 0, Li_120), iHigh(NULL, 0, Li_120), White, 2);
         f0_5(iHigh(NULL, 0, Li_120), White, STYLE_SOLID);
         f0_4("current_week", iTime(NULL, 0, 0), iHigh(NULL, 0, Li_120), White, "Current Week");
      } else {
         f0_0("current_week", iTime(NULL, 0, Li_120), iLow(NULL, 0, Li_120), White, 2);
         f0_5(iLow(NULL, 0, Li_120), White, STYLE_SOLID);
         f0_4("current_week", iTime(NULL, 0, 0), iLow(NULL, 0, Li_120), White, "Current Week");
      }
      if (AlertMaxVolume && Li_120 == 1) Alert("Превышен максимальный внутринедельный объём!");
   }
   if (MaxVolumeLastWeek) {
      Li_112 = iBarShift(NULL, 0, iTime(NULL, PERIOD_W1, 0)) + 1;
      shift_116 = iBarShift(NULL, 0, iTime(NULL, PERIOD_W1, 1));
      Li_120 = 0;
      for (Li_124 = Li_112; Li_124 <= shift_116; Li_124++)
         if (iVolume(NULL, 0, Li_124) > iVolume(NULL, 0, Li_120)) Li_120 = Li_124;
      if (iClose(NULL, 0, Li_120) >= iOpen(NULL, 0, Li_120)) {
         f0_0("last_week", iTime(NULL, 0, Li_120), iHigh(NULL, 0, Li_120), Orange, 2);
         f0_5(iHigh(NULL, 0, Li_120), Orange, STYLE_SOLID);
         f0_4("last_week", iTime(NULL, 0, 0), iHigh(NULL, 0, Li_120), Orange, "Last Week");
      } else {
         f0_0("last_week", iTime(NULL, 0, Li_120), iLow(NULL, 0, Li_120), Orange, 2);
         f0_5(iLow(NULL, 0, Li_120), Orange, STYLE_SOLID);
         f0_4("last_week", iTime(NULL, 0, 0), iLow(NULL, 0, Li_120), Orange, "Last Week");
      }
   }
   if (MaxVolumeCurrentMonth) {
      Li_112 = 1;
      shift_116 = iBarShift(NULL, 0, iTime(NULL, PERIOD_MN1, 0));
      Li_120 = 0;
      for (Li_124 = Li_112; Li_124 <= shift_116; Li_124++)
         if (iVolume(NULL, 0, Li_124) > iVolume(NULL, 0, Li_120)) Li_120 = Li_124;
      if (iClose(NULL, 0, Li_120) >= iOpen(NULL, 0, Li_120)) {
         f0_0("current_month", iTime(NULL, 0, Li_120), iHigh(NULL, 0, Li_120), Yellow, 3);
         f0_5(iHigh(NULL, 0, Li_120), Yellow, STYLE_SOLID);
         f0_4("current_month", iTime(NULL, 0, 0), iHigh(NULL, 0, Li_120), Yellow, "Current Month");
      } else {
         f0_0("current_month", iTime(NULL, 0, Li_120), iLow(NULL, 0, Li_120), Yellow, 3);
         f0_5(iLow(NULL, 0, Li_120), Yellow, STYLE_SOLID);
         f0_4("current_month", iTime(NULL, 0, 0), iLow(NULL, 0, Li_120), Yellow, "Current Month");
      }
      if (AlertMaxVolume && Li_120 == 1) Alert("Превышен максимальный внутринедельный объём!");
   }
   if (MaxVolumeLastMonth) {
      Li_112 = iBarShift(NULL, 0, iTime(NULL, PERIOD_MN1, 0)) + 1;
      shift_116 = iBarShift(NULL, 0, iTime(NULL, PERIOD_MN1, 1));
      Li_120 = 0;
      for (Li_124 = Li_112; Li_124 <= shift_116; Li_124++)
         if (iVolume(NULL, 0, Li_124) > iVolume(NULL, 0, Li_120)) Li_120 = Li_124;
      if (iClose(NULL, 0, Li_120) >= iOpen(NULL, 0, Li_120)) {
         f0_0("last_month", iTime(NULL, 0, Li_120), iHigh(NULL, 0, Li_120), Brown, 3);
         f0_5(iHigh(NULL, 0, Li_120), Brown, STYLE_SOLID);
         f0_4("last_month", iTime(NULL, 0, 0), iHigh(NULL, 0, Li_120), Brown, "Last Month");
      } else {
         f0_0("last_month", iTime(NULL, 0, Li_120), iLow(NULL, 0, Li_120), Brown, 3);
         f0_5(iLow(NULL, 0, Li_120), Brown, STYLE_SOLID);
         f0_4("last_month", iTime(NULL, 0, 0), iLow(NULL, 0, Li_120), Brown, "Last Month");
      }
   }
   int timeframe_128 = Period();
   if (UseStartTime && timeframe_128 < PERIOD_D1) {
      datetime_76 = iTime(NULL, 0, 1);
      datetime_80 = iTime(NULL, 0, 2);
      Li_84 = StrToTime(TimeYear(datetime_76) + "." + TimeMonth(datetime_76) + "." + TimeDay(datetime_76) + " " + StartTime);
      if (datetime_76 < Li_84) Li_84 -= 86400;
      else {
         if (datetime_80 < Li_84 && datetime_76 >= Li_84) {
            if (datetime_76 > Li_84) datetime_76 = datetime_80;
            f0_7();
            f0_6(datetime_76);
         }
      }
   }
   for (Li_124 = 1; Li_124 <= Ai_0; Li_124++) {
      Li_68 = iVolume(NULL, 0, Li_124);
      datetime_76 = iTime(NULL, 0, Li_124);
      iclose_4 = iClose(NULL, 0, Li_124);
      iopen_12 = iOpen(NULL, 0, Li_124);
      Ld_20 = iHigh(NULL, 0, Li_124);
      Ld_28 = iLow(NULL, 0, Li_124);
      if (UseStartTime && timeframe_128 < PERIOD_D1) {
         if (datetime_76 < Li_84) {
            shift_108 = iBarShift(NULL, 0, Li_84, TRUE);
            if (shift_108 == -1) break;
            f0_6(iTime(NULL, 0, shift_108));
            break;
         }
      }
      if (Ld_20 - Ld_28 <= 5.0 * Gd_172) Ld_36 = Gd_172;
      else Ld_36 = (Ld_20 - Ld_28) / 5.0;
      if (iclose_4 >= iopen_12) {
         Ld_44 = Ld_20 + 2.0 * Ld_36;
         color_60 = UpColor;
      } else {
         Ld_44 = Ld_28 - Ld_36;
         color_60 = DwColor;
      }
      Li_72 = 0;
      Li_64 = FALSE;
      if (Li_68 > 500 && DrawVolumeMore500) {
         f0_9("v", datetime_76, Ld_44, color_60, "5");
         Li_72 = 500;
         Li_64 = TRUE;
      } else {
         if (Li_68 > 400 && DrawVolumeMore400) {
            f0_9("v", datetime_76, Ld_44, color_60, "4");
            Li_72 = 400;
            Li_64 = TRUE;
         } else {
            if (Li_68 > 300 && DrawVolumeMore300) {
               f0_9("v", datetime_76, Ld_44, color_60, "3");
               Li_72 = 300;
               Li_64 = TRUE;
            } else {
               if (Li_68 > 200 && DrawVolumeMore200) {
                  f0_9("v", datetime_76, Ld_44, color_60, "2");
                  Li_72 = 200;
                  Li_64 = TRUE;
               }
            }
         }
      }
      if (CustomVolumeSize > Li_72 && Li_68 > CustomVolumeSize && DrawCustomVolume) {
         f0_9("v", datetime_76, Ld_44, color_60, DoubleToStr(CustomVolumeSize, 0));
         Li_64 = TRUE;
      }
      if (DrawLineVolume && Li_64) f0_5(iclose_4, color_60, STYLE_SOLID);
      if (timeframe_128 < PERIOD_D1) {
         shift_92 = iBarShift(NULL, PERIOD_D1, datetime_76, TRUE);
         if (shift_92 != -1) {
            datetime_88 = iTime(NULL, PERIOD_D1, shift_92);
            if (datetime_88 != datetime_76) {
               shift_96 = iBarShift(NULL, 0, datetime_88, TRUE);
               if (shift_96 != -1) {
                  highest_100 = iHighest(NULL, 0, MODE_VOLUME, shift_96 - Li_124 + 1, Li_124);
                  if (highest_104 == 0) highest_104 = highest_100;
                  if (Li_124 == highest_100) {
                     if (iclose_4 >= iopen_12) {
                        Ld_44 = Ld_20;
                        Ld_52 = Ld_44 + 2.0 * Ld_36;
                        color_60 = UpColor;
                     } else {
                        Ld_44 = Ld_28;
                        Ld_52 = Ld_44 - Ld_36;
                        color_60 = DwColor;
                     }
                     if (DrawValueMaxVolume) f0_9("v", datetime_76, Ld_52, color_60, DoubleToStr(iVolume(NULL, 0, highest_100), 0));
                     f0_0("v", datetime_76, Ld_44, color_60);
                     if (DrawLineMaxVolume) f0_5(Ld_44, color_60, STYLE_SOLID);
                     if (AlertMaxVolume && Li_124 == 1) Alert("Превышен максимальный внутридневной объём!");
                  }
               }
            }
         }
      }
   }
   if (DrawLineCurrentMaxVolume) {
      f0_1();
      if (iClose(NULL, 0, highest_100) >= iOpen(NULL, 0, highest_100)) Ld_44 = iHigh(NULL, 0, highest_100);
      else Ld_44 = iLow(NULL, 0, highest_100);
      f0_2("max_volume_line", iTime(NULL, 0, highest_100) + 600 * Period(), Ld_44, iTime(NULL, 0, highest_100) - 600 * Period(), Ld_44, Yellow, STYLE_SOLID, 2);
      f0_9("max_volume", iTime(NULL, 0, highest_100) + 300 * Period(), Ld_44, Yellow, "Max Volume");
   }
   WindowRedraw();
}

// 689C35E4872BA754D7230B8ADAA28E48
bool f0_3() {
   Comment("Подождите, идет обновление данных таймфреймов...");
   for (int count_0 = 0; count_0 < 120; count_0++) {
      iTime(NULL, PERIOD_D1, 0);
      iTime(NULL, 0, 0);
      if (MaxVolumeCurrentWeek || MaxVolumeCurrentWeek) iTime(NULL, PERIOD_W1, 0);
      if (MaxVolumeCurrentMonth || MaxVolumeCurrentMonth) iTime(NULL, PERIOD_MN1, 0);
      if (GetLastError() != 4066/* HISTORY_WILL_UPDATED */) break;
      Sleep(1000);
   }
   if (count_0 == 120) Comment("Обновление данных завершилось с ошибкой. Переход к следующей попытке.");
   Comment("");
   return (TRUE);
}

// 09CBB5F5CE12C31A043D5C81BF20AA4A
void f0_0(string As_0, int Ai_8, double A_price_12, color A_color_20, int A_width_24 = 1) {
   string name_28 = "Arrow_" + As_0 + "_" + TimeToStr(Ai_8);
   ObjectDelete(name_28);
   ObjectCreate(name_28, OBJ_ARROW, 0, Ai_8, A_price_12, 0, 0, 0, 0);
   ObjectSet(name_28, OBJPROP_ARROWCODE, 159);
   ObjectSet(name_28, OBJPROP_COLOR, A_color_20);
   ObjectSet(name_28, OBJPROP_WIDTH, A_width_24);
   ObjectSetText(name_28, "Точка", 8, "Arial", A_color_20);
}

// 78BAA8FAE18F93570467778F2E829047
void f0_5(double A_price_0, color A_color_8, int A_style_12) {
   string name_16 = "LineH" + "_" + DoubleToStr(A_price_0, Digits);
   ObjectDelete(name_16);
   ObjectCreate(name_16, OBJ_HLINE, 0, 0, A_price_0, 0, 0, 0, 0);
   ObjectSet(name_16, OBJPROP_COLOR, A_color_8);
   ObjectSet(name_16, OBJPROP_STYLE, A_style_12);
   ObjectSetText(name_16, "Линия", 8, "Arial", A_color_8);
}

// 945D754CB0DC06D04243FCBA25FC0802
void f0_6(int Ai_0, color A_color_4 = 255, int A_style_8 = 0) {
   string name_12 = "LineV" + "_" + TimeToStr(Ai_0);
   ObjectDelete(name_12);
   ObjectCreate(name_12, OBJ_VLINE, 0, Ai_0, 0, 0, 0, 0, 0);
   ObjectSet(name_12, OBJPROP_COLOR, A_color_4);
   ObjectSet(name_12, OBJPROP_STYLE, A_style_8);
   ObjectSetText(name_12, "Линия", 8, "Arial", A_color_4);
}

// 5710F6E623305B2C1458238C9757193B
void f0_2(string A_name_0, int A_datetime_8, double Ad_12, int A_datetime_20, double Ad_24, color A_color_32, int A_style_36 = 0, int A_width_40 = 0) {
   if (ObjectFind(A_name_0) == -1) {
      ObjectCreate(A_name_0, OBJ_TREND, 0, 0, 0, 0, 0);
      ObjectSet(A_name_0, OBJPROP_RAY, FALSE);
   }
   ObjectSet(A_name_0, OBJPROP_TIME1, A_datetime_8);
   ObjectSet(A_name_0, OBJPROP_TIME2, A_datetime_20);
   ObjectSet(A_name_0, OBJPROP_PRICE1, Ad_12);
   ObjectSet(A_name_0, OBJPROP_PRICE2, Ad_24);
   ObjectSet(A_name_0, OBJPROP_COLOR, A_color_32);
   ObjectSet(A_name_0, OBJPROP_STYLE, A_style_36);
   ObjectSet(A_name_0, OBJPROP_WIDTH, A_width_40);
}

// D1DDCE31F1A86B3140880F6B1877CBF8
void f0_9(string As_0, int Ai_8, double A_price_12, color A_color_20, string A_text_24) {
   string name_32 = "Digit_" + As_0 + "_" + TimeToStr(Ai_8);
   ObjectDelete(name_32);
   ObjectCreate(name_32, OBJ_TEXT, 0, Ai_8, A_price_12, 0, 0, 0, 0);
   ObjectSetText(name_32, A_text_24, 8, "Arial", A_color_20);
}

// 6ABA3523C7A75AAEA41CC0DEC7953CC5
void f0_4(string As_0, int A_datetime_8, double A_price_12, color A_color_20, string A_text_24) {
   string name_32 = "Digit_" + As_0;
   ObjectDelete(name_32);
   ObjectCreate(name_32, OBJ_TEXT, 0, A_datetime_8, A_price_12, 0, 0, 0, 0);
   ObjectSetText(name_32, A_text_24, 8, "Arial", A_color_20);
}

// 9B1AEE847CFB597942D106A4135D4FE6
void f0_7() {
   string name_0;
   for (int Li_8 = ObjectsTotal() - 1; Li_8 >= 0; Li_8--) {
      name_0 = ObjectName(Li_8);
      if (StringSubstr(name_0, 0, 5) == "Digit") ObjectDelete(name_0);
      else {
         if (StringSubstr(name_0, 0, 5) == "Arrow") ObjectDelete(name_0);
         else {
            if (StringSubstr(name_0, 0, 5) == "LineH") ObjectDelete(name_0);
            else {
               if (StringSubstr(name_0, 0, 5) == "LineV") ObjectDelete(name_0);
               else
                  if (StringSubstr(name_0, 0, 10) == "max_volume") ObjectDelete(name_0);
            }
         }
      }
   }
}

// 2569208C5E61CB15E209FFE323DB48B7
void f0_1() {
   string name_0;
   for (int Li_8 = ObjectsTotal() - 1; Li_8 >= 0; Li_8--) {
      name_0 = ObjectName(Li_8);
      if (StringSubstr(name_0, 0, 9) == "Digit_max") ObjectDelete(name_0);
   }
}

Recommend