Errors, bugs, questions - page 1988

 
Andrey Dik:


That's right, there are, here they are:

2017.09.05
2017.09.05 11:42:04:04 Logger log was cleaned
2017.09.05 2017.09.05 00:00:00.000 Server MetaTester 5 stopped

There's nothing else out there.

So why is there no complete Print() information in the tester logs?

Free space on disk. Logs are cleared if there is less than 500 meg left on disk
 
Slava:
Free up disk space. The logs are cleared if the disk space is less than 500 meg

How are they cleaned? Where can I find out about the cleaning algorithm? Where is the message that the logs have been cleaned?

How to work with the programme if it does not do what is expected of it? - We are talking about MT5 as well, not only about Expert Advisor.

In my specific example we can see in the logs that the ticks are skipped. What is a user to think in this case? What bright pure thoughts can arise unclouded by foul language?

 

In the tester visual mode, the speed slider position is memorised. I set it to maximum once. Then I run a heavy EA - the visualizer hangs.

I have to make a dummy EA and run it in the visualizer and move the slider back a bit. A heavy EA does not hang after that.

Is it possible to set the slider position in advance (as it is in MT4)?

 

During a single run without visualization, I run an Expert Advisor that performs many trades, clogging the log with appropriate messages (the tester itself likes to output them). After the backtest (or immediately after pressing Stop) I switch to the Log tab and see the logs continue to be displayed. This is the first nonsense, since the backtest is over, why not show the end of the logs?

I'm not interested in the logs and click "Delete logs". After which the log is cleared and... continues to fill up with old records!

 
Andrey Dik:

How are they cleaned? Where can I find out about the cleaning algorithm? Where is the message that the logs have been cleaned?

How to work with the programme if it does not do what is expected of it? - We are talking about MT5 as well, not only about Expert Advisor.

In my particular example, you can see in the logs that ticks are skipped. What is a user to think in this case? What bright pure thoughts may arise unclouded by foul language?

You've never looked at the tester agent logs before.

The message about clearing the logs is the one you showed yourself.

If you analyze the logs of the tester, then you are a priori considered a skilled user. A wizard must always keep an eye on his tool. Windows Explorer always shows a drive with little free space in red

BTW even if your dashboard has a tyre pressure indicator, this in no way cancels a visual inspection of the vehicle before driving

 
fxsaber:

During a single run without visualization, I run an Expert Advisor that performs many trades, clogging the log with appropriate messages (the tester itself likes to output them). After the backtest (or immediately after pressing Stop) I switch to the Log tab and see the logs continue to be displayed. This is the first nonsense, since the backtest is over, why not show the end of the logs?

I'm not interested in the logs and click "Delete logs". After which the log is cleared and... continues to fill up with old records!

Yes, it's a good idea to disable the output to the log during a test without visualisation. More often you just want to see the final result (profit, test time, etc.), which is displayed at the very end.

Details during the test can be viewed in the visualisation mode. There is no point in reactively dumping this "pile" without visualization.

 
Alexey Kozitsyn:

Here's the test code if you're interested.

I think I've found the cause and a temporary solution to this problem. It's hard for me to explain how it happens, but it seems that the colour buffer interferes and messes everything up.


Here's what I changed in the source code and the problem disappeared

#property indicator_separate_window
#property indicator_plots 3
#property indicator_buffers 4
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
input bool inpUseArrows=false;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
double bufGisto[];
double bufGistoColor[];
double bufArrowUp[];
double bufArrowDn[];
//---
const double EMPTY=EMPTY_VALUE;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- Размечаем массив цветов
   color colors[2];
   colors[ 0 ]= clrLime;
   colors[ 1 ] = clrRed;
//--- Устанавливаем параметры графических серий
//   SetPlotParametersColorHistogram(0,0,bufGisto,bufGistoColor,false,"test gisto",colors,EMPTY,2);
   SetPlotParametersColorHistogram(2,2,bufGisto,bufGistoColor,false,"test gisto",colors,EMPTY,2);
