MT4指标改成通达信

来源:百度文库 编辑:神马文学网 时间:2024/04/28 16:42:39

[通达信] 恳请大侠能否将这个外汇MT4指标改成通达信或者博易的....非常感谢

double v1[];
double v2[];
double val1;
double val2;
int i;
  
int init(){
   IndicatorBuffers(2);
//---- drawing settings
   SetIndexArrow(0, 119);
   SetIndexArrow(1, 119);
  
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,0,DarkSlateGray);
   SetIndexDrawBegin(0,i-1);
   SetIndexBuffer(0, v1);
   SetIndexLabel(0,"Resistance");  

   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,0,DarkSlateGray);
   SetIndexDrawBegin(1,i-1);
   SetIndexBuffer(1, v2);
   SetIndexLabel(1,"Support");

   return(0);
}

int start(){
   i=Bars;
   while(i>=0){   
      val1 = iFractals(NULL, 0, MODE_UPPER,i);
      if (val1 > 0)
         v1[i]=High[i];
      else
         v1[i] = v1[i+1];
  
      val2 = iFractals(NULL, 0, MODE_LOWER,i);
      if (val2 > 0)
         v2[i]=Low[i];
      else
         v2[i] = v2[i+1];

      i--;
   }   
   return(0);
}