Hello,
I was wondering if anyone can shed light on the following error:
Would appreciate suggestions on how to fix it.
There is plenty of margin available and the lot size I used is 0.03
Much appreciated,
Thanks,
B
You'll need to show your code, or at least the relevant parts.
Hi Honest_Knave
I'm not sure what the relevant parts are and the EA is rather long.
Can I perhaps message you and attach the EA or would you rather I try paste some of the code here?
Just to add to my earlier message. Despite the error, the EA does fill the order later but it's normally a good 10 to 30 minutes later and obviously at the wrong price
Regards,
B
Hello,
I was wondering if anyone can shed light on the following error:
Would appreciate suggestions on how to fix it.
There is plenty of margin available and the lot size I used is 0.03
Much appreciated,
Thanks,
B
You have either to use OrderLots() to close a full position or
to normalize your lot size this way :
lots=MathRound(lots/lotStep)*lotStep;
You have either to use OrderLots() to close a full position or
to normalize your lot size this way :
lots=MathRound(lots/lotStep)*lotStep;
Perhaps add the check
lots=MathRound(lots/lotStep)*lotStep;
if(lots>OrderLots())
lots=OrderLots();
Thank you all for your contributions.
Greatly appreciated

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I was wondering if anyone can shed light on the following error:
Would appreciate suggestions on how to fix it.
There is plenty of margin available and the lot size I used is 0.03
Much appreciated,
Thanks,
B