Errori, bug, domande - pagina 2321

 

Capisco che si possa controllare da soli...

Nel Tester, quale evento viene generato per primo, il tick o il timer?

Per esempio, il timer dovrebbe essere chiamato alle 12:00:00.000. E c'è un tick con lo stesso tempo. Quale si attiva prima, OnTimer o OnTick?

 
Vladimir Pastushak:
Avevo diverse centinaia di temi nei miei preferiti, tutti cancellati... A mia insaputa.

Ciao!

Per favore, controllate di nuovo. I tuoi preferiti sono lì.

 
fxsaber:

Capisco che si possa controllare da soli...

Nel Tester, quale evento viene generato per primo, il tick o il timer?

Per esempio, il timer dovrebbe essere chiamato alle 12:00:00.000. E c'è un tick con lo stesso tempo. Quale si attiva prima, OnTimer o OnTick?

Prima il timer

 
Slava:

Prima il timer

Grazie, buona soluzione.

 
Pavel Kozlov:

Ciao!

Per favore, controllate di nuovo. I tuoi argomenti preferiti sono al loro posto.

Grazie, tutto è tornato.

 

Forum sul trading, sistemi di trading automatico e test di strategie di trading

Risultati diversi. Come? Perché? A cosa credere?

Sergey Tabolin, 2018.11.10 12:15

Esecuzione di un'esecuzione completa con forza bruta. Il file viene scritto. E sempre di lunghezza diversa. Forse a causa del TF, ma il TF non dovrebbe influenzare il risultato in alcun modo! Per ulteriori iniit nulla va!

Come, perché? O è un difetto del tester?


//+------------------------------------------------------------------+
//|                                               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);
}

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

La cache funziona.

 

Ciao!

Sto affrontando il problema con il cursore "Fixed chart position" in MT5 che non funziona correttamente, per esempio quando passo dal grafico settimanale a quello giornaliero si sposta di circa 280 giorni.

All'inizio tutto è normale dopo l'installazione del terminale, ma poi carico i profili da quelli vecchi e comincia a glitchare. E il problema è vecchio.

Allego un video con una piccola dimostrazione...



File:
test.exe.zip  1300 kb
 

Gli avvertimenti possono essere rimossi in questo caso? per non moltiplicare le variabili. o in mql non funziona affatto così?

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

la dichiarazione di 'number_of_features' nasconde la dichiarazione del membro alla linea 24


 
Maxim Dmitrievsky:

gli avvertimenti in questo caso possono essere rimossi? in modo da non moltiplicare le variabili. o questo non funziona affatto in mql?

La dichiarazione di 'number_of_features' nasconde la dichiarazione del membro alla linea 24


Avete già "moltiplicato" la variabile, quindi qui,CBandit(int numero_di_caratteristiche ) la variabile int numero_di_caratteristiche sarà già creata, o meglio non una variabile ma una copia delvalore di questa variabile, quindi dovreste scrivere CBandit(int numero_di_caratteristiche_mio) o lasciarla lì perché non cambierà nulla; il compilatore dà un avvertimento di proposito perchéperché descrivendoCBandit(int number_of_features) avete chiuso l'ambito

privato:

int numero_di_caratteristiche;

e forse avresti dovuto ottenere questo int number_of_features; nel metodo CBandit(), o forse no, il compilatore ne tiene traccia