Erreurs, bugs, questions - page 2387

 
Dmitriy Burlachenko:

Bonjour à tous.

Développeurs et gourous, veuillez nous conseiller. CopyTicksRange dans le testeur sur des données historiques en mode "All ticks" et "Every tick based on real ticks" renvoie 0 ticks et le code d'erreur 0 - pourquoi?

MT5 construit en 1996. Le symbole est RTS-3.19. Le courtier est Otkrytie. Le compte est un compte réel. Le calendrier est correct. Il y a l'histoire de cette période.

"Erreur de réception de l'historique des tics ! Du 08.02.2019 11:16 au 14.02.2019 23:48. Code d'erreur : 0. Opération terminée avec succès." :)

En même temps, le même code donne honnêtement tous les ticks dans le testeur sur des données réelles et en ligne fonctionne sans problèmes. Qu'est-ce que je fais de mal ?
Quelle est la durée du test ? Cette heure de test est-elle postérieure à 2019.02.14 23:48 ?
 

Mais non, l'erreur est réapparue au même endroit...

Probablement que seuls les points ayant les mêmes coordonnées... pourquoi ce chèque n'est pas dans la classe...

 
Dmitriy Burlachenko:

Bonjour à tous.

Développeurs et gourous, veuillez nous conseiller. CopyTicksRange dans le testeur sur des données historiques en mode "All ticks" et "Every tick based on real ticks" renvoie 0 ticks et le code d'erreur 0 - pourquoi?

MT5 construit en 1996. Le symbole est RTS-3.19. Le courtier est Otkrytie. Le compte est un compte réel. Le calendrier est correct. Il y a l'histoire de cette période.

"Erreur de réception de l'historique des tics ! Du 08.02.2019 11:16 au 14.02.2019 23:48. Code d'erreur : 0. Opération terminée avec succès." :)

En même temps, le même code donne honnêtement tous les ticks dans le testeur sur des données réelles et en ligne fonctionne sans problèmes. Qu'est-ce que je fais de mal ?

J'ai rédigé un conseiller expert chiffonné.

//+------------------------------------------------------------------+
//|                                           TestCopyTicksRange.mq5 |
//|                        Copyright 2019, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

datetime ExtNextBar=0;
datetime ExtTimes[];
MqlTick  ExtTicksAll[];
MqlTick  ExtTicksTrade[];
MqlTick  ExtTicksInfo[];
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   ExtNextBar=NextBarTime(TimeCurrent(),_Period);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   datetime from=D'2019.02.08 11:16';
   datetime to=D'2019.02.14 23:48';
   ulong    from_msc=from*1000;
   ulong    to_msc=to*1000;
   int      ticks_trade=CopyTicksRange(_Symbol,ExtTicksTrade,COPY_TICKS_TRADE,from_msc,to_msc);
   int      ticks_info=CopyTicksRange(_Symbol,ExtTicksInfo,COPY_TICKS_INFO,from_msc,to_msc);
   int      ticks_all=CopyTicksRange(_Symbol,ExtTicksAll,COPY_TICKS_ALL,from_msc,to_msc);
   PrintFormat("%s - %s  ticks_trade=%d  ticks_info=%d  ticks_all=%d",TimeToString(from),TimeToString(to),ticks_trade,ticks_info,ticks_all);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   if(TimeCurrent()<ExtNextBar)
      return;
