# 请教热心人，这个指标哪里出错了？

150

```#property copyright "kai"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Yellow
//---- input parameters
double middle[];
int init()
{
//---- indicators
IndicatorBuffers(1);
SetIndexBuffer(0,middle);
return(0);
}
int start()
{
int i,j;
double RC,A,B,C,O;
double a1,a2,a3,b1,b2,b3,c1,c2,c3,d1,d2,d3;
double x1,x2,x3,x4,y1,x1y1,x2y1,n;
//------------------------------------------------------------------
for (i=Bars-1;i>=0;i--)
{
x1=0;x2=0;x3=0;x4=0;y1=0;x1y1=0;x2y1=0;n=0;
for (j=i+26;j>=i;j--)
{
y1+=Close[j];
x1+=j;x2+=j*j;x3+=j*j*j;x4+=j*j*j*j;
x1y1+=j*Close[j];
x2y1+=j*j*Close[j];
n+=1;
}
a1=n;a2=x1;a3=x2;b1=x1;b2=x2;b3=x3;
c1=x2;c2=x3;c3=x4;d1=y1;d2=x1y1;d3=x2y1;
O=a1*(b2*c3-b3*c2)-b1*(a2*c3-a3*c2)+c1*(a2*b3-a3*b2);
A=d1*(b2*c3-b3*c2)-b1*(d2*c3-d3*c2)+c1*(d2*b3-d3*b2);
B=a1*(d2*c3-d3*c2)-d1*(a2*c3-a3*c2)+c1*(a2*d3-a3*d2);
C=a1*(b2*d3-b3*d2)-b1*(a2*d3-a3*d2)+d1*(a2*b3-a3*b2);
if (O==0) RC=Close[i];
else {A=A/O;B=B/O;C=C/O;RC=A+B*i+C*i*i;}
middle[i]=RC;
}
//---
return(0);
}```
150

1637

150

1637

150