有关POLO的多空线转成MT4的源码问题

楼主  收藏   举报   帖子创建时间:  2019-05-05 15:32 回复:0 关注量:205
因本人刚转学MT4编程(之前用POLO),刚开始模拟使用MT4,还很吃力,请论坛里面高手帮忙修改下这个MT4的多空线指标源码,请把里面的蓝色线去掉或隐藏即可,有请各位大虾援手!附图为源码和贴图:
  
  
  #property indicator_chart_window
  #property indicator_buffers 3
  #property indicator_color1 blue
  #property indicator_color2 Yellow
  #property indicator_color3 Red
  
  extern int iMaPeriod = 10;
  extern int iSep = 30;
  double g_ibuf_84[];
  double g_ibuf_88[];
  double g_ibuf_92[];
  
  int init() {
     SetIndexStyle(0, DRAW_LINE);
     SetIndexStyle(1, DRAW_LINE);
     IndicatorDigits(Digits + 1);
     SetIndexStyle(2, DRAW_LINE);
     SetIndexBuffer(0, g_ibuf_84);
     SetIndexBuffer(1, g_ibuf_88);
     SetIndexBuffer(2, g_ibuf_92);
     IndicatorShortName("DKX(" + iMaPeriod + ")");
     SetIndexLabel(0, "MID");
     SetIndexLabel(1, "DKX");
     SetIndexLabel(2, "DKXMa");
     return (0);
  }
  
  int deinit() {
     return (0);
  }
  
  int start() {
     double ld_4 = 0;
     int li_12 = IndicatorCounted();
     if (li_12 < 0) return (-1);
     if (li_12 > 0) li_12--;
     int li_0 = Bars - li_12;
     for (int li_16 = 0; li_16 < li_0; li_16++) {
        g_ibuf_84[li_16] = (3.0 * Close[li_16] + Low[li_16] + Open[li_16] + High[li_16]) / 6.0;
        Print(li_16 + ":  " + g_ibuf_84[li_16]);
     }
     for (li_16 = 0; li_16 < li_0; li_16++) {
        ld_4 = 0;
        for (int l_count_20 = 0; l_count_20 < 20; l_count_20++) ld_4 += (20 - l_count_20) * (g_ibuf_84[l_count_20 + li_16]);
        g_ibuf_88[li_16] = ld_4 / 210.0;
        Print("DKX:" + li_16 + "  " + g_ibuf_88[li_16]);
     }
     for (li_16 = 0; li_16 < li_0; li_16++) g_ibuf_92[li_16] = iMAonArray(g_ibuf_88, Bars, iMaPeriod, 0, MODE_SMA, li_16);
     return (0);
  }
打赏