Ok. Tried a rough draft with this coding, and recieved ordersend error 131 (invalid lot size.) Here's what I have;
if (Lotsize < 10000) Lotsize = 10000; else
if (Lotsize > 10000 && Lotsize < 20000) Lotsize = 10000; else
if (Lotsize > 20000 && Lotsize < 30000) Lotsize = 20000; else
if (Lotsize > 30000 && Lotsize < 40000) Lotsize = 30000; else
if (Lotsize > 40000 && Lotsize < 50000) Lotsize = 40000; else
if (Lotsize > 50000 && Lotsize < 60000) Lotsize = 50000; else
if (Lotsize > 60000 && Lotsize < 70000) Lotsize = 60000; else
if (Lotsize > 70000 && Lotsize < 80000) Lotsize = 70000; else
if (Lotsize > 80000 && Lotsize < 90000) Lotsize = 80000; else
if (Lotsize > 90000 && Lotsize < 100000) Lotsize = 90000; else
if (Lotsize > 100000 && Lotsize < 110000) Lotsize = 100000;
double Lotsize = AccountBalance() /Aggresion;
I am assuming that with the divisor variable it is not recognizing the minimum lotsize as 10000. Where am I going wrong?
double Lotsize = (AccountBalance()/Aggression);
if(Lotsize < 10000) Lotsize = 10000; else Lotsize=MathFloor(Lotsize/10000)*10000;

- 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 again everyone!
I am trying to put in a function so that my lot sizes are always at 10000 increments. In theory;
if (Lotsize < 10,000) Lotsize = 10,000; else
if (Lotsize > 10,000 && Lotsize < 20,000) Lotsize = 10,000; else
if (Lotsize > 20,000 && Lotsize < 30,000) Lotsize = 20,000; else
etc..
Is this the correct format for what I am trying to accomplish?