Navigation´╝ÜHome > Content >

WCCI-SW.mq4

Time: 2018-06-15 | Download file:WCCI-SW.mq4

#property copyright "Kardamon"
#property link      "http://kardamonfc.blogspot.com"

#property indicator_separate_window
#property indicator_minimum -300.0
#property indicator_maximum 300.0
#property indicator_buffers 7
#property indicator_color1 LimeGreen
#property indicator_color2 Yellow
#property indicator_color3 Red
#property indicator_color4 LimeGreen
#property indicator_color5 Yellow
#property indicator_color6 Red
#property indicator_color7 Yellow

int gi_unused_76 = 10008;
int gi_80 = 25;
int gi_84 = 34;
extern int SI_limit0 = 60;
extern int SI_limit1 = 100;
extern int MaxBars = 50;
double g_ibuf_100[];
double g_ibuf_104[];
double g_ibuf_108[];
double g_ibuf_112[];
double g_ibuf_116[];
double g_ibuf_120[];
double gda_unused_124[];
double gda_unused_128[];
double g_ibuf_132[];
double gda_unused_136[];
int gi_140;

int init() {
   int l_window_0 = WindowFind("WCCI-kardamon");
   if (l_window_0 < 0) l_window_0 = 1;
  /* if (TimeCurrent() > 1321870549) Alert("Time limit will be expired at" + TimeToStr(1310806800, TIME_DATE|TIME_MINUTES));
   if (TimeCurrent() > 1321870549) {
      Alert("Time limit expired");
      return (0);
   }*/
   gi_140 = MathMax(gi_84, gi_80);
   IndicatorDigits(0);
   IndicatorShortName("");
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexBuffer(0, g_ibuf_100);
   SetIndexDrawBegin(0, gi_140);
   SetIndexEmptyValue(0, EMPTY_VALUE);
   SetIndexArrow(0, 59);
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexBuffer(1, g_ibuf_104);
   SetIndexDrawBegin(1, gi_140);
   SetIndexEmptyValue(1, EMPTY_VALUE);
   SetIndexArrow(1, 59);
   SetIndexStyle(2, DRAW_ARROW);
   SetIndexBuffer(2, g_ibuf_108);
   SetIndexDrawBegin(2, gi_140);
   SetIndexEmptyValue(2, EMPTY_VALUE);
   SetIndexArrow(2, 59);
   SetIndexStyle(3, DRAW_ARROW);
   SetIndexBuffer(3, g_ibuf_112);
   SetIndexDrawBegin(3, gi_140);
   SetIndexEmptyValue(4, EMPTY_VALUE);
   SetIndexArrow(3, 59);
   SetIndexStyle(4, DRAW_ARROW);
   SetIndexBuffer(4, g_ibuf_116);
   SetIndexDrawBegin(4, gi_140);
   SetIndexEmptyValue(4, EMPTY_VALUE);
   SetIndexArrow(4, 59);
   SetIndexStyle(5, DRAW_ARROW);
   SetIndexBuffer(5, g_ibuf_120);
   SetIndexDrawBegin(5, gi_140);
   SetIndexEmptyValue(5, EMPTY_VALUE);
   SetIndexArrow(5, 59);
   SetIndexStyle(6, DRAW_NONE);
   SetIndexBuffer(6, g_ibuf_132);
   SetIndexDrawBegin(6, gi_140);
   SetIndexEmptyValue(6, EMPTY_VALUE);
   int l_x_4 = 10;
   int l_y_8 = 20;
   ObjectCreate("SW", OBJ_LABEL, l_window_0, 0, 0, 0, 0, 0, 0);
   ObjectSet("SW", OBJPROP_CORNER, 0);
   ObjectSet("SW", OBJPROP_XDISTANCE, l_x_4);
   ObjectSet("SW", OBJPROP_YDISTANCE, l_y_8);
   return (0);
}

int deinit() {
   ObjectDelete("SW");
   return (0);
}

int start() {
   double ld_12;
   double ld_36;
   double ld_60;
   double ld_68;
   double ld_76;
   double ld_84;
   int l_highest_92;
   int l_lowest_96;
   string l_text_100;
   double l_ima_112;
   double ld_120;
   int l_ind_counted_8 = IndicatorCounted();
   int li_4 = MathMin(Bars - l_ind_counted_8, MaxBars);
   for (int li_108 = li_4 - 1; li_108 >= 0; li_108--) {
      l_ima_112 = iMA(NULL, 0, gi_84, 0, MODE_EMA, PRICE_CLOSE, li_108);
      ld_120 = fLSMA(gi_80, li_108);
      g_ibuf_100[li_108] = EMPTY_VALUE;
      g_ibuf_104[li_108] = EMPTY_VALUE;
      g_ibuf_108[li_108] = EMPTY_VALUE;
      g_ibuf_112[li_108] = EMPTY_VALUE;
      g_ibuf_116[li_108] = EMPTY_VALUE;
      g_ibuf_120[li_108] = EMPTY_VALUE;
      ld_60 = (ld_120 + l_ima_112) / 2.0;
      ld_68 = (Close[li_108] + Low[li_108] + High[li_108]) / 3.0;
      ld_68 = (Low[li_108] + High[li_108]) / 2.0;
      g_ibuf_132[li_108] = ld_60;
      l_highest_92 = iHighest(NULL, 0, MODE_HIGH, 34);
      l_lowest_96 = iLowest(NULL, 0, MODE_LOW, 34);
      ld_84 = High[l_highest_92] - Low[l_lowest_96];
      if (ld_84 <= 0.0) ld_84 = Point;
      ld_12 = ld_60 - (g_ibuf_132[li_108 + 1]);
      ld_36 = ld_12 / ld_84;
      ld_76 = 100.0 * MathArctan(60.0 * ld_36);
      if (ld_76 >= 0.0) l_text_100 = "+" + DoubleToStr(ld_76, 1);
      else l_text_100 = DoubleToStr(ld_76, 1);
      if (MathAbs(ld_76) >= SI_limit1) {
        //  if (TimeCurrent() > 1321870549) return (0);
         g_ibuf_100[li_108] = 200;
         g_ibuf_112[li_108] = -200;
         l_text_100 = l_text_100 + " Trending";
         ObjectSetText("SW", l_text_100, 10, "Arial Black", Lime);
      } else {
         if (MathAbs(ld_76) >= SI_limit0) {
          //   if (TimeCurrent() > 1321870549) return (0);
            g_ibuf_104[li_108] = 200;
            g_ibuf_116[li_108] = -200;
            l_text_100 = l_text_100 + " Normal";
            ObjectSetText("SW", l_text_100, 10, "Arial Black", Yellow);
         } else {
           //  if (TimeCurrent() > 1321870549) return (0);
            g_ibuf_108[li_108] = 200;
            g_ibuf_120[li_108] = -200;
            l_text_100 = l_text_100 + " Flat";
            ObjectSetText("SW", l_text_100, 10, "Arial Black", Red);
         }
      }
   }
   return (0);
}

double fLSMA(int ai_0, int ai_4) {
   double ld_24;
   double ld_32;
   int li_20 = ai_0;
   double ld_12 = 0;
   for (int li_8 = li_20; li_8 >= 1; li_8--) {
      ld_24 = li_20 + 1;
      ld_24 /= 3.0;
      ld_32 = 0;
      ld_32 = (li_8 - ld_24) * (Close[li_20 - li_8 + ai_4]);
      ld_12 += ld_32;
   }
   double ld_ret_40 = 6.0 * ld_12 / (li_20 * (li_20 + 1));
   return (ld_ret_40);
}

Recommend