How to roundup numbers
-
I am printing the Stochastic value on a dashboard through a variable but the value comes with many decimal points. I just need to round up. Upon searching MQL, I found the following function but I dont know how to use this on fxdreema. I want to roundup the value and store into a variable which is printed on the dashboard. Hope someone can help
MathRound
The function returns a value rounded off to the nearest integer of the specified numeric value.double MathRound(
double value // value to be rounded
); -
The easiest way is by using a "Custom MQL code" block

Add the MQL function inside the block

It is posible to add the MQL code in fields of some blocks but I think this is the simpliest way.
-
Great! thank you for quick reply
-
@josecortesllobat hi, i do the following and it doesn't work for me, digits keep appearing on the graph. Really, what I want is to round to only 2 digits.
Thank you very much in advance

-
@ajmd97fx Maybe this can help:
https://fxdreema.com/forum/topic/8188/how-can-i-round-a-number/2