请高手帮忙看看我KDJ指标的代码错在哪里?

 

double TheJ_value(double ArrJ[],double KdjPeriod)
{
int i,counted_bars;
//---- insufficient data
if(Bars<=KdjPeriod) return(0);
//---- bars count that does not changed after last indicator launch.
counted_bars=IndicatorCounted();
//----KDJ Range calculation
i=Bars-KdjPeriod-1;
if(counted_bars>KdjPeriod)
i=Bars-counted_bars-1;
while(i>=0)
{
MaxHigh=High[iHighest(NULL,0,MODE_HIGH,KdjPeriod,i)];
MinLow=Low[iLowest(NULL,0,MODE_LOW,KdjPeriod,i)];
RSV[i]=(Close[i]-MinLow)/(MaxHigh-MinLow)*100; //get RSV value
Ksma(RSV,M1); //get K value
Dsma(K,M2); //get D value
ArrJ[i]=3*K[i]-2*D[i]; //get J value 该句有问题
i--;
}
}

编译报错为:

'ArrJ' - array item cannot be assigned E:\Program Files\tool\MT4china专用\experts\indicators\kdj.mq4 (96, 7)

 

double TheJ_value(double &ArrJ[],double KdjPeriod)改成这样就行了

 
还真行了,高,可为什么啊?
 
还真行了,高,可为什么啊?
 
还真行了,高,可为什么啊?
原因: