double NZDCADbid=0,88766 double EURGBPbid=0,89777 double num_array[2]; num_array[0] = NZDCADbid; num_array[1] = EURGBPbid; double maxValueIdx= ArrayMaximum(num_array,WHOLE_ARRAY,0);
- When you post code please use the SRC button! Please edit your post.
General rules and best pratices of the Forum. - General - MQL5 programming forum double maxValueIdx= ArrayMaximum(num_array,WHOLE_ARRAY,0);
Perhaps you should read the manual. The function does not return a double.
Array Functions / ArrayMaximum - Reference on algorithmic/automated trading language for MetaTrader 5
//In MQL4 we can simply do this int maxIndex = ArrayMaximum(High,4,0); // Will return the index of highest values in the High array (default timeseries bar data in mql4)
How can we do this in MQL5 as there are no such arrays. Using MqlRates didn't helped either.
There is no predefined array High[] so you get the values into an array.
Perhaps you should read the manual. CopyHigh
How To Ask Questions The Smart Way. 2004
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
You can use iHighest()
Yes thanks. I tried this already before coming back to this post. It worked. Thanks BTW.
There is no predefined array High[] so you get the values into an array.
Perhaps you should read the manual. CopyHigh
How To Ask Questions The Smart Way. 2004
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
Yeah I tried this too by copying the data but it wasn't so efficient. iHighest() worked perfectly. Thanks for help any how.
You didn't ask how to find the highest. You asked for a replacement of High[]
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, I want to find the max value from several variables that are symbols which change constantly:
double NZDCADbid=MarketInfo("NZDCAD",MODE_BID); //0.89451
double EURGBPbid=MarketInfo("EURGBP",MODE_BID);//0.88951
So I have tried to replace numbers 4 & 9:
double num_array[2]={4,9};
int maxValueIdx=ArrayMaximum(num_array,WHOLE_ARRAY,0);
double num_array[2]={NZDCADbid,EURGBPbid};
But it did not work...!
Can somebody help?