So there is something called lot step. For example, if the lot step is 0.01, you can open 0.01, 0.02, 0.03... lots. If the lot step is 0.1, you can open 0.1, 0.2, 0.3 and so on. Lot step is the difference between two possible lot sizes. If you try some middle value, for example 0.012345, it will give you an error. So the EA that is generated would always use possible values. If your balance is 2641 and the lot size is calculated as 0.02641, this value is then rounded to the nearest possible. I guess that I used MathRound(). But as roar wrote, you can always write your own function. Some functions that you can use are AccountBalance(), AccountEquity(), MathFloor(), MathCeil() and MarketInfo() if you want to get the lot step. Take a look at their description in the documentation for MQL4 in MetaEditor (Help -> MQL4 Reference)