- Rabia Yoruk: First problem is : invalid array access problem for the HT1 array :
double HT1[][4]; ⋮ qTL=NormalizeDouble(qLevel+HT[i],qPoint); HT1[i]=NormalizeDouble(qLevel+HT[i],qPoint); //error in this line
You declared a two-dimensional (2D) array and then are trying to access it as a 1D array.
- Rabia Yoruk:
void GetSortedArrayDesc[4](double &d[4])
A function call is not an array. You pass a 2D array to a parameter declared as 1D.
How about using the MQL5 array functions instead of rolling your own:
// GetSortedArrayDesc(HT1); ArraySort(HT1); // sort ascending order ArrayReverse(HT1); // descending order
-
You declared a two-dimensional (2D) array and then are trying to access it as a 1D array.
-
A function call is not an array. You pass a 2D array to a parameter declared as 1D.
thank you for your reply, when i fix the those problems like below, it is fixed now.
double HT1[4],LT1[4];
How about using the MQL5 array functions instead of rolling your own:
thanks for your reply too, i convert my funcs to what your said however the error is 'ArrayReverse' - function not defined , so mql5 doesnt recognize the ArrayReverse function in my indicator.
thanks for your reply too, i convert my funcs to what your said however the error is 'ArrayReverse' - function not defined , so mql5 doesnt recognize the ArrayReverse function in my indicator.
It's also available in MQL 5, see https://www.mql5.com/en/docs/array/array_reverse.
Show your code if it doesn't compile.
- www.mql5.com
- 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 an two error about the array when i converting mql4 codes to mql5, can anyone help me, when i fix those according to mql document, it seems again (most probably i miss something). I shared the codes below. Thanks in advance.
i declare HT1 array like this :
double HT1[][4];
First problem is : invalid array access problem for the HT1 array :
Second problem is : parameter conversion not allowed for the HT1 array :
error in this line, when i called the function like this :
and the function :