Fehler, Irrtümer, Fragen - Seite 1834

 
 
Andrey Dik:
Ich sehe darin keinen Widerspruch.
 
transcendreamer:

Vielleicht ist das schon geschehen, aber ich möchte fragen:

Warum istPOSITION_COMMISSION nicht hervorgehoben und steht nicht in der Hilfe?


Diese Konstante ist nicht mehr relevant, aber leider können wir sie nicht verwerfen. Deshalb ist sie im Compiler nicht beleuchtet.

 
fxsaber:
Ich sehe darin keinen Widerspruch.

Im Widerspruch zu was?

Ich habe einen negativen Saldo im Prüfgerät angezeigt. Außerdem ging das Eigenkapital unter Null. Ich muss annehmen, dass es ein Fehler ist.

 

Ich verstehe nichts, MT5 Version 1545. In früheren Versionen gab es Funktionen im Math.mqh-Verzeichnis:

//+------------------------------------------------------------------+
//| Computes the minimum value in array[]                            |
//+------------------------------------------------------------------+
double MathMin(const double &array[],const int start=0,const int count=WHOLE_ARRAY)
  {
   int size=ArraySize(array);
   int data_count=0;
//--- set data count
   if(count==WHOLE_ARRAY)
      data_count=size;
   else
      data_count=count;
//--- check data range
   if(data_count==0)
      return(QNaN);
   if(start+data_count>size)
      return(QNaN);
//--- set indexes
   int ind1=start;
   int ind2=ind1+data_count-1;
//--- first element by default, find minimum
   double min_value=array[ind1];

   for(int i=ind1+1; i<=ind2; i++)
      min_value=MathMin(min_value,array[i]);
//--- return minimum value
   return(min_value);
  }
//+------------------------------------------------------------------+
//| Computes the maximum value in array[]                            |
//+------------------------------------------------------------------+
double MathMax(const double &array[],const int start=0,const int count=WHOLE_ARRAY)
  {
   int size=ArraySize(array);
   int data_count=0;
//--- set data count
   if(count==WHOLE_ARRAY)
      data_count=size;
   else
      data_count=count;
//--- check data range
   if(data_count==0)
      return(QNaN);
   if(start+data_count>size)
      return(QNaN);
//--- set indexes
   int ind1=start;
   int ind2=ind1+data_count-1;
//--- first element by default, find maximum
   double max_value=array[ind1];

   for(int i=ind1+1; i<=ind2; i++)
      max_value=MathMax(max_value,array[i]);
//--- return maximum value
   return(max_value);
  }
//+------------------------------------------------------------------+
//| Computes the range of the values in array[]                      |
//+------------------------------------------------------------------+
double MathRange(const double &array[],const int start=0,const int count=WHOLE_ARRAY)
  {
   int size=ArraySize(array);
   int data_count=0;
//--- set data count
   if(count==WHOLE_ARRAY)
      data_count=size;
   else
      data_count=count;
//--- check data range
   if(data_count==0)
      return(QNaN);
   if(start+data_count>size)
      return(QNaN);
//--- set indexes
   int ind1=start;
   int ind2=ind1+data_count-1;
//--- default values, find minimum and maximum values
   double 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 range
   return(max_value-min_value);
  }
//+------------------------------------------------------------------+
//| Computes the sum of the values in array[]                        |
//+------------------------------------------------------------------+
double MathSum(const double &array[],const int start=0,const int count=WHOLE_ARRAY)
  {
   int size=ArraySize(array);
   int data_count=0;
//--- set data count
   if(count==WHOLE_ARRAY)
      data_count=size;
   else
      data_count=count;
//--- check data range
   if(data_count==0)
      return(QNaN);
   if(start+data_count>size)
      return(QNaN);
//--- set indexes
   int ind1=start;
   int ind2=ind1+data_count-1;
//--- calculate sum
   double sum=0.0;
   for(int i=ind1; i<=ind2; i++)
      sum+=array[i];
//--- return sum
   return(sum);
  }
//+------------------------------------------------------------------+
//| Computes the standard deviation of the values in array[]         |
//+------------------------------------------------------------------+
double MathStandardDeviation(const double &array[],const int start=0,const int count=WHOLE_ARRAY)
  {
   int size=ArraySize(array);
   int data_count=0;
//--- set data count
   if(count==WHOLE_ARRAY)
      data_count=size;
   else
      data_count=count;
//--- check data range
   if(data_count<=1)
      return(QNaN);
   if(start+data_count>size)
      return(QNaN);
//--- set indexes
   int ind1=start;
   int ind2=ind1+data_count-1;
//--- calculate mean
   double 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 deviation
   return MathSqrt(sdev/(data_count-1));
  }
//+------------------------------------------------------------------+
//| Computes the average absolute deviation of the values in array[] |
//+------------------------------------------------------------------+
double MathAverageDeviation(const double &array[],const int start=0,const int count=WHOLE_ARRAY)
  {
   int size=ArraySize(array);
   int data_count=0;
//--- set data count
   if(count==WHOLE_ARRAY)
      data_count=size;
   else
      data_count=count;
//--- check data range
   if(data_count<=1)
      return(QNaN);
   if(start+data_count>size)
      return(QNaN);
//--- set indexes
   int ind1=start;
   int ind2=ind1+data_count-1;
//--- calculate mean
   double mean=0.0;
   for(int i=ind1; i<=ind2; i++)
      mean+=array[i];
   mean=mean/data_count;
//--- calculate average deviation
   double adev=0;
   for(int i=ind1; i<=ind2; i++)
      adev+=MathAbs(array[i]-mean);
   adev=adev/data_count;
//--- return average deviation
   return(adev);
  }
//+------------------------------------------------------------------+
//| Computes the median value of the values in array[]               |
//+------------------------------------------------------------------+
double MathMedian(double &array[],const int start=0,const int count=WHOLE_ARRAY)
  {
   int size=ArraySize(array);
   int data_count=0;
//--- set data count
   if(count==WHOLE_ARRAY)
      data_count=size;
   else
      data_count=count;
//--- check data range
   if(data_count==0)
      return(QNaN);
   if(start+data_count>size)
      return(QNaN);
//--- set indexes
   int ind1=start;
   int ind2=ind1+data_count-1;
//--- prepare sorted values
   double sorted_values[];
   ArrayCopy(sorted_values,array,0,start,count);
   ArraySort(sorted_values);
//--- calculate median for odd and even cases
//--- data_count=odd
   if(data_count%2==1)
      return(sorted_values[data_count/2]);
   else
//--- data_count=even
      return(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(const double &array[],const int start=0,const int count=WHOLE_ARRAY)
  {
   int size=ArraySize(array);
   int data_count=0;
//--- set data count
   if(count==WHOLE_ARRAY)
      data_count=size;
   else
      data_count=count;
//--- check data range
   if(data_count<1)
      return(QNaN); // need at least 1 observation
   if(start+data_count>size)
      return(QNaN);
//--- set indexes
   int ind1=start;
   int ind2=ind1+data_count-1;
//--- calculate mean
   double mean=0.0;
   for(int i=ind1; i<=ind2; i++)
      mean+=array[i];
   mean=mean/data_count;
//--- return mean
   return(mean);
  }
//+------------------------------------------------------------------+
//| Computes the variance of the values in array[]                   |
//+------------------------------------------------------------------+
double MathVariance(const double &array[],const int start=0,const int count=WHOLE_ARRAY)
  {
   int size=ArraySize(array);
   int data_count=0;
//--- set data count
   if(count==WHOLE_ARRAY)
      data_count=size;
   else
      data_count=count;
//--- check data range
   if(data_count<2)
      return(QNaN); // need at least 2 observations
   if(start+data_count>size)
      return(QNaN);
//--- set indexes
   int ind1=start;
   int ind2=ind1+data_count-1;
//--- calculate mean
   double mean=0.0;
   for(int i=ind1; i<=ind2; i++)
      mean+=array[i];
   mean=mean/data_count;
//--- calculate variance
   double variance=0;
   for(int i=ind1; i<=ind2; i++)
      variance+=MathPow(array[i]-mean,2);
   variance=variance/(data_count-1);
//--- return variance
   return(variance);
  }
//+------------------------------------------------------------------+
//| Computes the skewness of the values in array[]                   |
//+------------------------------------------------------------------+
double MathSkewness(const double &array[],const int start=0,const int count=WHOLE_ARRAY)
  {
   int size=ArraySize(array);
   int data_count=0;
//--- set data count
   if(count==WHOLE_ARRAY)
      data_count=size;
   else
      data_count=count;
//--- check data range
   if(data_count<3)
      return(QNaN); // need at least 3 observations
   if(start+data_count>size)
      return(QNaN);
//--- set indexes
   int ind1=start;
   int ind2=ind1+data_count-1;
//--- calculate mean
   double mean=0.0;
   for(int i=ind1; i<=ind2; i++)
      mean+=array[i];
   mean=mean/data_count;
//--- calculate variance and skewness
   double 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 skewness
      return(skewness);
     }
   else
      return(QNaN);
  }
//+------------------------------------------------------------------+
//| Computes the kurtosis of the values in array[]                   |
//+------------------------------------------------------------------+
double MathKurtosis(const double &array[],const int start=0,const int count=WHOLE_ARRAY)
  {
   int size=ArraySize(array);
   int data_count=0;
//--- set data count
   if(count==WHOLE_ARRAY)
      data_count=size;
   else
      data_count=count;
//--- check data range
   if(data_count<4)
      return(QNaN); // need at least 4 observations
   if(start+data_count>size)
      return(QNaN);
//--- set indexes
   int ind1=start;
   int ind2=ind1+data_count-1;
//--- calculate mean
   double mean=0.0;
   for(int i=ind1; i<=ind2; i++)
      mean+=array[i];
   mean=mean/data_count;
//--- calculate variance and kurtosis
   double 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 kurtosis
      return(kurtosis);
     }
   else
      return(QNaN);
  }

