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 :)
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%.