Print(" CopyMax.Maximum... ", aArrayCopyMax.Maximum( WHOLE_ARRAY, 0 )) ;
//---------- results:
2014.09.18 23:50:18.761 MatrizCont GBPJPY,M1: aArrayCopyMin.Minimum... 5
2014.09.18 23:50:18.761 MatrizCont GBPJPY,M1: aArrayCopyMax.Maximum... 3
.........................................................................................................................................
//---------- with 5 elements
//---------- results
2014.09.18 23:52:18.561 MatrizCont GBPJPY,M1: ValMax Minimum... 0
2014.09.18 23:52:18.561 MatrizCont GBPJPY,M1: ValMax Maximum... 3
I have first changed the "start" in CArrayDouble by "star"
//--------------------- in class declaration:
int Minimum(const int count, const int star ) const;
int Maximum(const int count, const int star ) const;
//------------------- and in the function
//+------------------------------------------------------------------+
//| Find minimum of array |
//+------------------------------------------------------------------+
int CArrayDouble::Minimum(const int count,const int star ) const
{
return(ArrayMinimum(m_data, count, star));
}
//+------------------------------------------------------------------+
//| Find maximum of array |
//+------------------------------------------------------------------+
int CArrayDouble::Maximum(const int count,const int star ) const
{
return(ArrayMaximum(m_data, count, star));
}
Best regards .Be Lucky&Happy
Play video | Please edit your post. For large amounts of code, attach it. |
- 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 would like to report a possible mistake in the Standard Library, Array Class. In my editor, the following function is written in the
ArrayDouble class as follows:
int CArrayDouble::Maximum(const int start,const int count) const
{
return(ArrayMaximum(m_data,start,count));
}
In the documentation, the ArrayMaximum and ArrayMinimum functions are however defined in the following manner:
int ArrayMaximum(
const void& array[], // array for searchint count=WHOLE_ARRAY, // number of checked elements
int start=0 // index to start checking with
);
So according to the documentation the first variable should be the array itself, it is correct. The second variable should be
the count value and the third the starting position. In the Standard Library, however, the start variable is written in the second
place and the count variable in the third place. Either the documentation or the Standard Library is mixed up.
Please advise, which is the correct use of the function. Can I trust the Standard Library? How well is it tested for mistakes?
Many thanks in advance!