下载MetaTrader 5
要添加评论,请登录注册
粘贴付费信号的网络链接。接收伙伴的共享!
BinBin Lu
68
BinBin Lu 2009.09.13 01:46 

请教Rosh老师:

我在测试时系统提示以下信息:

2009.08.07 13:30 WYD_13n EURUSD,M30:zero divide

不知是什么意思,是什么原因造成的?能指导指导我吗?谢谢!

出现上述事件是基于EA中有以下代码:

int iMarketPath() {
// 放弃管理
if( nMarketAllowPath == -100 ) { return(-100); }
double nMain,nSignal;
int nMarketGoto;
nMain = iMACD(cRunSymbol,1440,12,26,9,0,MODE_MAIN,0) - iMACD(cRunSymbol,1440,12,26,9,0,MODE_MAIN,1);
nSignal = iMACD(cRunSymbol,1440,12,26,9,0,MODE_SIGNAL,0) - iMACD(cRunSymbol,1440,12,26,9,0,MODE_SIGNAL,1);
if( nMain*nSignal<=0 ) { nMarketGoto=-1; }
else {
if( nMain>0 || nSignal>0 ) { nMarketGoto=0; }
if( nMain<0 || nSignal<0 ) { nMarketGoto=2; }
}
if( nMarketGoto==-1 ) {
nMain = iMACD(cRunSymbol,240,12,26,9,0,MODE_MAIN,1) - iMACD(cRunSymbol,240,12,26,9,0,MODE_MAIN,2);
nSignal = iMACD(cRunSymbol,240,12,26,9,0,MODE_SIGNAL,1) - iMACD(cRunSymbol,240,12,26,9,0,MODE_SIGNAL,2);
if( nMain*nSignal<=0 ) { return(-1); }
if( nMain>0 || nSignal>0 ) { return(0); }
if( nMain<0 || nSignal<0 ) { return(2); }
}
//------
return(nMarketGoto);
}
若使用以下代码,则上述提示消失,并测试正常:

int iMarketPath() {
// 放弃管理
if( nMarketAllowPath == -100 ) { return(-100); }
double nMain,nSignal;
nMain = iMACD(cRunSymbol,1440,12,26,9,0,MODE_MAIN,0) - iMACD(cRunSymbol,1440,12,26,9,0,MODE_MAIN,1 );
nSignal = iMACD(cRunSymbol,1440,12,26,9,0,MODE_SIGNAL,0) - iMACD(cRunSymbol,1440,12,26,9,0,MODE_SIGNAL,1);
if( nMain*nSignal<0 ) { return(-1); }
if( nMain>0 || nSignal>0 ) { return(0); }
if( nMain<0 || nSignal<0 ) { return(2); }
//------
return(-1);
}


谢谢!

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