Diskussion zum Artikel "Statistische Verteilungen in MQL5 - Nur das Beste aus R" - Seite 14

 

Forum zum Thema Handel, automatische Handelssysteme und Testen von Handelsstrategien

Hilfe bei der Korrelation

Quantum, 2016.12.01 12:53 pm.

Math.mqh Datei sollte im Ordner terminal_data_folder\MQL5\Include\Math\Stat\ abgelegt werden.

Sie lässt sich unter MT4 nicht kompilieren. #property strict hilft nicht

'Math.mqh'      Math.mqh        1       1
'MathLog1p' - no one of the overloads can be applied to the function call       Math.mqh        4655    17
'MathLog1p' - no one of the overloads can be applied to the function call       Math.mqh        4676    16
'MathExpm1' - no one of the overloads can be applied to the function call       Math.mqh        4702    17
'MathExpm1' - no one of the overloads can be applied to the function call       Math.mqh        4723    16
'MathSinh' - no one of the overloads can be applied to the function call        Math.mqh        4750    17
'MathSinh' - no one of the overloads can be applied to the function call        Math.mqh        4772    16
'MathCosh' - no one of the overloads can be applied to the function call        Math.mqh        4799    17
'MathCosh' - no one of the overloads can be applied to the function call        Math.mqh        4821    16
'MathTanh' - no one of the overloads can be applied to the function call        Math.mqh        4848    17
'MathTanh' - no one of the overloads can be applied to the function call        Math.mqh        4870    16
'MathArcsinh' - no one of the overloads can be applied to the function call     Math.mqh        4897    17
'MathArcsinh' - no one of the overloads can be applied to the function call     Math.mqh        4919    16
'MathArccosh' - no one of the overloads can be applied to the function call     Math.mqh        4946    17
'MathArccosh' - no one of the overloads can be applied to the function call     Math.mqh        4968    16
'MathArctanh' - no one of the overloads can be applied to the function call     Math.mqh        4995    17
'MathArctanh' - no one of the overloads can be applied to the function call     Math.mqh        5017    16
16 error(s), 0 warning(s)               17      1
MQL4 Fehler?
 
Frage an den Entwickler: Warum sind die mathematischen Funktionen (in der Datei Math.mqh) nicht in eine Klasse verpackt? Vielleicht funktionieren sie auf diese Weise schneller?
 

Dies ist eine MQL5-Bibliothek ohne MQL4-Unterstützung.

Klassen werden in dieser Matrixbibliothek nicht benötigt.

 
Renat Fatkhullin:

Dies ist eine MQL5-Bibliothek ohne MQL4-Unterstützung.

Aber sie funktioniert zu 99% in MQL4, genau wie GraphPlot. Es wäre 100%, wenn sie den Fehler in MQL4 behoben haben - keine der Überladungen kann auf den Funktionsaufruf angewendet werden.
 
Das Thema MQL4 und MT4 ist geschlossen. Es wird dort keine Bewegungen oder Verbesserungen geben.
 
fxsaber:
Aber es funktioniert 99% in MQL4, genau wie GraphPlot. Es wäre 100%, wenn sie den Fehler in MQL4 behoben hätten - keine der Überladungen kann auf den Funktionsaufruf angewendet werden.

Ich habe genau hingesehen, aber das ist kein Fehler von MQL4, sondern ein Fehler von MQL5!

//+------------------------------------------------------------------+
//| MathLog1p|
//+------------------------------------------------------------------+
//| Die Funktion berechnet log(1+x) für die Elemente aus dem Array.
//||
//| Argumente:|
//| array[] : Array mit Werten|
//| result[] : Ausgabe-Array mit berechneten Werten |
//||
//| Rückgabewert: true bei Erfolg, sonst false |
//+------------------------------------------------------------------+
bool MathLog1p(const double &array[],double &result[])
  {
   int size=ArraySize(array);
   if(size==0)
      return(false);
//--- Ziel-Array vorbereiten
   if(ArraySize(result)<size)
      if(ArrayResize(result,size)!=size)
         return(false);
//--- Werte berechnen
   for(int i=0; i<size; i++)
      result[i]=MathLog1p(array[i]);
//---
   return(true);
  }
//+------------------------------------------------------------------+
//| MathLog1p|
//+------------------------------------------------------------------+
//| Die Funktion berechnet log(1+x) für die Elemente aus dem Array.
//||
//| Argumente:|
//| array[] : Array mit Werten|
//||
//| Rückgabewert: true bei Erfolg, sonst false |
//+------------------------------------------------------------------+
bool MathLog1p(double &array[])
  {
   int size=ArraySize(array);
   if(size==0)
      return(false);
//--- Werte berechnen
   for(int i=0; i<size; i++)
      array[i]=MathLog1p(array[i]);
//---
   return(true);
  }

MQL4 verflucht korrekt - keine der Überladungen kann auf den Funktionsaufruf angewendet werden . Aber MQL5 schweigt, wenn es einen offensichtlichen Fehler gibt. @Renat Fatkhullin, ein Fehler?

 
fxsaber:
MQL4 warnt korrekt - keine der Überladungen kann auf den Funktionsaufruf angewendet werden . Und MQL5 ist still, wenn ein offensichtlicher Fehler vorliegt.

Dies ist kein Fehler. MQL5 hat diese Funktionen.


 
Quantum:

Dies ist kein Fehler. MQL5 hat diese Funktionen.

Ich danke Ihnen! Und ich, wie ein Narr, drücke ALT+G....
 

Hallo,
hat ein Problem bei der Berechnung des Quantils der Gamma-Verteilung
in R:
> qgamma(0.05,2,scale=1)
[1] 0.3553615
> qgamma(0.05,10,scale=1)
[1] 5.425406

in mql5:

#include <Math\Stat\Gamma.mqh>
void OnStart()
  {
   int ner;
   double q=MathQuantileGamma(0.05,2,1,ner);
   if(!MathIsValidNumber(q)) {Print("Error ",ner); return;}
   Print(q);
   q=MathQuantileGamma(0.05,10,1,ner);
   if(!MathIsValidNumber(q)) {Print("Error ",ner); return;}
   Print(q);
  }

Ergebnisse:
0.3553615106986621
Fehler 4

build 1596

 
Alexey Nikolaev:

Hallo,
ist bei der Berechnung des Quantils der Gamma-Verteilung auf ein Problem gestoßen

Guten Tag, vielen Dank für Ihre Nachricht.

Fehler 4 bedeutet Konvergenzprobleme im Algorithmus der Newtonschen Rückwärtsiteration, der zur Ermittlung der Quantile verwendet wird. Wir werden das Problem untersuchen.