Help with this function - page 2

 
bachapk:

I know this topic is closed ... but just wanted to post this tip for the future readers.

If you are getting "zero divide" error in expert log then do the following:

1. Open mq4 file in editor

2. Search for "/"

3. Confirm the denominator is not zero (for manually entered using extern etc) .... or if the denominator is a calculated value then make sure that this is normalized

4. after normalizing the denominator, 99% chance is there that zero divide error would have gone.

4. You can normalize any value with following function

An even better tip . . . . get into the habit of using spaces, so instead of / use space / space and then instead os searching for / and finding all your comments . . . search for space / space and find just the divisions in your code.


Zero is a special case double, there is no need to Normalize . . . 0.0 == 0

 
bachapk:

I know this topic is closed ... but just wanted to post this tip for the future readers.

If you are getting "zero divide" error in expert log then do the following:

1. Open mq4 file in editor

2. Search for "/"

3. Confirm the denominator is not zero (for manually entered using extern etc) .... or if the denominator is a calculated value then make sure that this is normalized

4. after normalizing the denominator, 99% chance is there that zero divide error would have gone.

4. You can normalize any value with following function


What are you talking about?

normalized zero is still zero.

 
Don't use NormalizeDouble for any reason. It's use is always wrong
Reason: