新人求教 自己做了个求每日高低价差的指标,编译结果: 无错误无警告,但是指标窗口是空白的 求解

 
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1
//--- plot Average
#property indicator_label1  "Average"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- indicator buffers
double         AverageBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int start()
  {
  double iHigh[];
  double iLow[];
   

SetIndexBuffer(0,AverageBuffer1);

   for(int i=0;i<Bars;i++)
   AverageBuffer1[i]=iHigh[i]-iLow[i];
   
   return(0);
  }


 
SWEETBOY1990:



#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1
//--- plot Average
#property indicator_label1  "Average"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- indicator buffers
double         AverageBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   SetIndexBuffer(0,AverageBuffer1);
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   int i,limit;
   if(prev_calculated>0) limit=2; else limit=Bars;
   for(i=0;i<limit;i++)
      AverageBuffer1[i]=iHigh(Symbol(),Period(),i)-iLow(Symbol(),Period(),i);
   return(rates_total);
  }
 
boolapi:


这是什么,看不懂
 
加QQ:752813661解决
 
SWEETBOY1990:


不要用脚本的模板编写指标。

 
问题已经解决, 谢谢大家!
 
xiayusx2012:
这是什么,看不懂
你看不懂,我们就放心了