有您的持续关注
我们会做得更好

顶底显示指标TanganJiwa



TanganJiwa指标显示行情的每一个高点或低点。由于实际波动中高低点在不断的更新调整,所以TanganJiwa不可以直接成为开仓的依据,可以参考编程技巧或结合其它分析方法使用。

TanganJiwa指标图表效果如下:MT4指标TanganJiwa

TanganJiwa指标源码如下:

//+------------------------------------------------------------------+
//|                                                   TanganJiwa.mq4 |
//|                                     Copyright 2016, QQ:125808047 |
//+------------------------------------------------------------------+
#property copyright "www.125808047.com"
#property link      "http://www.125808047.com/"

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

extern int ExtDepth = 12;
extern int ExtDeviation = 5;
extern int ExtBackstep = 3;
double g_ibuf_88[];
double g_ibuf_92[];
int gi_96;
int gi_100;

int init() {
   IndicatorBuffers(2);
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0, 73);
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexArrow(1, 73);
   SetIndexBuffer(0, g_ibuf_88);
   SetIndexBuffer(1, g_ibuf_92);
   SetIndexEmptyValue(0, 0.0);
   IndicatorShortName("ZigZag(" + ExtDepth + "," + ExtDeviation + "," + ExtBackstep + ")");
   return (0);
}

int start() {
   double ld_16;
   double ld_24;
   double ld_32;
   double ld_40;
   double ld_48;
   double ld_56;
   int li_unused_64;
   int li_68;
   int li_72;
   for (int li_0 = Bars - ExtDepth; li_0 >= 0; li_0--) {
      ld_16 = Low[iLowest(NULL, 0, MODE_LOW, ExtDepth, li_0)];
      if (ld_16 == ld_56) ld_16 = 0.0;
      else {
         ld_56 = ld_16;
         if (Low[li_0] - ld_16 > ExtDeviation * Point) ld_16 = 0.0;
         else {
            for (int li_4 = 1; li_4 <= ExtBackstep; li_4++) {
               ld_24 = g_ibuf_88[li_0 + li_4];
               if (ld_24 != 0.0 && ld_24 > ld_16) g_ibuf_88[li_0 + li_4] = 0.0;
            }
         }
      }
      g_ibuf_88[li_0] = ld_16;
      ld_16 = High[iHighest(NULL, 0, MODE_HIGH, ExtDepth, li_0)];
      if (ld_16 == ld_48) ld_16 = 0.0;
      else {
         ld_48 = ld_16;
         if (ld_16 - High[li_0] > ExtDeviation * Point) ld_16 = 0.0;
         else {
            for (li_4 = 1; li_4 <= ExtBackstep; li_4++) {
               ld_24 = g_ibuf_92[li_0 + li_4];
               if (ld_24 != 0.0 && ld_24 < ld_16) g_ibuf_92[li_0 + li_4] = 0.0;
            }
         }
      }
      g_ibuf_92[li_0] = ld_16;
   }
   ld_48 = -1;
   int li_8 = -1;
   ld_56 = -1;
   int li_12 = -1;
   for (li_0 = Bars - ExtDepth; li_0 >= 0; li_0--) {
      ld_32 = g_ibuf_88[li_0];
      ld_40 = g_ibuf_92[li_0];
      if (ld_32 == 0.0 && ld_40 == 0.0) continue;
      if (ld_40 != 0.0) {
         if (ld_48 > 0.0) {
            if (ld_48 < ld_40) g_ibuf_92[li_8] = 0;
            else g_ibuf_92[li_0] = 0;
         }
         if (ld_48 < ld_40 || ld_48 < 0.0) {
            ld_48 = ld_40;
            li_8 = li_0;
         }
         ld_56 = -1;
      }
      if (ld_32 != 0.0) {
         if (ld_56 > 0.0) {
            if (ld_56 > ld_32) g_ibuf_88[li_12] = 0;
            else g_ibuf_88[li_0] = 0;
         }
         if (ld_32 < ld_56 || ld_56 < 0.0) {
            ld_56 = ld_32;
            li_12 = li_0;
         }
         ld_48 = -1;
      }
   }
   for (li_0 = Bars - 1; li_0 >= 0; li_0--) {
      if (li_0 >= Bars - ExtDepth) g_ibuf_88[li_0] = 0.0;
      else {
         ld_24 = g_ibuf_92[li_0];
         if (ld_24 != 0.0) g_ibuf_92[li_0] = ld_24;
      }
      li_unused_64 = 0;
      for (int index_76 = 0; g_ibuf_88[index_76] == 0.0 && g_ibuf_92[index_76] == 0.0; index_76++) {
      }
      li_68 = index_76;
      for (index_76++; g_ibuf_88[index_76] == 0.0 && g_ibuf_92[index_76] == 0.0; index_76++) {
      }
      li_72 = index_76;
      if (gi_96 != li_68 || gi_100 != li_72) {
         if (gi_96 > li_68 && gi_100 > li_72) Alert("Akan berlaku perubahan arah... (M", Period(), " ", Symbol(), ")");
         gi_96 = li_68;
         gi_100 = li_72;
      }
      if (gi_96 != li_68 || gi_100 != li_72) {
         if (gi_96 < li_68 && gi_100 < li_72) Alert("Akan berlaku perubahan arah... (M", Period(), " ", Symbol(), ")");
         gi_96 = li_68;
         gi_100 = li_72;
      }
   }
   return (0);
}

如您喜欢此文章请点下面分享按钮↴峰汇在线 » 顶底显示指标TanganJiwa
上一篇:
下一篇:
分享到:更多 ()