//--- Проверяем, нужно ли отображать объемы
//   if(inpUseArrows) // Если отображать нужно
//     {
//      SetPlotParametersArrow(1,2,bufArrowUp,false,"test up",EMPTY,clrLime,233,10);
//      SetPlotParametersArrow(2,3,bufArrowDn,false,"test dn",EMPTY,clrRed,234,-10);
      SetPlotParametersArrow(0,0,bufArrowUp,false,"test up",EMPTY,clrLime,233,10);
      SetPlotParametersArrow(1,1,bufArrowDn,false,"test dn",EMPTY,clrRed,234,-10);
//     }
//---
   IndicatorSetInteger(INDICATOR_DIGITS,0);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   if(inpUseArrows)
     {
      ArrayInitialize(bufArrowUp,EMPTY);
      ArrayInitialize(bufArrowDn,EMPTY);
     }
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   if(prev_calculated==0)
     {
      ArrayInitialize(bufGisto,EMPTY);
      //---
      if(inpUseArrows)
        {
         ArrayInitialize(bufArrowUp,EMPTY);
         ArrayInitialize(bufArrowDn,EMPTY);
        }
      //---
      for(int i=0; i<rates_total; i++)
        {
         bufGisto[i]=(open[i]-close[i])/_Point;
         bufGistoColor[i]=(bufGisto[i]<0) ? 1 : 0;
         //---
/*         if(inpUseArrows)
           {
            if(bufGisto[i]>20)
               bufArrowDn[i]=bufGisto[i];
            else if(bufGisto[i]<-20)
               bufArrowUp[i]=bufGisto[i];
           }
*/
         if(inpUseArrows)
           {
            if(bufGisto[i]>20)
               bufArrowDn[i]=bufGisto[i];
             else bufArrowDn[i] = EMPTY;
             
             if(bufGisto[i]<-20)
               bufArrowUp[i]=bufGisto[i];
             else bufArrowUp[i] = EMPTY;
           }
        }
     }
   else if(rates_total>prev_calculated)
     {
      bufGisto[rates_total-1]=EMPTY;
      //---
      if(inpUseArrows)
        {
         bufArrowUp[ rates_total-1 ] = EMPTY;
         bufArrowDn[ rates_total-1 ] = EMPTY;
        }
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| Параметры графического построения: цветная гист-а от 0 линии                |
//+------------------------------------------------------------------+
void SetPlotParametersColorHistogram(const int plotIndex,// Индекс графической серии
                                     const int bufferNum,// Номер первого буфера серии
                                     double& value[],                              // Буфер значений
                                     double& clr[],                                 // Буфер цветов
                                     const bool asSeries,                           // Флаг нумерации как в таймсерии
                                     const string label,                           // Имя серии
                                     const color& colors[],                        // Цвета линии
                                     const double emptyValue = EMPTY_VALUE,         // Пустые значения серии
                                     const int width = 0,                           // Толщина линии
                                     const ENUM_LINE_STYLE style = STYLE_SOLID,      // Стиль линии
                                     const int drawBegin = 0,                        // Количество баров без отрисовки
                                     const int shift=0                           // Сдвиг построения в барах
                                     )
  {
//--- Привязываем буферы
   SetIndexBuffer(bufferNum,value,INDICATOR_DATA);
   SetIndexBuffer(bufferNum+1,clr,INDICATOR_COLOR_INDEX);
//--- Устанавливаем порядок нумерации в массивах-буферах
   ArraySetAsSeries(value,asSeries);
   ArraySetAsSeries(clr,asSeries);
//--- Устанавливаем тип графического построения
   PlotIndexSetInteger(plotIndex,PLOT_DRAW_TYPE,DRAW_COLOR_HISTOGRAM);
//--- Устанавливаем имя графической серии
   PlotIndexSetString(plotIndex,PLOT_LABEL,label);
//--- Устанавливаем пустые значения в буферах
   PlotIndexSetDouble(plotIndex,PLOT_EMPTY_VALUE,emptyValue);
//--- Устанавливаем количество цветов индикатора
   const int size=ArraySize(colors);
   PlotIndexSetInteger(plotIndex,PLOT_COLOR_INDEXES,size);
//--- Устанавливаем цвета индикатора
   for(int i=0; i<size; i++)
      PlotIndexSetInteger(plotIndex,PLOT_LINE_COLOR,i,colors[i]);
//--- Устанавливаем толщину линии
   PlotIndexSetInteger(plotIndex,PLOT_LINE_WIDTH,width);
//--- Устанавливаем стиль линии
   PlotIndexSetInteger(plotIndex,PLOT_LINE_STYLE,style);
//--- Устанавливаем количество баров без отрисовки и значений в DataWindow
   PlotIndexSetInteger(plotIndex,PLOT_DRAW_BEGIN,drawBegin);
//--- Устанавливаем сдвиг графического построения по оси времени в барах
   PlotIndexSetInteger(plotIndex,PLOT_SHIFT,shift);
  }
//+------------------------------------------------------------------+
//| Параметры графического построения: стрелки                                                          |
//+------------------------------------------------------------------+
void SetPlotParametersArrow(const int plotIndex,// Индекс графической серии
                            const int bufferNum,// Номер первого буфера серии
                            double &value[],// Буфер значений
                            const bool asSeries,// Флаг нумерации как в таймсерии
                            const string label,// Имя серии
                            const double emptyValue=EMPTY_VALUE,// Пустые значения серии
                            const color clr=clrRed,// Цвет стрелок
                            const int arrowCode= 159,// Код стрелок
                            const int arrowShift = 0,// Сдвиг стрелок по вертикали
                            const int width=0,// Толщина стрелок
                            const int drawBegin=0,// Количество баров без отрисовки
                            const int shift=0                     // Сдвиг построения в барах
                            )
  {
//--- Привязываем буферы
   SetIndexBuffer(bufferNum,value,INDICATOR_DATA);
//--- Устанавливаем порядок нумерации в массивах-буферах
   ArraySetAsSeries(value,asSeries);
//--- Устанавливаем тип графического построения
   PlotIndexSetInteger(plotIndex,PLOT_DRAW_TYPE,DRAW_ARROW);
//--- Устанавливаем имя графической серии
   PlotIndexSetString(plotIndex,PLOT_LABEL,label);
//--- Устанавливаем пустые значения в буферах
   PlotIndexSetDouble(plotIndex,PLOT_EMPTY_VALUE,emptyValue);
//--- Устанавливаем цвет индикатора
   PlotIndexSetInteger(plotIndex,PLOT_LINE_COLOR,0,clr);
//--- Устанавливаем код стрелок
   PlotIndexSetInteger(plotIndex,PLOT_ARROW,arrowCode);
//--- Устанавливаем смещение стрелок по вертикали
   PlotIndexSetInteger(plotIndex,PLOT_ARROW_SHIFT,arrowShift);
//--- Устанавливаем толщину стрелок
   PlotIndexSetInteger(plotIndex,PLOT_LINE_WIDTH,width);
//--- Устанавливаем количество баров без отрисовки и значений в DataWindow
   PlotIndexSetInteger(plotIndex,PLOT_DRAW_BEGIN,drawBegin);
//--- Устанавливаем сдвиг графического построения по оси времени в барах
   PlotIndexSetInteger(plotIndex,PLOT_SHIFT,shift);
  }
//+------------------------------------------------------------------+
  1. Put index DRAW_COLOR_HISTOGRAM "at the end" so that INDICATOR_COLOR_INDEX was last.
  2. If the buffer is not to be filled with a value, it must be filled with PLOT_EMPTY_VALUE
 

Why does the tester do this?

2017.09.05 10:42:53.349 Tester  Experts\fxsaber\TesterBenchmark_Example.ex5 on EURUSD,M1 from 2017.08.01 00:00 to 2017.09.05 00:00
2017.09.05 10:42:53.349 Tester  EURUSD: history data begins from 1981.01.02 00:00
2017.09.05 10:42:53.349 Tester  EURUSD: preliminary downloading of history ticks started, it may take quite a long time
2017.09.05 10:42:53.349 Tester  EURUSD: "bases\MetaQuotes-Demo\ticks\EURUSD\201709.tkc" download
2017.09.05 10:42:59.389 Tester  EURUSD: "bases\MetaQuotes-Demo\ticks\EURUSD\201708.tkc" download (370.48 Kb/sec)
2017.09.05 10:43:12.450 Tester  EURUSD: 71% ticks downloaded (356.63 Kb/sec)
2017.09.05 10:43:20.488 Tester  EURUSD: 94% ticks downloaded (338.89 Kb/sec)
2017.09.05 10:43:22.491 Tester  EURUSD: preliminary downloading of history ticks completed, 10.01 Mb in 0:29.141 (351.80 Kb/sec)
2017.09.05 10:43:22.491 Tester  EURUSD: ticks data begins from 2017.08.01 00:00
2017.09.05 10:43:22.491 Tester  complete optimization started
2017.09.05 10:43:22.491 Tester  size of initial task batch is 6
2017.09.05 10:43:22.521 Core 1  agent process started
2017.09.05 10:43:23.094 Core 1  connecting to 127.0.0.1:3000
2017.09.05 10:43:23.094 Core 1  connected
2017.09.05 10:43:23.103 Core 1  authorized (agent build 1653)
2017.09.05 10:43:23.114 Core 1  common synchronization completed
2017.09.05 10:43:23.388 Core 1  EURUSD: history for 2016 year synchronized
2017.09.05 10:43:23.388 Core 1  EURUSD: history for 2017 year synchronized
2017.09.05 10:43:23.388 Core 1  EURUSD: history synchronization completed [54 Kb]
2017.09.05 10:43:23.388 Core 1  EURUSD: 54.96 Kb of history processed in 0:00.234
2017.09.05 10:43:23.402 Core 1  pass 0 tested with error "cannot synchronize history (EURUSD)" in 0:00:00.047
2017.09.05 10:43:23.404 Core 1  pass 1 tested with error "task rejected by tester agent" in 0:00:00.000
 
Slava:

1. You have never looked at the tester agent logs before.

The message about clearing the log is the one you showed yourself.

2. If you are analysing the tester logs, you are a priori considered a skilled user. A wizard must always keep an eye on his tool. Windows Explorer always shows a drive with little free space in red

BTW even if your dashboard has a tyre pressure indicator, it by no means cancels a visual inspection of the vehicle before driving

1. I've never had to do this because it wasn't necessary - the tester logs always showed what was expected.

2. Who cares what windows explorer shows? We work in MT5 and it just has to tell the user that there is not enough memory (or any other reason not allowing to work normally).

Yes, the reason was that the free space was less than 500mb and not only logs were printed completely without any skips, but the lags disappeared during the test (it is unclear why any lags occur at all if logs are printed anyway regardless of the test). But how does the user know that we need at least 500Mb? Why not 2Mb, 100Mb, 100500Gb? - The agent/tester should display messages about problems interfering with normal operation.

And, there just needs to be a choice of what to output to the log.

 
Alexey Viktorov:

I think I've found the cause and a temporary solution to this problem. It's hard for me to explain how this happens, but it seems that the colour buffer is interfering and messing everything up.


Here's what I changed in the source code and the problem disappeared

  1. Put index DRAW_COLOR_HISTOGRAM "at the end" so that INDICATOR_COLOR_INDEX was last.
  2. If the buffer is not to be filled with a value, it must be filled with PLOT_EMPTY_VALUE
Didn't work:) Ok, no need to guess, we need to get an answer from the SD. Such crutches shouldn't be acceptable anyway!
Reason: