Fehler, Irrtümer, Fragen - Seite 2321

 

Ich verstehe, dass Sie das selbst überprüfen können...

Welches Ereignis wird im Tester zuerst erzeugt, das Tick oder der Timer?

Zum Beispiel sollte der Timer um 12:00:00.000 aufgerufen werden. Und es gibt ein Häkchen mit der gleichen Zeit. Was wird zuerst ausgelöst, OnTimer oder OnTick?

 
Vladimir Pastushak:
Ich hatte mehrere hundert Themen in meinen Favoriten, die alle gelöscht wurden... Ohne mein Wissen.

Hallo!

Bitte überprüfen Sie das noch einmal. Ihre Favoriten sind dabei.

 
fxsaber:

Ich verstehe, dass Sie das selbst überprüfen können...

Welches Ereignis wird im Tester zuerst erzeugt, das Tick oder der Timer?

Zum Beispiel sollte der Timer um 12:00:00.000 aufgerufen werden. Und es gibt ein Häkchen mit der gleichen Zeit. Was wird zuerst ausgelöst, OnTimer oder OnTick?

Timer zuerst

 
Slava:

Zuerst der Timer

Danke, gute Lösung.

 
Pavel Kozlov:

Hallo!

Bitte überprüfen Sie das noch einmal. Ihre Lieblingsthemen sind vorhanden.

Danke, alles ist wieder da.

 

Forum zum Thema Handel, automatisierte Handelssysteme und Testen von Handelsstrategien

Unterschiedliche Ergebnisse. Wie? Und warum? Was soll man glauben?

Sergey Tabolin, 2018.11.10 12:15

Durchführung eines vollständigen Brute-Force-Laufs. Die Datei wird gerade geschrieben. Und das immer in unterschiedlicher Länge. Vielleicht wegen der TF, aber die TF sollte das Ergebnis in keiner Weise beeinflussen! Für weitere Iniit geht nichts!

Wie und warum? Oder handelt es sich um einen Fehler im Testgerät?


//+------------------------------------------------------------------+
//|                                               KrL_write_func.mq5 |
//|                                     Copyright 2018, Tabolin S.N. |
//|                           https://www.mql5.com/ru/users/vip.avos |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, Tabolin S.N."
#property link      "https://www.mql5.com/ru/users/vip.avos"
#property version   "1.00"
//+------------------------------------------------------------------+
typedef void(*TFunc)(void);
TFunc entry_func[7];
//+------------------------------------------------------------------+
enum f_entry
{
   no_f,             // не использовать
   reb,              // отскок
   brd1,             // пробой 1
   brd2,             // пробой 2
   lim,              // лимитный
   lw,               // недельный
   cust,             // пользовательский
};

