下载MetaTrader 5
要添加评论,请登录注册
您想要编写技术指标吗?在MQL5 参考中找出解决方案!
Jinsong Zhang
14618
Jinsong Zhang 2008.09.16 06:38 

编译时出错: wrong parameters count

是不是因为FileWrite 里的内容太多了?似乎每行只能写入65个数据, 有办法解决吗?

Greatshore
90
Greatshore 2008.09.16 06:51  
记得FileWrite括号里的变量数最多为64个,你可以分成多个FileWrite写。
Jinsong Zhang
14618
Jinsong Zhang 2008.09.16 09:04  
谢谢。分成多个FileWrite写就会有好多行,可以让它们在一行里显示吗?
Jinsong Zhang
14618
Jinsong Zhang 2008.09.16 09:58  
//如果filewrite每次只能写入64个数据,超过的话就要多次使用filewrite,问题又来了,这样的话会分成很多行,但我希望能一行显示,请高手指点下
//放入脚本中测试


void start(){
logwrite_open();
}

void logwrite_open(){
int songrecord;
songrecord=FileOpen("guide_open.csv", FILE_CSV|FILE_WRITE|FILE_READ,',');
if(songrecord>0){
FileSeek(songrecord,0,SEEK_END);
if(FileTell(songrecord)<1){
FileWrite(songrecord,
"Point" //.... 假设这里有超过64个字段,则必须多写一次filewrite
);
FileWrite(songrecord,
"Open[1]","High[1]","Low[1]","Close[1]","Open[2]","High[2]","Low[2]","Close[2]" //这里会与上面的字段分开2行,但我希望实现与上面的合并成一行
);
FileWrite(songrecord,
Point
);
FileWrite(songrecord,
Open[1],High[1],Low[1],Close[1],Open[2],High[2],Low[2],Close[2]
);
}
FileClose(songrecord);
}

}
Greatshore
90
Greatshore 2008.09.16 12:02  

试试写完一行调用FileSeek(songrecord, -2, SEEK_CUR);

不确定能不能行

Jinsong Zhang
14618
Jinsong Zhang 2008.09.17 05:12  

真的可以哦!谢谢~~

/
要添加评论,请登录注册