LotStep causing zero divide.
-
Hello,
I had a similar issue 3 years ago but unable to solve on a new EA.
If EA has a live trade and MT4 restarts for whatever reason it throws a Zero Divide due to "LotStep" being set to "0" on restart.
a) It doesn't happen if there is no trade.
b) Manual solution is to add "if(LotStep == 0) LotStep = 0.01;" within the "AlignLots" function manually.Question: Any ideas why this is happening and is there a way for me to add a custom block to insert the fix automatically or would it be possible for FXDreema to add this line into the system code please ?
Many thanks
MantaDiver
-
@mantadiver I'm afraid I'm not a programmer, so I can't help. But I'm curious to understand how that can happen. What calculations are required for a Zero Divide result like that if no open trades are active right now?
-
Indeed, I too would like to understand how it can happen because it is a system function and seemingly not something I have done (although happy to be corrected on that).
I have tried remming out the code "do or do not initialize on reload" in case that helps but it didn't.
The LotStep is defined in the area "System & Custom Functions used in the program", but I cannot tell if it is only activated on startup or on an as needed basis.
It would be a simple fix for fxdrema to insert a catch all to avoid a zero divide. Does fxdrema still frequent the forum or maybe miro ?
Many thanks
-
@mantadiver Sadly the admin does never participate on any forums. However, he reads the bugs forum to see any issue in the platform. I recommend you to open a thread there and at the same time contact him directly to let him know.
Miro is deeply missed too. I don't even know if he's a user anymore.

-
Thanks l'andorra, for such a superb product (and I've tried most of them) it is a little strange that there appears to be a distancing going on.
I guess as long as the server stays up we're all happy.
Thanks for the suggestion, I'll give that a go.
-
@mantadiver Answered this in your other post.