好不辛苦自编了一个指标,请教各位高手

楼主  收藏   举报   帖子创建时间:  2019-05-05 15:32 回复:0 关注量:795
小弟自学编程1个月左右,好不容易编了一个指标,但出现了些问题,指标如下:
  #property indicator_chart_window
  #property indicator_buffers 2
  #property indicator_color1 Black
  #property indicator_color2 Black
  #property indicator_width1 1
  #property indicator_width2 1
  extern int 均线=20;
  int mark=0;
  double mk1[],mk2[];
  double temp0,temp1;
  int init()
  {IndicatorBuffers(2);
   SetIndexBuffer(0,mk1);
   SetIndexBuffer(1,mk2);
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(0,233);
   SetIndexArrow(1,234);
   IndicatorDigits(Digits);
   return(0);
   }
  int start()
   {int limit;
    int counted_bars=IndicatorCounted();
    if(counted_bars>0) counted_bars--;
    limit=Bars-counted_bars-均线;
    for(int i=0;itemp0
        &&iMA(NULL,0,均线,0,MODE_SMA,PRICE_CLOSE,i)>iMA(NULL,0,均线,0,MODE_SMA,PRICE_CLOSE,i+1)
        &&mark!=1) {mk1<i>=Close(i);mark=1;}
     if(Close(i)
打赏