
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
please see these official prototypes:
a)
int ArrayMinimum(
const void& array[], // array for search
int count=WHOLE_ARRAY, // number of checked elements
int start=0 // index to start checking with
);
b)
int CArrayDouble::Minimum(const int start,const int count) const
{
return(ArrayMinimum(m_data,start,count));
}
Parameter order mismatch and it also applies to CArrayDouble::Maximum(...) calling ArrayMaximum(...).
Proof:
#property strict
#include <Arrays/ArrayDouble.mqh>
void OnStart()
{
double d[10] = {8.0, 6.2, 1.1, 7.4, 9.1, 8.2, 4.4, 3.7, 5.3, 2.2}; // smallest element is on index 2
CArrayDouble c;
int d_pos, c_pos;
c.AddArray(d);
d_pos = ArrayMinimum(d, WHOLE_ARRAY, 0);
c_pos = c.Minimum(0, c.Total());
Print("Result: d_pos=", d_pos, " c_pos=", c_pos);
/*
Result: d_pos = 2 c_pos = 10
*/
}
Without proper tests this mistake will not be detected, because both parameters are "int".
Best regards