//---
   ExtNextBar=NextBarTime(TimeCurrent(),_Period);
   int copied=CopyTime(_Symbol,_Period,0,7,ExtTimes);
   if(copied>1)
     {
      ulong from_msc=ExtTimes[0]*1000;
      ulong to_msc=ExtTimes[copied-1]*1000;
      int   ticks_trade=CopyTicksRange(_Symbol,ExtTicksTrade,COPY_TICKS_TRADE,from_msc,to_msc);
      int   ticks_info=CopyTicksRange(_Symbol,ExtTicksInfo,COPY_TICKS_INFO,from_msc,to_msc);
      int   ticks_all=CopyTicksRange(_Symbol,ExtTicksAll,COPY_TICKS_ALL,from_msc,to_msc);
      PrintFormat("%s - %s  ticks_trade=%d  ticks_info=%d  ticks_all=%d",TimeToString(ExtTimes[0]),TimeToString(ExtTimes[copied-1]),ticks_trade,ticks_info,ticks_all);
     }
   else
      PrintFormat("copied=%d  last_error=%d",copied,GetLastError());
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
datetime NextBarTime(datetime last_time,ENUM_TIMEFRAMES period)
  {
   int         period_seconds=PeriodSeconds(period);
   int         shift;
   MqlDateTime str_time;
//---
   switch(period)
     {
      case PERIOD_MN1 :
         TimeToStruct(last_time,str_time);
         str_time.day=1;
         str_time.hour=0;
         str_time.min=0;
         str_time.sec=0;
         str_time.mon++;
         if(str_time.mon>12)
           {
            str_time.mon=1;
            str_time.year++;
           }
         last_time=StructToTime(str_time);
         break;
      case PERIOD_W1 :
         shift=int(last_time%period_seconds);
         shift+=(shift>=(3*86400))?(-3*86400):(4*86400);
         last_time-=shift;
         last_time+=period_seconds;
         break;
      default :
         last_time/=period_seconds;
         last_time++;
         last_time*=period_seconds;
     }
//---
   return(last_time);
  }
//+------------------------------------------------------------------+

Dans OnDeinit "test shot" sur vos dates

Voici le journal du test

