You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Anyone...? I swear my formula is right, yet this is returning "0.0"
You are doing a MathFloor() on LotSize_Sell, and therefore 16.4532 / 20.3047 gets rounded down to zero.
Thanks I took a break from it and realised my rookie error!
I have since fixed it so that if it's < minlot the LotSize = minlot. I assume MathCeil() rounds it up?
Thank you kindly for your help :)
I have since fixed it so that if it's < minlot the LotSize = minlot. I assume MathCeil() rounds it up?
Yes, MathCeil() rounds up.
But the use of MathFloor() and the resulting zero tells you something useful: you cannot place a trade without breaking your money management rules. If you saying that you want an s/l at X pips and you are prepared to risk $Y or (Z% of equity/balance), then a resulting lot size less than the minimum means that your trade is riskier than you want to allow. Or your s/l is too wide. Using MathCeil() will mean that you routinely risk more than $Y or Z%.