Absolute Value Function
-
fxDreema is there a way of creating the absolute value of a variable?
For example: The absolute value of (3-5)=2
I want to take the difference of the current bar(0) close from the close 10 bars ago and make it so that all are positive in case they are negative after subtracting.
-
There are no conversion blocks, but the native MQL4 functions are not hard to use:
http://docs.mql4.com/math/mathabsMathAbs(3-5) should give you 2.
-
I am looking for the same more or less, where to put that?
example:
Current price should be below or above an indicator value not more than for e.g. 10 pips
If I use a formula block
on the left side the indicator
operator minus
on the right side the priceis half the way.
Where can i put the MathAbs function call now?
Or any other szenario where i want to use MathAbs or any other MT4 function.
-
MQL functions can be used everywhere, all input fuelds in all blocks accept MQL code. The problem is that MathAbs() accepts input parameter between ( and ) and this parameter must be also written manually. If Variable is used it will not look as the blue thing. It will look like this: http://prntscr.com/9f2sil
-
Not clearly explained

Which varname should be written there?
-
The one from which you want to get absolute value