2019.02.19 15:12:32.360 127.0.0.1       login (build 1996)
2019.02.19 15:12:32.386 Network 3860 bytes of account info loaded
2019.02.19 15:12:32.386 Network 1482 bytes of tester parameters loaded
2019.02.19 15:12:32.386 Network 188 bytes of input parameters loaded
2019.02.19 15:12:32.429 Network 26288 bytes of symbols list loaded
2019.02.19 15:12:32.429 Tester  expert file added: Experts\Tester\TestCopyTicksRange.ex5. 16251 bytes loaded
2019.02.19 15:12:32.446 Tester  initial deposit 100000.00 RUR, leverage 1:100
2019.02.19 15:12:32.451 Tester  successfully initialized
2019.02.19 15:12:32.451 Network 35 Kb of total initialization data received
2019.02.19 15:12:32.451 Tester  Intel Xeon  E5-2630 v4 @ 2.20 GHz, 65457 MB
2019.02.19 15:12:32.455 Symbols RTS-3.19: symbol to be synchronized
2019.02.19 15:12:32.455 Symbols RTS-3.19: symbol synchronized, 3864 bytes of symbol info received
2019.02.19 15:12:32.460 History RTS-3.19: load 31 bytes of history data to synchronize in 0:00:00.003
2019.02.19 15:12:32.460 History RTS-3.19: history synchronized from 2017.05.04 to 2019.02.18
2019.02.19 15:12:32.460 Ticks   RTS-3.19: ticks synchronization started
2019.02.19 15:12:32.467 Ticks   RTS-3.19: load 38 bytes of tick data to synchronize in 0:00:00.000
2019.02.19 15:12:32.467 Ticks   RTS-3.19: history ticks synchronized from 2019.01.03 to 2019.02.15
2019.02.19 15:12:32.500 History RTS-3.19,Daily: history cache allocated for 174 bars and contains 162 bars from 2018.01.03 00:00 to 2019.01.31 00:00
2019.02.19 15:12:32.500 History RTS-3.19,Daily: history begins from 2018.01.03 00:00
2019.02.19 15:12:32.579 Tester  RTS-3.19,Daily (Open-Broker): generating based on real ticks
2019.02.19 15:12:32.579 Tester  RTS-3.19,Daily: testing of Experts\Tester\TestCopyTicksRange.ex5 from 2019.02.01 00:00 to 2019.02.18 00:00 started
2019.02.19 15:12:33.020 Ticks   RTS-3.19 : real ticks begin from 2019.01.03 00:00:00
2019.02.19 15:12:33.780 TestCopyTicksRange (RTS-3.19,D1)        2019.02.04 09:45:01   2019.01.24 00:00 - 2019.02.01 00:00  ticks_trade=946026  ticks_info=309512  ticks_all=1255538
2019.02.19 15:12:34.370 TestCopyTicksRange (RTS-3.19,D1)        2019.02.05 00:00:41   2019.01.25 00:00 - 2019.02.04 00:00  ticks_trade=915869  ticks_info=297066  ticks_all=1212935
2019.02.19 15:12:34.938 TestCopyTicksRange (RTS-3.19,D1)        2019.02.06 00:00:30   2019.01.28 00:00 - 2019.02.05 00:00  ticks_trade=907758  ticks_info=287220  ticks_all=1194978
2019.02.19 15:12:35.517 TestCopyTicksRange (RTS-3.19,D1)        2019.02.07 00:02:28   2019.01.29 00:00 - 2019.02.06 00:00  ticks_trade=897199  ticks_info=280798  ticks_all=1177997
2019.02.19 15:12:36.086 TestCopyTicksRange (RTS-3.19,D1)        2019.02.08 00:03:00   2019.01.30 00:00 - 2019.02.07 00:00  ticks_trade=858459  ticks_info=270151  ticks_all=1128610
2019.02.19 15:12:36.639 TestCopyTicksRange (RTS-3.19,D1)        2019.02.11 09:45:04   2019.01.31 00:00 - 2019.02.08 00:00  ticks_trade=847118  ticks_info=265898  ticks_all=1113016
2019.02.19 15:12:37.160 TestCopyTicksRange (RTS-3.19,D1)        2019.02.12 00:04:45   2019.02.01 00:00 - 2019.02.11 00:00  ticks_trade=804551  ticks_info=248516  ticks_all=1053067
2019.02.19 15:12:37.683 TestCopyTicksRange (RTS-3.19,D1)        2019.02.13 00:00:58   2019.02.04 00:00 - 2019.02.12 00:00  ticks_trade=800227  ticks_info=237735  ticks_all=1037962
2019.02.19 15:12:38.304 TestCopyTicksRange (RTS-3.19,D1)        2019.02.14 00:02:42   2019.02.05 00:00 - 2019.02.13 00:00  ticks_trade=842496  ticks_info=243062  ticks_all=1085558
2019.02.19 15:12:38.992 TestCopyTicksRange (RTS-3.19,D1)        2019.02.15 00:04:54   2019.02.06 00:00 - 2019.02.14 00:00  ticks_trade=922073  ticks_info=258989  ticks_all=1181062
2019.02.19 15:12:39.017 Tester  final balance 100000.00 RUR
2019.02.19 15:12:39.512 TestCopyTicksRange (RTS-3.19,D1)        2019.02.15 23:49:59   2019.02.08 11:16 - 2019.02.14 23:48  ticks_trade=856695  ticks_info=240266  ticks_all=1096961
2019.02.19 15:12:39.578 Tester  RTS-3.19,Daily: 2187070 ticks, 11 bars generated. Environment synchronized in 0:00:00.101. Test passed in 0:00:07.118 (including ticks preprocessing 0:00:00.453).
2019.02.19 15:12:39.578 Tester  RTS-3.19,Daily: total time from login to stop testing 0:00:07.219 (including 0:00:00.101 for history data synchronization)
2019.02.19 15:12:39.578 Tester  570 Mb memory used including 0.47 Mb of history data, 128 Mb of tick data
2019.02.19 15:12:39.578 Tester  log file "E:\MetaTrader5\Client\MetaTrader5Terminal\Final\Tester\Agent-127.0.0.1-3000\logs\20190219.log" written
2019.02.19 15:12:39.594         test Experts\Tester\TestCopyTicksRange.ex5 on RTS-3.19,Daily thread finished
2019.02.19 15:12:44.676 127.0.0.1       prepare for shutdown

Tout est copié.

 
Slava:

J'ai écrit un expert en vérification sur mes genoux

Cela signifie que le code complet n'est pas mis à disposition pour être reproduit par les personnes concernées.

 
Aleksey Vyazmikin:

Mais non, l'erreur est réapparue au même endroit...

Probablement que seuls les points ayant les mêmes coordonnées... pourquoi ce chèque n'est pas dans la classe...

Ce contrôle a permis...

int Size_arr_X=ArraySize(X);

   if(Size_arr_X>1)
     {
      int Marker=0;
      for(int i=0;i<Size_arr_X;i++)
        {
         if(X[0]!=X[i] && Y[0]!=Y[i]){Marker=1;break;}
        }
      if(Marker>0)
        {
         A.PointsFill(false);//Устанавливает флаг, указывающий, нужно ли выполнять заливку для точек, определяющих кривую при отрисовке точками. 
         A.PointsType(POINT_CIRCLE);//Устанавливает флаг, указывающий на тип точек, использующихся при отрисовке кривой точками.

         A.TrendLineVisible(true);//Устанавливает флаг, который определяет видимость трендовой линии
         A.TrendLineColor(ColorToARGB(Red,256));//Устанавливает цвет трендовой линии для кривой
        }
     }
 
Slava:

Rédigé sur le genou d'un expert vérificateur

Dans OnDeinit "test shot" sur vos dates

Voici le journal des tests

Tout est copié.

Je n'ai pas de conseiller expert, j'ai un indicateur ! Je pense que c'est pour cela que le résultat est différent.

 
Slava:
Quelle est la durée du test ? Cette heure de test est-elle postérieure à 2019.02.14 23:48 ?

Oui, le temps du testeur est plus long.

 
Dmitriy Burlachenko:

Je n'ai pas d'expert, j'ai un indicateur ! Je pense que cela donne un résultat différent.

Je n'ai pas vu votre déclaration sur l'indicateur
 
Dmitriy Burlachenko:

Je n'ai pas d'expert, j'ai un indicateur ! Je pense que cela donne un résultat différent.

Pas de problème. Voici l'indicateur

//+------------------------------------------------------------------+
//|                                           TestCopyTicksRange.mq5 |
//|                        Copyright 2019, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
datetime ExtNextBar=0;
datetime ExtTimes[];
MqlTick  ExtTicksAll[];
MqlTick  ExtTicksTrade[];
MqlTick  ExtTicksInfo[];
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   ExtNextBar=NextBarTime(TimeCurrent(),_Period);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| deinitialization function                                        |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   datetime from=D'2019.02.08 11:16';
   datetime to=D'2019.02.14 23:48';
   ulong    from_msc=from*1000;
   ulong    to_msc=to*1000;
   int      ticks_trade=CopyTicksRange(_Symbol,ExtTicksTrade,COPY_TICKS_TRADE,from_msc,to_msc);
   int      ticks_info=CopyTicksRange(_Symbol,ExtTicksInfo,COPY_TICKS_INFO,from_msc,to_msc);
   int      ticks_all=CopyTicksRange(_Symbol,ExtTicksAll,COPY_TICKS_ALL,from_msc,to_msc);
   PrintFormat("%s - %s  ticks_trade=%d  ticks_info=%d  ticks_all=%d",TimeToString(from),TimeToString(to),ticks_trade,ticks_info,ticks_all);
  }
//+------------------------------------------------------------------+
//| 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(TimeCurrent()<ExtNextBar)
      return(rates_total);
//---
   ExtNextBar=NextBarTime(TimeCurrent(),_Period);
   int copied=CopyTime(_Symbol,_Period,0,7,ExtTimes);
   if(copied>1)
     {
      ulong from_msc=ExtTimes[0]*1000;
      ulong to_msc=ExtTimes[copied-1]*1000;
      int   ticks_trade=CopyTicksRange(_Symbol,ExtTicksTrade,COPY_TICKS_TRADE,from_msc,to_msc);
      int   ticks_info=CopyTicksRange(_Symbol,ExtTicksInfo,COPY_TICKS_INFO,from_msc,to_msc);
      int   ticks_all=CopyTicksRange(_Symbol,ExtTicksAll,COPY_TICKS_ALL,from_msc,to_msc);
      PrintFormat("%s - %s  ticks_trade=%d  ticks_info=%d  ticks_all=%d",TimeToString(ExtTimes[0]),TimeToString(ExtTimes[copied-1]),ticks_trade,ticks_info,ticks_all);
     }
   else
      PrintFormat("copied=%d  last_error=%d",copied,GetLastError());
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
datetime NextBarTime(datetime last_time,ENUM_TIMEFRAMES period)
  {
   int         period_seconds=PeriodSeconds(period);
   int         shift;
   MqlDateTime str_time;
//---
   switch(period)
     {
      case PERIOD_MN1 :
         TimeToStruct(last_time,str_time);
         str_time.day=1;
         str_time.hour=0;
         str_time.min=0;
         str_time.sec=0;
         str_time.mon++;
         if(str_time.mon>12)
           {
            str_time.mon=1;
            str_time.year++;
           }
         last_time=StructToTime(str_time);
         break;
      case PERIOD_W1 :
         shift=int(last_time%period_seconds);
         shift+=(shift>=(3*86400))?(-3*86400):(4*86400);
         last_time-=shift;
         last_time+=period_seconds;
         break;
      default :
         last_time/=period_seconds;
         last_time++;
         last_time*=period_seconds;
     }
//---
   return(last_time);
  }
//+------------------------------------------------------------------+

Voici les journaux.

2019.02.19 17:17:41.653 Startup MetaTester 5 x64 build 1996 (18 Feb 2019)
2019.02.19 17:17:41.666 Server  MetaTester 5 started on 127.0.0.1:3000
2019.02.19 17:17:41.666 Startup initialization finished
2019.02.19 17:17:42.116 127.0.0.1       login (build 1996)
2019.02.19 17:17:42.193 Network 3860 bytes of account info loaded
2019.02.19 17:17:42.193 Network 1482 bytes of tester parameters loaded
2019.02.19 17:17:42.193 Network 188 bytes of input parameters loaded
2019.02.19 17:17:42.226 Network 26303 bytes of symbols list loaded
2019.02.19 17:17:42.226 Tester  expert file added: Indicators\TestCopyTicksRange.ex5. 15937 bytes loaded
2019.02.19 17:17:42.261 Tester  successfully initialized
2019.02.19 17:17:42.261 Network 35 Kb of total initialization data received
2019.02.19 17:17:42.261 Tester  Intel Xeon  E5-2630 v4 @ 2.20 GHz, 65457 MB
2019.02.19 17:17:42.286 Symbols RTS-3.19: symbol to be synchronized
2019.02.19 17:17:42.287 Symbols RTS-3.19: symbol synchronized, 3864 bytes of symbol info received
2019.02.19 17:17:42.288 History RTS-3.19: history synchronization started
2019.02.19 17:17:42.294 History RTS-3.19: load 31 bytes of history data to synchronize in 0:00:00.004
2019.02.19 17:17:42.294 History RTS-3.19: history synchronized from 2017.05.04 to 2019.02.18
2019.02.19 17:17:42.294 Ticks   RTS-3.19: ticks synchronization started
2019.02.19 17:17:44.303 Ticks   RTS-3.19: load 38 bytes of tick data to synchronize in 0:00:02.016
2019.02.19 17:17:44.303 Ticks   RTS-3.19: history ticks synchronized from 2019.01.03 to 2019.02.15
2019.02.19 17:17:44.351 History RTS-3.19,Daily: history cache allocated for 174 bars and contains 162 bars from 2018.01.03 00:00 to 2019.01.31 00:00
2019.02.19 17:17:44.351 History RTS-3.19,Daily: history begins from 2018.01.03 00:00
2019.02.19 17:17:44.430 Tester  RTS-3.19,Daily (Open-Broker): generating based on real ticks
2019.02.19 17:17:44.430 Tester  RTS-3.19,Daily: testing of Indicators\TestCopyTicksRange.ex5 from 2019.02.01 00:00 to 2019.02.18 00:00 started
2019.02.19 17:17:44.939 Ticks   RTS-3.19 : real ticks begin from 2019.01.03 00:00:00
2019.02.19 17:17:45.938 TestCopyTicksRange (RTS-3.19,D1)        2019.02.04 09:45:05   2019.01.24 00:00 - 2019.02.01 00:00  ticks_trade=946026  ticks_info=309512  ticks_all=1255538
2019.02.19 17:17:46.741 TestCopyTicksRange (RTS-3.19,D1)        2019.02.05 00:04:00   2019.01.25 00:00 - 2019.02.04 00:00  ticks_trade=915869  ticks_info=297066  ticks_all=1212935
2019.02.19 17:17:47.554 TestCopyTicksRange (RTS-3.19,D1)        2019.02.06 00:00:32   2019.01.28 00:00 - 2019.02.05 00:00  ticks_trade=907758  ticks_info=287220  ticks_all=1194978
2019.02.19 17:17:48.324 TestCopyTicksRange (RTS-3.19,D1)        2019.02.07 00:02:28   2019.01.29 00:00 - 2019.02.06 00:00  ticks_trade=897199  ticks_info=280798  ticks_all=1177997
2019.02.19 17:17:49.128 TestCopyTicksRange (RTS-3.19,D1)        2019.02.08 00:03:17   2019.01.30 00:00 - 2019.02.07 00:00  ticks_trade=858459  ticks_info=270151  ticks_all=1128610
2019.02.19 17:17:49.927 TestCopyTicksRange (RTS-3.19,D1)        2019.02.11 09:45:57   2019.01.31 00:00 - 2019.02.08 00:00  ticks_trade=847118  ticks_info=265898  ticks_all=1113016
2019.02.19 17:17:50.666 TestCopyTicksRange (RTS-3.19,D1)        2019.02.12 09:45:00   2019.02.01 00:00 - 2019.02.11 00:00  ticks_trade=804551  ticks_info=248516  ticks_all=1053067
2019.02.19 17:17:51.380 TestCopyTicksRange (RTS-3.19,D1)        2019.02.13 00:00:59   2019.02.04 00:00 - 2019.02.12 00:00  ticks_trade=800227  ticks_info=237735  ticks_all=1037962
2019.02.19 17:17:52.268 TestCopyTicksRange (RTS-3.19,D1)        2019.02.14 09:46:55   2019.02.05 00:00 - 2019.02.13 00:00  ticks_trade=842496  ticks_info=243062  ticks_all=1085558
2019.02.19 17:17:53.255 TestCopyTicksRange (RTS-3.19,D1)        2019.02.15 09:45:19   2019.02.06 00:00 - 2019.02.14 00:00  ticks_trade=922073  ticks_info=258989  ticks_all=1181062
2019.02.19 17:17:53.460 Tester  RTS-3.19,Daily: 2187070 ticks, 11 bars generated. Environment synchronized in 0:00:02.179. Test passed in 0:00:09.167 (including ticks preprocessing 0:00:00.454).
2019.02.19 17:17:53.460 Tester  RTS-3.19,Daily: total time from login to stop testing 0:00:11.346 (including 0:00:02.179 for history data synchronization)
2019.02.19 17:17:53.460 Tester  585 Mb memory used including 0.47 Mb of history data, 128 Mb of tick data
2019.02.19 17:17:53.460 Tester  log file "E:\MetaTrader5\Client\MetaTrader5Terminal\Final\Tester\Agent-127.0.0.1-3000\logs\20190219.log" written
2019.02.19 17:17:53.476         test Indicators\TestCopyTicksRange.ex5 on RTS-3.19,Daily thread finished
2019.02.19 17:17:56.526 127.0.0.1       prepare for shutdown
2019.02.19 17:18:07.970 Tester  close visual tester window
2019.02.19 17:18:07.970 Tester  shutdown tester machine
2019.02.19 17:18:08.951 Server  MetaTester 5 stopped

True OnDeinit avec la demande de contrôle n'a pas fonctionné. En raison du test de l'indicateur. OnDeinit seulement pendant le débogage

 
Slava:

Pas de problème. Voici l'indicateur

Voici les journaux

C'est vrai, OnDeinit avec la demande de contrôle n'a pas été appelé. A cause du test des indicateurs. OnDeinit seulement pendant le débogage

