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

指标 ForexTrend_v2



ForexTrend_v2指标图表效果:ForexTrend_v2指标ForexTrend_v2指标源码:

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

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 DeepSkyBlue
#property indicator_color2 Red

extern int SSP = 7;
extern double Kmax = 50.6;
extern int CountBars = 3000;
double g_ibuf_92[];
double g_ibuf_96[];
double g_ibuf_100[];
double g_ibuf_104[];

int init() {
   IndicatorBuffers(4);
   SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   SetIndexBuffer(0, g_ibuf_100);
   SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   SetIndexBuffer(1, g_ibuf_104);
   SetIndexBuffer(2, g_ibuf_92);
   SetIndexBuffer(3, g_ibuf_96);
   IndicatorShortName("Thinking(" + SSP + ")");
   return (0);
}

int deinit() {
Comment("www.125808047.com");
   return (0);
}

int start() {
   double ld_8;
   double ld_16;
   double ld_32;
   if (CountBars >= Bars) CountBars = Bars;
   SetIndexDrawBegin(0, Bars - CountBars + SSP);
   SetIndexDrawBegin(1, Bars - CountBars + SSP);
   int l_ind_counted_4 = IndicatorCounted();
   if (Bars <= SSP + 1) return (0);
   if (l_ind_counted_4 < SSP + 1) {
      for (int li_0 = 1; li_0 <= SSP; li_0++) g_ibuf_92[CountBars - li_0] = 0.0;
      for (li_0 = 1; li_0 <= SSP; li_0++) g_ibuf_96[CountBars - li_0] = 0.0;
   }
   for (li_0 = CountBars - SSP; li_0 >= 0; li_0--) {
      ld_8 = High[iHighest(NULL, 0, MODE_HIGH, SSP, li_0 - SSP + 1)];
      ld_16 = Low[iLowest(NULL, 0, MODE_LOW, SSP, li_0 - SSP + 1)];
      ld_32 = ld_8 - (ld_8 - ld_16) * Kmax / 100.0;
      g_ibuf_92[li_0 - SSP + 6] = ld_32;
      g_ibuf_96[li_0 - SSP - 1] = ld_32;
   }
   for (int li_40 = CountBars - SSP; li_40 >= 0; li_40--) {
      if (g_ibuf_92[li_40] > g_ibuf_96[li_40]) {
         g_ibuf_100[li_40] = 1;
         g_ibuf_104[li_40] = 0;
      } else {
         g_ibuf_100[li_40] = 0;
         g_ibuf_104[li_40] = 1;
      }
   }
   return (0);
}

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