Edit Your Comment
How to resolve "Zero Divide"
会员从May 02, 2012开始
15帖子
Jun 06, 2014 at 07:42
会员从May 02, 2012开始
15帖子
Hi guys,
Anyone able to advise on how to resolve this coding to avoid "Zero Divide" error :-
double upbar_upwickvol=((High[a]-Close[a])/avgvol);
double upbar_lowerwickvol=((Open[a]-Low[a])/avgvol);
double upbar_realbodyvol=((Close[a]-Open[a])/avgvol);
Thanking you in advance for the kind assistance.
Best regards.
Anyone able to advise on how to resolve this coding to avoid "Zero Divide" error :-
double upbar_upwickvol=((High[a]-Close[a])/avgvol);
double upbar_lowerwickvol=((Open[a]-Low[a])/avgvol);
double upbar_realbodyvol=((Close[a]-Open[a])/avgvol);
Thanking you in advance for the kind assistance.
Best regards.

forex_trader_25447
会员从Dec 21, 2010开始
127帖子
Jun 06, 2014 at 09:44
会员从Dec 21, 2010开始
127帖子
Make like this :
Mine pleasure.
double upbar_upwickvol=0.0; // Here 0.0 can be ANY number !!!
double upbar_lowerwickvol=0.0;
double upbar_realbodyvol=0.0;
if ( avgvol!=0.0 )
{ upbar_upwickvol =((High[a]-Close[a])/avgvol);
upbar_lowerwickvol=((Open[a]-Low[a])/avgvol);
upbar_realbodyvol=((Close[a]-Open[a])/avgvol);
}
Mine pleasure.

forex_trader_28881
会员从Feb 07, 2011开始
691帖子
Jun 06, 2014 at 09:50
会员从Feb 07, 2011开始
691帖子
@StoneHeart
The High Close Open Low could also be 0, which means not enough history or the data for the pair is not there, iow's the pair is not on this broker.
So @EAcomparison
So open all the pairs you're trying to trade, and make sure you got enough data on the time frame you're trying to trade. Simply drag your charts back a bit.
The High Close Open Low could also be 0, which means not enough history or the data for the pair is not there, iow's the pair is not on this broker.
So @EAcomparison
So open all the pairs you're trying to trade, and make sure you got enough data on the time frame you're trying to trade. Simply drag your charts back a bit.
会员从May 02, 2012开始
15帖子
Jun 06, 2014 at 12:41
会员从May 02, 2012开始
15帖子
StoneHeart posted:
Make like this :
double upbar_upwickvol=0.0; // Here 0.0 can be ANY number !!!
double upbar_lowerwickvol=0.0;
double upbar_realbodyvol=0.0;
if ( avgvol!=0.0 )
{ upbar_upwickvol =((High[a]-Close[a])/avgvol);
upbar_lowerwickvol=((Open[a]-Low[a])/avgvol);
upbar_realbodyvol=((Close[a]-Open[a])/avgvol);
}
Mine pleasure.
STONEHEART, THANK YOU SO MUCH FOR YOUR SOLUTION & IT WORKS PERFECTLY !!!
会员从May 02, 2012开始
15帖子
Jun 06, 2014 at 12:41
会员从May 02, 2012开始
15帖子
TheCyclist posted:
@StoneHeart
The High Close Open Low could also be 0, which means not enough history or the data for the pair is not there, iow's the pair is not on this broker.
So @EAcomparison
So open all the pairs you're trying to trade, and make sure you got enough data on the time frame you're trying to trade. Simply drag your charts back a bit.
TheCyclist, thanks for your advise :)

*商业用途和垃圾邮件将不被容忍,并可能导致账户终止。
提示:发布图片/YouTube网址会自动嵌入到您的帖子中!
提示:键入@符号,自动完成参与此讨论的用户名。