input    f_entry  func_entry_1         = reb;            // 1-я функция условий входа
input    f_entry  func_entry_2         = brd1;           // 2-я функция условий входа
input    f_entry  func_entry_3         = brd2;           // 3-я функция условий входа
input    f_entry  func_entry_4         = lim;            // 4-я функция условий входа
input    f_entry  func_entry_5         = lw;             // 5-я функция условий входа
input    f_entry  func_entry_6         = cust;           // 6-я функция условий входа

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
   if(paramIncorrect()) return(INIT_PARAMETERS_INCORRECT);
   else
   {
      string   filename    = "KR\\func.txt";
      int      filehandle  = FileOpen(filename,FILE_WRITE|FILE_READ|FILE_TXT|FILE_ANSI|FILE_COMMON);
      if(filehandle != INVALID_HANDLE)
      {
         FileSeek(filehandle,0,SEEK_END);
         string str = string(func_entry_1)+","+string(func_entry_2)+","+string(func_entry_3)+","+string(func_entry_4)+","+string(func_entry_5)+","+string(func_entry_6)+"\n";
         
         if(FileWriteString(filehandle,str) == 0) Print("Ошибка записи файла");
         FileClose(filehandle);
      }
      
      return(INIT_FAILED);
   }

   return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---

}
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{
   
}
//+------------------------------------------------------------------+
bool paramIncorrect()
{
   bool     ret_func = false;
   
   if(func_entry_1 == no_f && func_entry_2 == no_f && func_entry_3 == no_f && func_entry_4 == no_f && 
      func_entry_5 == no_f && func_entry_6 == no_f) return(true);
//--- Порядок следования
   if(func_entry_1 == no_f)                                                                                       ret_func = true;
   else if(func_entry_2 == no_f && (func_entry_3 != no_f || func_entry_4 != no_f || func_entry_5 != no_f || 
                                    func_entry_6 != no_f))                                                        ret_func = true;
   else if(func_entry_3 == no_f && (func_entry_4 != no_f || func_entry_5 != no_f || func_entry_6 != no_f))        ret_func = true;
   else if(func_entry_4 == no_f && (func_entry_5 != no_f || func_entry_6 != no_f))                                ret_func = true;
   else if(func_entry_5 == no_f &&  func_entry_6 != no_f)                                                         ret_func = true;
//--- Повторяемость
   if(func_entry_1 == reb  && (func_entry_2 == reb    || func_entry_3 == reb  || func_entry_4 == reb  || 
                               func_entry_5 == reb    || func_entry_6 == reb))                                    ret_func = true;
   if(func_entry_1 == brd1 && (func_entry_2 == brd1   || func_entry_3 == brd1 || func_entry_4 == brd1 || 
                               func_entry_5 == brd1   || func_entry_6 == brd1))                                   ret_func = true;
   if(func_entry_1 == brd2 && (func_entry_2 == brd2   || func_entry_3 == brd2 || func_entry_4 == brd2 || 
                               func_entry_5 == brd2   || func_entry_6 == brd2))                                   ret_func = true;
   if(func_entry_1 == lim  && (func_entry_2 == lim    || func_entry_3 == lim  || func_entry_4 == lim  || 
                               func_entry_5 == lim    || func_entry_6 == lim))                                    ret_func = true;
   if(func_entry_1 == lw   && (func_entry_2 == lw     || func_entry_3 == lw   || func_entry_4 == lw   || 
                               func_entry_5 == lw     || func_entry_6 == lw))                                     ret_func = true;
   if(func_entry_1 == cust && (func_entry_2 == cust   || func_entry_3 == cust || func_entry_4 == cust || 
                               func_entry_5 == cust   || func_entry_6 == cust))                                   ret_func = true;
   
   if(func_entry_2 == reb  && (func_entry_3 == reb    || func_entry_4 == reb  || 
                               func_entry_5 == reb    || func_entry_6 == reb))                                    ret_func = true;
   if(func_entry_2 == brd1 && (func_entry_3 == brd1   || func_entry_4 == brd1 || 
                               func_entry_5 == brd1   || func_entry_6 == brd1))                                   ret_func = true;
   if(func_entry_2 == brd2 && (func_entry_3 == brd2   || func_entry_4 == brd2 || 
                               func_entry_5 == brd2   || func_entry_6 == brd2))                                   ret_func = true;
   if(func_entry_2 == lim  && (func_entry_3 == lim    || func_entry_4 == lim  || 
                               func_entry_5 == lim    || func_entry_6 == lim))                                    ret_func = true;
   if(func_entry_2 == lw   && (func_entry_3 == lw     || func_entry_4 == lw   || 
                               func_entry_5 == lw     || func_entry_6 == lw))                                     ret_func = true;
   if(func_entry_2 == cust && (func_entry_3 == cust   || func_entry_4 == cust || 
                               func_entry_5 == cust   || func_entry_6 == cust))                                   ret_func = true;
   
   if(func_entry_3 == reb  && (func_entry_4 == reb    || 
                               func_entry_5 == reb    || func_entry_6 == reb))                                    ret_func = true;
   if(func_entry_3 == brd1 && (func_entry_4 == brd1   || 
                               func_entry_5 == brd1   || func_entry_6 == brd1))                                   ret_func = true;
   if(func_entry_3 == brd2 && (func_entry_4 == brd2   || 
                               func_entry_5 == brd2   || func_entry_6 == brd2))                                   ret_func = true;
   if(func_entry_3 == lim  && (func_entry_4 == lim    || 
                               func_entry_5 == lim    || func_entry_6 == lim))                                    ret_func = true;
   if(func_entry_3 == lw   && (func_entry_4 == lw     || 
                               func_entry_5 == lw     || func_entry_6 == lw))                                     ret_func = true;
   if(func_entry_3 == cust && (func_entry_4 == cust   || 
                               func_entry_5 == cust   || func_entry_6 == cust))                                   ret_func = true;
   
   if(func_entry_4 == reb  && (func_entry_5 == reb    || func_entry_6 == reb))                                    ret_func = true;
   if(func_entry_4 == brd1 && (func_entry_5 == brd1   || func_entry_6 == brd1))                                   ret_func = true;
   if(func_entry_4 == brd2 && (func_entry_5 == brd2   || func_entry_6 == brd2))                                   ret_func = true;
   if(func_entry_4 == lim  && (func_entry_5 == lim    || func_entry_6 == lim))                                    ret_func = true;
   if(func_entry_4 == lw   && (func_entry_5 == lw     || func_entry_6 == lw))                                     ret_func = true;
   if(func_entry_4 == cust && (func_entry_5 == cust   || func_entry_6 == cust))                                   ret_func = true;
   
   if(func_entry_5 == reb  && func_entry_6 == reb)                                                                ret_func = true;
   if(func_entry_5 == brd1 && func_entry_6 == brd1)                                                               ret_func = true;
   if(func_entry_5 == brd2 && func_entry_6 == brd2)                                                               ret_func = true;
   if(func_entry_5 == lim  && func_entry_6 == lim)                                                                ret_func = true;
   if(func_entry_5 == lw   && func_entry_6 == lw)                                                                 ret_func = true;
   if(func_entry_5 == cust && func_entry_6 == cust)                                                               ret_func = true;
   
   if(ret_func) return(true);
   
   return(false);
}

 
Сергей Таболин:

