I have slight problems with digesting piece of code posted in Mql Book.:
1. What exactly did happen in function MathFloor (apart from finding the nearest integer number lower than value placed between brackets)? Are the multipliy'ing signs omited or it's totally different operation?
2. I've got another, quite ridiculous and shameful question. I don't know what is this step to change lots variable for. Is that mean, for instance, that with minimum lot=0.1, and step =0.02 i can open orders for 1.2;1.4;...;1+n*.02 lots? How does it work?
Sorry for that newbie topic. I would be utterly grateful, if you could answer me (with possibly low level of hatred), before wiping it out from this forum ;)
1. the contents of the brackets is evaluated and MathFloor is performed on the result.
2. You Broker only allows Lot sizes in multiples of LotStep. If LotStep is 0.02 then you can have lots of 1.02, 1.20, 1.22 but not 1.23, in other words, your lot sizes can be MODE_MINLOT + n*MODE_LOTSTEP
- your lot sizes can be MODE_MINLOT + n*MODE_LOTSTEPCorrect.
- You posted
Likely you meantdouble Lot=MathFloor(Free*ProtsOne_LotStep)*Step;// Lots
double Lot=MathFloor(Free*Prots*One_Lot/Step)*Step;// Lots
- However, what you probably want is Contract Size - MQL4 forum
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have slight problems with digesting piece of code posted in Mql Book.: