为什么这个简单的指标不能显示?

 

我写了一个简单的指标,但是不能在图上显示出来,能不能帮我看看是什么原因?

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Silver
#property indicator_width1 2


double Z[];


int init()
{

SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexDrawBegin(0,200);
IndicatorDigits(Digits+1);
SetIndexBuffer(0,Z);
SetIndexLabel(0,"Z");
return(0);
}


int start()
{
int F, z;
int limit;
int counted_bars=IndicatorCounted();

if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;

for ( i=0; i<limit; i++ )
{
for (z=0; z<4; z++)
{
F = 15 + z*2;

}
Z[i] = F;
}

return(0);
}

 
orded:

我写了一个简单的指标,但是不能在图上显示出来,能不能帮我看看是什么原因?

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Silver
#property indicator_width1 2


double Z[];


int init()
{

SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexDrawBegin(0,200);
IndicatorDigits(Digits+1);
SetIndexBuffer(0,Z);
SetIndexLabel(0,"Z");
return(0);
}


int start()
{
int F, z;
int limit;
int counted_bars=IndicatorCounted();

if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;

for ( i=0; i<limit; i++ )
{
for (z=0; z<4; z++)
{
F = 15 + z*2;

}
Z[i] = F;
}

return(0);
}

问题已解决,原因是F值为不变值,MT4不显示不变值。