Ich habe in anderen Mathe-Verzeichnissen nachgesehen, aber auch dort habe ich diese Funktionen nicht gefunden.

Wurden sie überhaupt entfernt oder wurden sie versehentlich gelöscht?

 
überprüft auf Version 1554 von MT5, gleiche Geschichte, diese Funktionen sind nicht mehr vorhanden
 
luser.2017:
Überprüft bis zur Version 1554 von MT5, gleiche Geschichte, diese Funktionen sind nicht mehr da
Wozu braucht man sie, wenn man die gesamte Palette der mathematischen Funktionen zur Verfügung hat.
Документация по MQL5: Математические функции
Документация по MQL5: Математические функции
  • www.mql5.com
Математические функции - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Alexey Viktorov:
Wozu braucht man sie, wenn man alle mathematischen Funktionen zur Verfügung hat?


Bevor Sie antworten, vergleichen Sie sie mit denen, die ich in der Liste aufgeführt habe. Übrigens sind diese Funktionen in der Hilfe der Standardbibliothek aufgeführt, so dass es wahrscheinlicher ist, dass jemand sie versehentlich gelöscht hat.

 
Konstantin:


Bevor Sie antworten, vergleichen Sie sie mit denen, die ich in der Liste aufgeführt habe. Übrigens sind diese Funktionen in der Hilfe der Standardbibliothek aufgeführt, so dass es wahrscheinlicher ist, dass jemand sie versehentlich gelöscht hat.


Die Antwort von servicedesk, Datenfunktionen aus der Standardbibliothek wurden absichtlich entfernt, das Problem ist behoben. Auch die Hilfe sollte in Einklang gebracht werden, denn manchmal wird Zeit mit der Suche nach etwas verschwendet, das nicht mehr in der Funktionalität enthalten ist.
 

Wie kann das sein? Ich eröffne ein Demokonto auf einem Server der Firma btc-e.com, aber es öffnet sich auf einem ganz anderen Server einer anderen Firma!