Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 78

 
Artyom Trishkin:
Check if there is a symbol in the market overview. It cannot be zero.

I'm sure it can't be, but here's the moderator's response.2017.01.17 12:09:36.871 CMB2 EURNZD,Daily: zero divide in 'CMB2.mq4' (196,77).

And this is actually line 196 from the code: (iOpen('GBPNZD',p,b)-iClose('GBPNZD',p,b))/MarketInfo('GBPNZD',MODE_POINT)+

 
Gevorg Hakobyan:

I'm sure it can't be, but here's the moderator's response.2017.01.17 12:09:36.871 CMB2 EURNZD,Daily: zero divide in 'CMB2.mq4' (196,77).

And this is actually line 196 from the code: (iOpen("GBPNZD",p,b)-iClose("GBPNZD",p,b))/MarketInfo("GBPNZD",MODE_POINT)+

Is this symbol allowed to trade?

 
Gevorg Hakobyan:

I'm sure it can't be, but here's the moderator's response.2017.01.17 12:09:36.871 CMB2 EURNZD,Daily: zero divide in 'CMB2.mq4' (196,77).

And this is actually line 196 from the code: (iOpen('GBPNZD',p,b)-iClose('GBPNZD',p,b))/MarketInfo('GBPNZD',MODE_POINT)+

It's usually multiplied by Point, there is a number around 0.00001, why do you divide by it, rounding and dividing by zero is possible.
 
Artyom Trishkin:

Is trading allowed on the symbol?

It is an indicator. Why would it be allowed to trade?
 
Vladimir Zubov:
Point is usually multiplied by, there's a number about 0.00001 why you would divide by it, it's possible to round and divide by zero.
Dividing by Point() the difference of two prices gives us nothing more than the same difference, but in points.
 
Gevorg Hakobyan:
It's an indicator. Why would he need permission to trade?
Not for it, but for the symbol. If there is no trade on the symbol on the server from which you are taking the data, then Point() may not be given there either.
 
Gevorg Hakobyan:
It's an indicator. Why does it need permission to trade?
Is there even such a symbol on the server?
 
Artyom Trishkin:
Not him, but the symbol. If there is no trade on the symbol on the server from which you are taking the data, then Point() may not be given there either.
What should you do then?
 
Gevorg Hakobyan:
Then what should be done?
Is there such a symbol in the server symbol list that the indicator stands on?
 
Artyom Trishkin:
Is there such a symbol in the server symbol list that the indicator stands on?
Yes, of course there is.
Reason: