MathRound question
-
I have scoured the forum but nothing that answers this speciifc situation.
I am building an EA to trade USDJPY and one of the conditions needs a round number. So for example, if the actual price is 134.123 I need 134, and if it is 134.567 I need 135.
How do I achieve this in the actual condtion box? Do I need customer code (never used that before)?
-
you have to search for MathCeil and MathFloor
https://fxdreema.com/forum/topic/4454/draw-horizontal-line-and-calculate-round-numbers-from-open-price/3 -
@Tulefi
Maybe you can define a new variable and then using the Modify Variable blocknew_price = MathRound(original_price)
-
Thank you. I tried the customer code and it seems to work!!