I'm implementing a function to calculate volume to trade according to a fix percentage of potential loss in comparison to total equity.
My problem is that im getting invalid volume since it have a lot of digits. I already tried using Mathround and mathceil/floor and it keep with a lot of digits.
After function has passed:
thanks in advance ! :)
At first function MathCeil() doesn't change argument value (argument is passing by value). To get result is returned by MathCeil() you should use statement like this:
Finally why don't you use function NormalizeDouble()?