for example: 3 variables are var1,var2 and var3 and additional variable called smallest.
if(var1<var2) smallest=var1;
else smallest=var2;
if (var3<smallest) smallest=var3;
I think that is something that is missing from MT4's math routines.
You can use the MathMin(Var1, Var2) in a loop to do this. It sucks to do something complicated for something that simple. I with MT people provide us with a built in Highest and Lowest routine for any number. Currently, it can only do that for the OHLC type of values.
Ok, thought there is a small functionn out there for that....
Say it are five variables... how to it then?
ThanksThe following snippet can be used for any fixed number of variables:
double min = ArrayMinimum( values );
double min = ArrayMinimum( values );
[/PHP]Ok, I have PDiff, S1Diff, ... variables (double). Now I tried:
[PHP]double values[] = { PDiff, S1Diff, S2Diff, R1Diff, R2Diff };
double min = ArrayMinimum( values );but get
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I have three variables (values of this variables are for example: 68, 25, 93). Now I will only show the smallest one of them in the indicator window.
How can I check this three variables so I get back the smallest one?
Thanks