Der Cache funktioniert.

 

Hallo!

Ich stehe vor dem Problem, dass der Schieberegler "Feste Chartposition" im MT5 nicht richtig funktioniert. Wenn ich zum Beispiel vom Wochenchart zum Tageschart wechsle, verschiebt er sich um etwa 280 Tage.

Nach der Terminalinstallation ist zunächst alles normal, aber dann lade ich Profile von den alten und es fängt an zu stören. Und das Problem ist alt.

Ich hänge ein Video mit einer kleinen Demonstration an...



Dateien:
test.exe.zip  1300 kb
 

können die Warnungen in diesem Fall entfernt werden? um die Variablen nicht zu vervielfachen. oder funktioniert das in mql überhaupt nicht so?

private:
   int               number_of_features;
     
public:
                     CBandit(int number_of_features) {                                      
                             this.number_of_features = number_of_features;
                            }
  

Deklaration von 'number_of_features' verdeckt Member-Deklaration in Zeile 24


 
Maxim Dmitrievsky:

können die Warnungen in diesem Fall entfernt werden? um die Variablen nicht zu multiplizieren. oder funktioniert das in mql überhaupt nicht?

Die Deklaration von 'number_of_features' verdeckt die Member-Deklaration in Zeile 24


Sie haben die Variable bereits "multipliziert", so dass hierCBandit(int anzahl_von_merkmalen) die Variable int anzahl_von_merkmalen bereits erstellt wird, oder besser gesagt, keine Variable, sondern eine Kopie desWertes dieser Variable, also schreiben Sie CBandit(int anzahl_von_merkmalen_mir) und lassen Sie es dort, weil sich nichts ändern wird, während der Compiler absichtlich eine Warnung ausgibt, weildenn durch die Beschreibung vonCBandit(int number_of_features) haben Sie den Bereich geschlossen

privat:

int number_of_features;

und vielleicht sollten Sie dieses int number_of_features; in der CBandit()-Methode haben, oder vielleicht auch nicht, der Compiler behält es im Auge

Grund der Beschwerde: