Zero Divide Error With Brokers Using 1 Lot Minimum
-
Hi,
I have an EA which I built to trade stock indices and it works fine on all my normal brokers I use but there is one broker who forces you to use 1 lot increments and the EA just gives a 0 divide error. I've tested the EA on their FX pairs (allowing 0.01s) and it works fine so have narrowed it down to the fact they only allow 1.00 lots on the indices.
The error is thrown up in this line in the code generated by FXDreema:
size=MathRound(size/LotStep)*LotStep;
I assume thats to do with the lotstep but having searched through the forum for this Zero Divide error I can't find any solution that seems to work. Have a tried a few.
The EA doesn't use a stop loss and I even have it set to trade fixed lots and even when I set the lot size to 1 it still throws up the error.
Anyone have any ideas on a fix?
-
Can you please share the link to the project?