help to program this indicator

 

Can anyone help me to fix this code? I just need to output the array "theIndicator[]" to the buffer, but it wont display.

any help is appreciated. thanks.

int start()
{
int counted_bars=IndicatorCounted();
double theIndicator[];

int pos = Bars-counted_bars-1;
theIndicator[pos]=Close[pos];

while(pos>=0)
{
pos--;
theIndicator[pos] = Close[pos]*0.08 + (theIndicator[pos+1]*(1-0.08));
}

pos = Bars-counted_bars-1;
while(pos>=0)
{
ExtMapBuffer1[pos]=theIndicator[pos];
pos--;
}

return(0);
}

 

define theIndicator[] above start(), and in init() define it as an indicator buffer. Look at examples of indicators.

Reason: