Zero divide

 

Hello,

recently i have the problem with couple of indicators ,they report 'zero divide'

but i am sure there is no division by zero.I checked history and all data is ok.

I tried with other cross then i get that indicator to work but other one reports 'zero divide'.

I suspect that my mt4 is corrupted or i have a virus.

Any one else have same problem ?I would like to avoid reinstallation...

 

the indicators making problems are wccisqeezev2 and Fx sniper sidewinder overlay,they worked normal before

 

Some zero devide fixing example is here https://www.mql5.com/en/forum/172915

May beit will help.

 
Files:
 

Division By zero

I'm sure it has been posted many times, but here is how I usually handle div by zero errors:

bbs = BBDeviation * std / MathMax( diff, 0.000001 );

Hope this helps some.

 

Hi,

thank you all for help,WCCI v2.1 work,no more 'zero divide' errors.

Fxsniper sidewinder overlay is ex4 so i can't fix it but i wonder how it worked before without problems and now it is giving this error ?

 

Zero divide

Dear Guru,

I have download the history (3 years) from Alpari and using its MT4 to test my EA. It works. I do the same thing for IBFX. It shows me the error "zero divide" The funny thing is if I change the period to the latest month (i.e. backtest 1 month only), it works again in IBFX. Anyone knows what happen? I believe it is something related to the history downloaded.

Regards,

Happy Trading

 

...

Zero divide error is exclusively a coding error. Metatrader does not provide a trap (or rather, that message is the trap, and since by definition divide by zero yields to undefined, they chose the terminate the code execution in such cases) for such errors, so if not dealt with within the code it will happen, sooner or later

footy98:
Dear Guru,

I have download the history (3 years) from Alpari and using its MT4 to test my EA. It works. I do the same thing for IBFX. It shows me the error "zero divide" The funny thing is if I change the period to the latest month (i.e. backtest 1 month only), it works again in IBFX. Anyone knows what happen? I believe it is something related to the history downloaded.

Regards,

Happy Trading
 

WCCI Panel Hearth - ZERO DIVIDE

Hi, I have a problem with WCCI panel Heart v2. Indicator worked up until I tried it with another company operating Metatrader. How do you fix it?

Please help me, it's important for me.

 

...

Find in the code every occurrence of division and add before every division a zero condition checking

Something like this :

if (divisor!=0)

result = dividend/divisor;

else result = 0; // or whatever result you prefer here since the result

// of division by 0 by definition is undefined

about the "whatever result" : I prefer the 0 (since the result of division by 0 is undefined, 0 is one of the "valid" results) because it is neutral in the way that it does not assume the sign of the result (so one less assumption compared to +- whatever result)

quest:
Hi, I have a problem with WCCI panel Heart v2. Indicator worked up until I tried it with another company operating Metatrader. How do you fix it? Please help me, it's important for me.
 

WCCI Panel Heart - Zero divide

Hi mladen, thanks for your advice. I tried according to your advice to correct an error, failed. Please find the coding error and post the edited version.

Link for download: 4shared.com - online file sharing and storage - download CCI_Woodie_Panel_Heart_v2.mq4

Please help me...

Reason: