Download MetaTrader 5

FXCM - Tick Value is wrong - compromise? - page 2

To add comments, please log in or register
JC
1592
JC  
DomGilberto:
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.

Dominic Gilbert
1639
Dominic Gilbert  

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

JC
1592
JC  
DomGilberto:

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

whroeder1
16279
whroeder1  
I agree, going up to minlot can greatly exceed your risk tolerance. My NormalizeLots uses MathRound instead of floor before checking minlot. This allows 1/2 a lotstep above max risk as a compromise in marginal trades.
12
To add comments, please log in or register