I don't understand anything, MT5 version 1545. In previous versions there were functions in Math.mqh listing:
//+------------------------------------------------------------------+//| Computes the minimum value in array[] |//+------------------------------------------------------------------+doubleMathMin(constdouble &array[],constint start=0,constint count=WHOLE_ARRAY)
{
int size=ArraySize(array);
int data_count=0;
//--- set data countif(count==WHOLE_ARRAY)
data_count=size;
else
data_count=count;
//--- check data rangeif(data_count==0)
return(QNaN);
if(start+data_count>size)
return(QNaN);
//--- set indexesint ind1=start;
int ind2=ind1+data_count-1;
//--- first element by default, find minimumdouble min_value=array[ind1];
for(int i=ind1+1; i<=ind2; i++)
min_value=MathMin(min_value,array[i]);
//--- return minimum valuereturn(min_value);
}
//+------------------------------------------------------------------+//| Computes the maximum value in array[] |//+------------------------------------------------------------------+doubleMathMax(constdouble &array[],constint start=0,constint count=WHOLE_ARRAY)
{
int size=ArraySize(array);
int data_count=0;
//--- set data countif(count==WHOLE_ARRAY)
data_count=size;
else
data_count=count;
//--- check data rangeif(data_count==0)
return(QNaN);
if(start+data_count>size)
return(QNaN);
//--- set indexesint ind1=start;
int ind2=ind1+data_count-1;
//--- first element by default, find maximumdouble max_value=array[ind1];
for(int i=ind1+1; i<=ind2; i++)
max_value=MathMax(max_value,array[i]);
//--- return maximum valuereturn(max_value);
}
//+------------------------------------------------------------------+//| Computes the range of the values in array[] |//+------------------------------------------------------------------+double MathRange(constdouble &array[],constint start=0,constint count=WHOLE_ARRAY)
{
int size=ArraySize(array);
int data_count=0;
//--- set data countif(count==WHOLE_ARRAY)
data_count=size;
else
data_count=count;
//--- check data rangeif(data_count==0)
return(QNaN);
if(start+data_count>size)
return(QNaN);
//--- set indexesint ind1=start;
int ind2=ind1+data_count-1;
//--- default values, find minimum and maximum valuesdouble min_value=array[ind1];
double max_value=array[ind1];
for(int i=ind1+1; i<=ind2; i++)
{
double value=array[i];
min_value=MathMin(min_value,value);
max_value=MathMax(max_value,value);
}
//--- return rangereturn(max_value-min_value);
}
//+------------------------------------------------------------------+//| Computes the sum of the values in array[] |//+------------------------------------------------------------------+double MathSum(constdouble &array[],constint start=0,constint count=WHOLE_ARRAY)
{
int size=ArraySize(array);
int data_count=0;
//--- set data countif(count==WHOLE_ARRAY)
data_count=size;
else
data_count=count;
//--- check data rangeif(data_count==0)
return(QNaN);
if(start+data_count>size)
return(QNaN);
//--- set indexesint ind1=start;
int ind2=ind1+data_count-1;
//--- calculate sumdouble sum=0.0;
for(int i=ind1; i<=ind2; i++)
sum+=array[i];
//--- return sumreturn(sum);
}
//+------------------------------------------------------------------+//| Computes the standard deviation of the values in array[] |//+------------------------------------------------------------------+double MathStandardDeviation(constdouble &array[],constint start=0,constint count=WHOLE_ARRAY)
{
int size=ArraySize(array);
int data_count=0;
//--- set data countif(count==WHOLE_ARRAY)
data_count=size;
else
data_count=count;
//--- check data rangeif(data_count<=1)
return(QNaN);
if(start+data_count>size)
return(QNaN);
//--- set indexesint ind1=start;
int ind2=ind1+data_count-1;
//--- calculate meandouble mean=0.0;
for(int i=ind1; i<=ind2; i++)
mean+=array[i];
//--- average mean
mean=mean/data_count;
//--- calculate standard deviation double sdev=0;
for(int i=ind1; i<=ind2; i++)
sdev+=MathPow(array[i]-mean,2);
//--- return standard deviationreturnMathSqrt(sdev/(data_count-1));
}
//+------------------------------------------------------------------+//| Computes the average absolute deviation of the values in array[] |//+------------------------------------------------------------------+double MathAverageDeviation(constdouble &array[],constint start=0,constint count=WHOLE_ARRAY)
{
int size=ArraySize(array);
int data_count=0;
//--- set data countif(count==WHOLE_ARRAY)
data_count=size;
else
data_count=count;
//--- check data rangeif(data_count<=1)
return(QNaN);
if(start+data_count>size)
return(QNaN);
//--- set indexesint ind1=start;
int ind2=ind1+data_count-1;
//--- calculate meandouble mean=0.0;
for(int i=ind1; i<=ind2; i++)
mean+=array[i];
mean=mean/data_count;
//--- calculate average deviationdouble adev=0;
for(int i=ind1; i<=ind2; i++)
adev+=MathAbs(array[i]-mean);
adev=adev/data_count;
//--- return average deviationreturn(adev);
}
//+------------------------------------------------------------------+//| Computes the median value of the values in array[] |//+------------------------------------------------------------------+double MathMedian(double &array[],constint start=0,constint count=WHOLE_ARRAY)
{
int size=ArraySize(array);
int data_count=0;
//--- set data countif(count==WHOLE_ARRAY)
data_count=size;
else
data_count=count;
//--- check data rangeif(data_count==0)
return(QNaN);
if(start+data_count>size)
return(QNaN);
//--- set indexesint ind1=start;
int ind2=ind1+data_count-1;
//--- prepare sorted valuesdouble sorted_values[];
ArrayCopy(sorted_values,array,0,start,count);
ArraySort(sorted_values);
//--- calculate median for odd and even cases//--- data_count=oddif(data_count%2==1)
return(sorted_values[data_count/2]);
else//--- data_count=evenreturn(0.5*(sorted_values[(data_count-1)/2]+sorted_values[(data_count+1)/2]));
}
//+------------------------------------------------------------------+//| Computes the mean value of the values in array[] |//+------------------------------------------------------------------+double MathMean(constdouble &array[],constint start=0,constint count=WHOLE_ARRAY)
{
int size=ArraySize(array);
int data_count=0;
//--- set data countif(count==WHOLE_ARRAY)
data_count=size;
else
data_count=count;
//--- check data rangeif(data_count<1)
return(QNaN); // need at least 1 observationif(start+data_count>size)
return(QNaN);
//--- set indexesint ind1=start;
int ind2=ind1+data_count-1;
//--- calculate meandouble mean=0.0;
for(int i=ind1; i<=ind2; i++)
mean+=array[i];
mean=mean/data_count;
//--- return meanreturn(mean);
}
//+------------------------------------------------------------------+//| Computes the variance of the values in array[] |//+------------------------------------------------------------------+double MathVariance(constdouble &array[],constint start=0,constint count=WHOLE_ARRAY)
{
int size=ArraySize(array);
int data_count=0;
//--- set data countif(count==WHOLE_ARRAY)
data_count=size;
else
data_count=count;
//--- check data rangeif(data_count<2)
return(QNaN); // need at least 2 observationsif(start+data_count>size)
return(QNaN);
//--- set indexesint ind1=start;
int ind2=ind1+data_count-1;
//--- calculate meandouble mean=0.0;
for(int i=ind1; i<=ind2; i++)
mean+=array[i];
mean=mean/data_count;
//--- calculate variancedouble variance=0;
for(int i=ind1; i<=ind2; i++)
variance+=MathPow(array[i]-mean,2);
variance=variance/(data_count-1);
//--- return variancereturn(variance);
}
//+------------------------------------------------------------------+//| Computes the skewness of the values in array[] |//+------------------------------------------------------------------+double MathSkewness(constdouble &array[],constint start=0,constint count=WHOLE_ARRAY)
{
int size=ArraySize(array);
int data_count=0;
//--- set data countif(count==WHOLE_ARRAY)
data_count=size;
else
data_count=count;
//--- check data rangeif(data_count<3)
return(QNaN); // need at least 3 observationsif(start+data_count>size)
return(QNaN);
//--- set indexesint ind1=start;
int ind2=ind1+data_count-1;
//--- calculate meandouble mean=0.0;
for(int i=ind1; i<=ind2; i++)
mean+=array[i];
mean=mean/data_count;
//--- calculate variance and skewnessdouble variance=0;
double skewness=0;
for(int i=ind1; i<=ind2; i++)
{
double sqr_dev=MathPow(array[i]-mean,2);
skewness+=sqr_dev*(array[i]-mean);
variance+=sqr_dev;
}
variance=(variance)/(data_count-1);
double v3=MathPow(MathSqrt(variance),3);
//---if(v3!=0)
{
skewness=skewness/(data_count*v3);
//--- return skewnessreturn(skewness);
}
elsereturn(QNaN);
}
//+------------------------------------------------------------------+//| Computes the kurtosis of the values in array[] |//+------------------------------------------------------------------+double MathKurtosis(constdouble &array[],constint start=0,constint count=WHOLE_ARRAY)
{
int size=ArraySize(array);
int data_count=0;
//--- set data countif(count==WHOLE_ARRAY)
data_count=size;
else
data_count=count;
//--- check data rangeif(data_count<4)
return(QNaN); // need at least 4 observationsif(start+data_count>size)
return(QNaN);
//--- set indexesint ind1=start;
int ind2=ind1+data_count-1;
//--- calculate meandouble mean=0.0;
for(int i=ind1; i<=ind2; i++)
mean+=array[i];
mean=mean/data_count;
//--- calculate variance and kurtosisdouble variance=0;
double kurtosis=0;
for(int i=ind1; i<=ind2; i++)
{
double sqr_dev=MathPow(array[i]-mean,2);
variance+=sqr_dev;
kurtosis+=sqr_dev*sqr_dev;
}
//--- calculate variance
variance=(variance)/(data_count-1);
double v4=MathPow(MathSqrt(variance),4);
if(v4!=0)
{
//--- calculate kurtosis
kurtosis=kurtosis/(data_count*v4);
kurtosis-=3;
//--- return kurtosisreturn(kurtosis);
}
elsereturn(QNaN);
}
and now they are not in this listing, I looked in other Math directory listings, but I didn't find these functions there either.
Were they removed at all or were they accidentally erased?
Alexey Viktorov: Why do you need them there when you have the whole set of mathematical functions.
Before you answer, compare it with the ones I posted in the listing. By the way, these functions are listed in the standard library help, so it's more likely that someone has accidentally erased them.
Before you answer, compare it with the ones I posted in the listing. By the way, these functions are listed in the standard library help, so it's more likely that someone has accidentally erased them.
The answer from servicedesk, data functions from the standard library have been removed purposefully, the issue is resolved. Help should also be brought in line, because time is sometimes wasted searching for something that is no longer in the functionality.
It may have already been done, but let me ask:
whyPOSITION_COMMISSION is not highlighted and not in the help?
This constant is no longer relevant, but unfortunately we can't reject it. That's why it's left unlit in the compiler
I don't see a contradiction.
Contradiction with what?
I showed a negative balance in the tester. Also, equity was going below zero. I have to assume it's a bug.
I don't understand anything, MT5 version 1545. In previous versions there were functions in Math.mqh listing:
and now they are not in this listing, I looked in other Math directory listings, but I didn't find these functions there either.
Were they removed at all or were they accidentally erased?
Checked up to version 1554 of MT5, same story, these functions are no longer there
Why do you need them there when you have the whole set of mathematical functions.
Before you answer, compare it with the ones I posted in the listing. By the way, these functions are listed in the standard library help, so it's more likely that someone has accidentally erased them.
Before you answer, compare it with the ones I posted in the listing. By the way, these functions are listed in the standard library help, so it's more likely that someone has accidentally erased them.
The answer from servicedesk, data functions from the standard library have been removed purposefully, the issue is resolved. Help should also be brought in line, because time is sometimes wasted searching for something that is no longer in the functionality.
How can this be? I open a demo account on one server of the company btc-e.com, but it opens on a completely different server of another company!
