Download MetaTrader 5
To add comments, please log in or register
Trade with MetaTarder 5. Download it right now!
mt5user1234
29
mt5user1234 2014.10.25 13:10 

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

Alain Verleyen
Moderator
28623
Alain Verleyen 2014.10.25 13:30  
Please report this to Metaquotes ServiceDesk.
mt5user1234
29
mt5user1234 2014.11.01 08:54  

I've done this without any response from service desk.
MT4 Build 724 has this bug too.
Does MT4 or MT5 have an bug tracking system in place ?

/
To add comments, please log in or register