MathsRound

 

Hello

I am very new here and have been trying to round this value using MathsRound but can't get it to work.

+DoubleToStr(AccountEquity()*LotsPercentage/100/1000,2), 10, "Times New Roman", LightGray);

The value shows on the chart as 0.01, 0.02 etc but when you get to higher lot sizes it shows say 0.13, 0.17 etc

I would like the higher lot sizes to round to the nearest number say 0.13 rounds to 0.10, 0.17 rounds to 0.20.

Is this possible.

Any help would be greatly appreciated.

Thanks

George

 

Just divide by 10 first, do the rounding, and multiply by 10... that will get rid of the last decimal (it will be zero).

Or use NormalizeDouble()

 

I have tried NormalizeDouble(AccountEquity()*LotsPercentage/100/1000,2), 10, "Times New Roman", LightGray);

but it just reads 0.01000000, how do I restrict it to 2 digits.

 
build1team:

Hello

I am very new here and have been trying to round this value using MathsRound but can't get it to work.

+DoubleToStr(AccountEquity()*LotsPercentage/100/1000,2), 10, "Times New Roman", LightGray);

The value shows on the chart as 0.01, 0.02 etc but when you get to higher lot sizes it shows say 0.13, 0.17 etc

I would like the higher lot sizes to round to the nearest number say 0.13 rounds to 0.10, 0.17 rounds to 0.20.

Is this possible.

Any help would be greatly appreciated.

Thanks

George

change the 2 to a 1

DoubleToStr(AccountEquity()*LotsPercentage/100/1000,2)

 

Tried that as well, then you don't see micro lot sizes 0.07 showing as 0.1

Not sure if this is possible think I will just leave it as is.

Thanks for your help

Reason: