Solved___How to find the Highest Value of variables
-
For Example : I have 10 variables (with value in it) I want to find the highest value of these 10 variables.
I have used MathMax but it compares only between 2 variables.Please help .
-
@namfon122 You need an array to do that. Sadly the only way to create arrays in fxDreema is via custome code. You will need a real programmer to do it, I'pm afraid.
-
@l-andorrà thank you to let me know ... I will wait if someone could show me the code...
️ -
Actually I just found this code.
https://docs.mql4.com/array/arraymaximumI think this is what I want but I really don't know what I have to put in.
- I have 24 variables C1 C2 C2........to C24 (each value is from the last 24 Candle tick volume.)
- I want to find the Highest value of C1 - C24 and put it into variable " MaxValue "
And then I can do something with that MaxValue Candle.
The code from the above link :
void OnStart()
{
//---
double num_array[15]={4,1,6,3,19,4,2,6,3,9,4,5,6,3,9};
int maxValueIdx=ArrayMaximum(num_array,WHOLE_ARRAY,0);
Print("Max value = ",num_array[maxValueIdx]," at index=",maxValueIdx);
}I don't know which one is the Variable I have to Add.
For Example : "num_array" is a variable I have to add right??? " ArrayMaximum" in the above code is a variable? or just a code . -
if you have 10 variables it easier to write a long if && in custom code.
-
Solved !!!
I got the highest volume last 24 candle by this codeMaxvolume = MathMax(MathMax(MathMax(MathMax(cd1,cd2),cd3),cd4),cd5)
Thanks for all help.
-
@namfon122 Very interesting! Thanks for sharing.