这段代码错在哪里 新评论 [删除] 2009.09.09 08:06 自己编写了一个EA,完成后没有交易。经检查,错误在下面的代码: int start() { //---- double tom1[]; int i; for( i=1;i<=120;i++){ tom1[i]=iStochastic(NULL,0,9,3,3,MODE_SMA,0,MODE_SIGNAL,i); Print("tom1[",i,"]=",tom1[i]); } return } 执行后, print的结果是tom1[]=0!!! 这是为什么? Error on example for iStochastic First EA V. Simple Need Help Stochastic based EA okwh 2009.09.09 10:42 #1 ArrayResize( tom1, 150 ); 因为tom1数组没有分配内存空间,就是说你的数字没地方放。 [删除] 2009.09.09 10:51 #2 DxdCn 写道 >> ArrayResize( tom1, 150 ); 因为tom1数组没有分配内存空间,就是说你的数字没地方放。 谢谢老师。 新评论
自己编写了一个EA,完成后没有交易。经检查,错误在下面的代码:
int start()
{
//----
double tom1[];
int i;
for( i=1;i<=120;i++){
tom1[i]=iStochastic(NULL,0,9,3,3,MODE_SMA,0,MODE_SIGNAL,i);
Print("tom1[",i,"]=",tom1[i]);
}
return
}
执行后,
print的结果是tom1[]=0!!!
这是为什么?