Navigation´╝ÜHome > Content >

Indikator_Super_Profit_Kobra.mq4

Time: 2017-08-03 | Download file:Indikator_Super_Profit_Kobra.mq4

/*
   Generated by EX4-TO-MQ4 decompiler V4.0.438.3 [-]
   Website: https://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Copyright 2012 By Ivan Suseno Aji Hp.087837192772"
#property link      "Bismillah Semoga Selalu Sukses"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue

int gi_76 = 4;
//extern string text = "---By KOPRO GROUP(Ivan Suseno Aji)---";
extern int pips_per_box_M1 = 2;
extern int pips_per_box_M5 = 4;
extern int pips_per_box_M15 = 8;
extern int pips_per_box_M30 = 16;
extern int pips_per_box_H1 = 24;
extern int pips_per_box_H4 = 32;
extern int pips_per_box_D1 = 60;
extern int pips_per_box_W1 = 120;
extern int pips_per_box_MN1 = 200;
extern string text1 = "---Trendline settings---";
extern color Trendline_up_color = Blue;
extern color Trendline_down_color = Red;
int gi_unused_140 = 10000;
double g_ibuf_144[];
double g_ibuf_148[];
double g_ibuf_152[];
double g_ibuf_156[];
double g_ibuf_160[];
bool gi_164;
int g_datetime_168;
int g_time_172;
datetime g_time_176;
int g_count_180 = 0;
int gi_184;
bool gi_188;
int gi_192;
int gi_unused_196 = 0;
int gi_200 = 0;
double g_high_204;
double g_price_212;

int init() {
   IndicatorShortName("Super Profit Indikator Kobra");
   IndicatorDigits(Digits + 1);
   SetIndexBuffer(0, g_ibuf_156);
   SetIndexLabel(0, "Highs");
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0, 238);
   SetIndexBuffer(1, g_ibuf_160);
   SetIndexLabel(1, "Lows");
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexArrow(1, 236);
   IndicatorBuffers(5);
   SetIndexBuffer(2, g_ibuf_144);
   SetIndexBuffer(3, g_ibuf_148);
   SetIndexBuffer(4, g_ibuf_152);
   switch (Period()) {
   case PERIOD_M1:
      gi_76 = pips_per_box_M1;
      break;
   case PERIOD_M5:
      gi_76 = pips_per_box_M5;
      break;
   case PERIOD_M15:
      gi_76 = pips_per_box_M15;
      break;
   case PERIOD_M30:
      gi_76 = pips_per_box_M30;
      break;
   case PERIOD_H1:
      gi_76 = pips_per_box_H1;
      break;
   case PERIOD_H4:
      gi_76 = pips_per_box_H4;
      break;
   case PERIOD_D1:
      gi_76 = pips_per_box_D1;
      break;
   case PERIOD_W1:
      gi_76 = pips_per_box_W1;
      break;
   case PERIOD_MN1:
      gi_76 = pips_per_box_MN1;
   }
   g_time_176 = Time[0];
   ArrayInitialize(g_ibuf_156, 0);
   ArrayInitialize(g_ibuf_160, 0);
   ArrayInitialize(g_ibuf_144, 0);
   ArrayInitialize(g_ibuf_148, 0);
   ArrayInitialize(g_ibuf_152, 0);
   gi_unused_196 = 0;
   gi_200 = 0;
   return (0);
}

int deinit() {
   string lsa_0[256];
   string name_12;
   for (int index_4 = 0; index_4 < 256; index_4++) lsa_0[index_4] = CharToStr(index_4);
   int str2int_8 = StrToInteger(lsa_0[67] + lsa_0[111] + lsa_0[112] + lsa_0[121] + lsa_0[32] + lsa_0[82] + lsa_0[105] + lsa_0[103] + lsa_0[104] + lsa_0[116] + lsa_0[32] +
      lsa_0[169] + lsa_0[32] + lsa_0[75] + lsa_0[97] + lsa_0[122] + lsa_0[97] + lsa_0[111] + lsa_0[111] + lsa_0[32] + lsa_0[50] + lsa_0[48] + lsa_0[49] + lsa_0[49] + lsa_0[32]);
   int objs_total_20 = ObjectsTotal();
   for (int li_24 = objs_total_20 - 1; li_24 >= 0; li_24--) {
      name_12 = ObjectName(li_24);
      if (StringFind(name_12, "Trendline ") != -1) ObjectDelete(ObjectName(li_24));
   }
   return (0);
}

int start() {
   int li_8;
   int count_12;

   int li_16 = 0;
   int ind_counted_20 = IndicatorCounted();
   li_16 = Bars - ind_counted_20;
   if (ind_counted_20 < gi_200) f0_1();
   gi_200 = MathMax(gi_200, ind_counted_20);
   for (int li_24 = li_16 - 1; li_24 >= 0; li_24--) {
      li_8 = f0_0();
      if (li_8 && li_24 == 1) continue;
      if ((!(g_ibuf_152[li_24] == -1.0)) && !(g_ibuf_152[li_24] == 1.0)) {
         g_ibuf_152[li_24] = g_ibuf_152[li_24 + 1];
         g_ibuf_148[li_24] = g_ibuf_148[li_24 + 1];
         g_ibuf_144[li_24] = g_ibuf_144[li_24 + 1];
      }
      gi_188 = 100000.0 * g_ibuf_148[li_24];
      gi_192 = 100000.0 * g_ibuf_144[li_24];
      if (gi_184 == 1 && (!(gi_164 && li_24 < 1)) && (li_24 > 0 && Low[li_24] <= (gi_192 - gi_192 % (10 * gi_76) - 3.0 * (10.0 * gi_76)) / 100000.0) || (li_24 == 0 && Close[li_24] <= (gi_192 - gi_192 % (10 * gi_76) - 3.0 * (10.0 * gi_76)) / 100000.0)) {
         gi_184 = -1;
         if (li_24 < 1) gi_164 = TRUE;
         g_ibuf_148[li_24] = Low[li_24];
         g_ibuf_152[li_24] = -1.0;
         g_ibuf_144[li_24] = g_ibuf_144[li_24 + 1];
         gi_188 = 100000.0 * g_ibuf_148[li_24];
         gi_192 = 100000.0 * g_ibuf_144[li_24];
         count_12 = 0;
         while (true) {
            if (High[li_24 + count_12] >= g_ibuf_144[li_24]) {
               g_ibuf_156[li_24 + count_12] = High[li_24 + count_12];
               g_time_172 = Time[li_24 + count_12];
               g_high_204 = High[li_24 + count_12];
               break;
            }
            count_12++;
         }
         ObjectCreate("Trendline " + g_count_180, OBJ_TREND, 0, g_datetime_168, g_price_212, g_time_172, g_high_204);
         ObjectSet("Trendline " + g_count_180, OBJPROP_RAY, FALSE);
         ObjectSet("Trendline " + g_count_180, OBJPROP_COLOR, Trendline_up_color);
         ObjectSetText("Trendline " + g_count_180, DoubleToStr(10000.0 * (g_high_204 - g_price_212), 1) + " Pips");
         g_count_180++;
      } else {
         if (gi_184 == -1 && (!(gi_164 && li_24 < 1)) && (High[li_24] >= MathCeil(1.0 * gi_188 / (10.0 * gi_76)) * gi_76 / 10000.0 + 3 * gi_76 / 10000.0 && li_24 > 0) || (li_24 == 0 &&
            Close[li_24] >= MathCeil(1.0 * gi_188 / (10.0 * gi_76)) * gi_76 / 10000.0 + 3 * gi_76 / 10000.0)) {
            gi_184 = 1;
            if (li_24 < 1) gi_164 = TRUE;
            g_ibuf_148[li_24] = g_ibuf_148[li_24 + 1];
            g_ibuf_152[li_24] = 1.0;
            g_ibuf_144[li_24] = High[li_24];
            gi_188 = 100000.0 * g_ibuf_148[li_24];
            gi_192 = 100000.0 * g_ibuf_144[li_24];
            count_12 = 0;
            while (true) {
               if (Low[li_24 + count_12] <= g_ibuf_148[li_24]) {
                  g_ibuf_160[li_24 + count_12] = Low[li_24 + count_12];
                  g_datetime_168 = Time[li_24 + count_12];
                  g_price_212 = Low[li_24 + count_12];
                  break;
               }
               count_12++;
            }
            ObjectCreate("Trendline " + g_count_180, OBJ_TREND, 0, g_time_172, g_high_204, g_datetime_168, g_price_212);
            ObjectSet("Trendline " + g_count_180, OBJPROP_RAY, FALSE);
            ObjectSet("Trendline " + g_count_180, OBJPROP_COLOR, Trendline_down_color);
            ObjectSetText("Trendline " + g_count_180, DoubleToStr(10000.0 * (g_high_204 - g_price_212), 1) + " Pips");
            g_count_180++;
         } else {
            if (gi_184 == 1) {
               g_ibuf_152[li_24] = 1;
               g_ibuf_144[li_24] = MathMax(High[li_24], g_ibuf_144[li_24 + 1]);
               if (gi_164 && li_24 == 0) g_ibuf_144[li_24] = High[li_24];
               g_ibuf_148[li_24] = g_ibuf_148[li_24 + 1];
               gi_188 = 100000.0 * g_ibuf_148[li_24];
               gi_192 = 100000.0 * g_ibuf_144[li_24];
            }
            if (gi_184 == -1) {
               g_ibuf_152[li_24] = -1;
               g_ibuf_148[li_24] = MathMin(Low[li_24], g_ibuf_148[li_24 + 1]);
               if (gi_164 && li_24 == 0) g_ibuf_148[li_24] = Low[li_24];
               g_ibuf_144[li_24] = g_ibuf_144[li_24 + 1];
               gi_188 = 100000.0 * g_ibuf_148[li_24];
               gi_192 = 100000.0 * g_ibuf_144[li_24];
            } else {
               if (g_ibuf_152[li_24] == 0.0 || g_ibuf_152[li_24 + 1] == 0.0) {
                  g_ibuf_148[li_24] = Low[li_24];
                  g_ibuf_148[li_24 + 1] = Low[li_24];
                  g_ibuf_144[li_24] = High[li_24];
                  g_ibuf_144[li_24 + 1] = High[li_24];
                  g_ibuf_152[li_24] = 1;
                  g_ibuf_152[li_24 + 1] = 1;
                  gi_184 = 1;
                  gi_192 = High[li_24];
                  gi_188 = Low[li_24];
               }
            }
         }
      }
   }
   return (0);
}

int f0_0() {
   if (g_time_176 < Time[0]) {
      g_time_176 = Time[0];
      gi_164 = FALSE;
      return (1);
   }
   return (0);
}

void f0_1() {
   string name_0;
   int objs_total_8 = ObjectsTotal();
   for (int li_12 = objs_total_8 - 1; li_12 >= 0; li_12--) {
      name_0 = ObjectName(li_12);
      if (StringFind(name_0, "Trendline ") != -1) ObjectDelete(ObjectName(li_12));
   }
   ArrayInitialize(g_ibuf_144, 0);
   ArrayInitialize(g_ibuf_148, 0);
   ArrayInitialize(g_ibuf_152, 0);
   ArrayInitialize(g_ibuf_156, 0);
   ArrayInitialize(g_ibuf_160, 0);
   gi_164 = FALSE;
   g_time_176 = Time[0];
   g_count_180 = 0;
   gi_184 = 0;
   gi_188 = FALSE;
   gi_192 = 0;
   gi_unused_196 = 0;
   gi_200 = 0;
   g_high_204 = 0;
   g_price_212 = 0;
   g_datetime_168 = 0;
   g_time_172 = 0;
}

Recommend