Et pourquoi pendant le débogage sur les données historiques, aucun ticks n'est donné avant la date de début du test ? Le testeur les a reçus et les a synchronisés après tout. Je comprends que dans le mode "All ticks" le testeur ne peut pas générer de ticks avant la date de début du test, mais dans le mode "Every tick based on real ticks" ils sont présents dans l'historique et synchronisés (surlignés en rouge dans le log+) ! Comment déboguer la partie de l'indicateur tick qui est basée sur des données historiques ? Comment obtenir les ticks de la barre time[0] dans le OnCalculate du testeur ?

2019.02.20 10:45:28.357 RTS-3.19: symbol to be synchronized
2019.02.20 10:45:28.357 RTS-3.19: symbol synchronized, 3864 bytes of symbol info received
2019.02.20 10:45:28.365 RTS-3.19: history synchronization started
2019.02.20 10:45:28.382 RTS-3.19: load 5264 bytes of history data to synchronize in 0:00:00.007
2019.02.20 10:45:28.382 RTS-3.19: history synchronized from 2017.05.04 to 2019.02.19
2019.02.20 10:45:28.383 RTS-3.19: ticks synchronization started
2019.02.20 10:45:28.384 RTS-3.19: load 38 bytes of tick data to synchronize in 0:00:00.000
2019.02.20 10:45:28.384 RTS-3.19: history ticks synchronized from 2018.12.17 to 2019.02.18
2019.02.20 10:45:28.402 RTS-3.19,M4: history cache allocated for 15218 bars and contains 14188 bars from 2018.01.03 21:16 to 2019.02.14 23:48
2019.02.20 10:45:28.402 RTS-3.19,M4: history begins from 2018.01.03 21:16
2019.02.20 10:45:28.427 RTS-3.19,M4 (Open-Broker): generating based on real ticks
2019.02.20 10:45:28.427 RTS-3.19,M4: testing of Indicators\TestCopyTicksRange.ex5 from 2019.02.15 00:00 to 2019.02.19 00:00 started
2019.02.20 10:45:28.496 RTS-3.19 : real ticks begin from 2018.12.17 00:00:00
2019.02.20 10:46:20.806 2019.02.15 09:45:19   2019.02.14 23:24 - 2019.02.14 23:48  ticks_trade=0  ticks_info=0  ticks_all=0
2019.02.20 10:46:20.809 2019.02.15 09:47:02   2019.02.14 23:24 - 2019.02.14 23:48  ticks_trade=0  ticks_info=0  ticks_all=0
2019.02.20 10:46:20.863 2019.02.15 09:49:47   2019.02.14 23:24 - 2019.02.14 23:48  ticks_trade=0  ticks_info=0  ticks_all=0
2019.02.20 10:46:20.948 2019.02.15 09:55:21   2019.02.14 23:24 - 2019.02.14 23:48  ticks_trade=0  ticks_info=0  ticks_all=0
2019.02.20 10:46:21.032 2019.02.15 09:57:25   2019.02.14 23:24 - 2019.02.14 23:48  ticks_trade=0  ticks_info=0  ticks_all=0
2019.02.20 10:46:21.200 2019.02.15 10:00:00   2019.02.14 23:28 - 2019.02.15 10:00  ticks_trade=0  ticks_info=15  ticks_all=15
2019.02.20 10:47:25.096 2019.02.15 10:04:00   2019.02.14 23:32 - 2019.02.15 10:04  ticks_trade=3544  ticks_info=973  ticks_all=4517
2019.02.20 10:47:25.099 2019.02.15 10:08:00   2019.02.14 23:36 - 2019.02.15 10:08  ticks_trade=6246  ticks_info=1469  ticks_all=7715
2019.02.20 10:47:25.101 2019.02.15 10:12:00   2019.02.14 23:40 - 2019.02.15 10:12  ticks_trade=7460  ticks_info=1648  ticks_all=9108

Et une autre question : pourquoi OnCalculate a-t-il été appelé 5 fois avant l'apparition des ticks (surlignés en jaune dans le log) ?

Raison: