Testing 'CopyTicks' - page 25

 
Or maybe you tortured him? :)
 
prostotrader:
Or maybe you tortured him? :)

He is. He gets it really bad. I have to hand it to him - he does get into a stupor, but rarely.

I have written a nice tick indicator. I'm too lazy to debug rare failures.

 
fxsaber:

He is. He gets it really bad. I have to hand it to him - he does get into a stupor, but rarely.

I have written a nice tick indicator. I am lazy to debug rare failures.

Manage to fit all the ticks evenly into the candle in real time every time?

Added:

In COPY_TICKS_TRADE mode with volume checking.

 
Alexey Kozitsyn:

Manage to fit all the ticks evenly into the candle in real time every time?

Added:

In COPY_TICKS_TRADE mode with volume checking.

I have a slightly different one. Like "has no analogues" and blah, blah, blah.

I don't think so for performance, as it's promised to improve significantly in the next build.

 
fxsaber:

I have a slightly different one. Like "unparalleled" and blah, blah, blah.

I don't think so for performance, as it's promised to improve significantly in the next build.

It's not about performance... There are situations like this, for example now:

The indicator collects ticks and calculates the volume by them. Then it compares this volume with volume[].

And there are errors in several situations:

Sometimes the volume of the first candle of the day is calculated incorrectly (doesn't coincide with the check one);

Sometimes volume per ticks is calculated correctly but volume returns incorrect value. 3;

3. sometimes volume per ticks is calculated incorrectly, while volume returns an incorrect value;

The most interesting is that if errors 1, 2 or 3 occur on the history, after recompiling the indicator the error doesn't disappear. And in case of connection to another server it disappears.

In short, the miracles are not over yet.

If this post will be read by developers and want to understand - please direct to "Service Desk", I will provide all sources.

 
Renat Fatkhullin:

This is how you should test CopyTicks:

MqlTick ExtArr[2048];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick()
  {
   ulong from   =(TimeTradeServer()-1200)*1000;
   ulong ticks  =GetMicrosecondCount();
   int   records=CopyTicks(_Symbol,ExtArr,COPY_TICKS_INFO,from,2048);

   ticks=GetMicrosecondCount()-ticks;
   Print("Time: ",ticks," msc for ",records," records");
  }

Here is the output in microseconds: 95 microseconds per sample of 2048 INFO ticks for the last 20 minutes

2016.10.18 14:15:38.673 TEST (USDCHF,M1)        Time: 95 msc for 1206 records
This is drastically different from the tens of milliseconds you claimed. That's because you didn't measure CopyTicks.

Braking after the market closes

MqlTick ExtArr[2048];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnStart()
  {
   ulong from   =(TimeCurrent()-1200)*1000;
   ulong ticks  =GetMicrosecondCount();
   int   records=CopyTicks(_Symbol,ExtArr,COPY_TICKS_INFO,from,2048);

   ticks=GetMicrosecondCount()-ticks;
   Print("Time: ",ticks," msc for ",records," records");
  }

Result

2016.10.29 00:31:10.952 Test (GBPUSD,M1)        Time: 85 msc for 1333 records
2016.10.29 00:31:05.435 Test (EURCHF,M1)        Time: 15283 msc for 874 records
2016.10.29 00:31:03.960 Test (EURCHF,M1)        Time: 11629 msc for 874 records
2016.10.29 00:31:02.128 Test (EURCHF,M1)        Time: 10127 msc for 874 records
2016.10.29 00:31:00.332 Test (EURCHF,M1)        Time: 7318 msc for 874 records

2016.10.29 00:30:52.049 Test (EURUSD,M1)        Time: 51 msc for 862 records

It may seem that this is only on the EURCHF. But as soon as we start to pump quotes for EURUSD. As soon as the script starts to run for tens of ms on EURSD. This slowdown has started after the market close. Everything was much faster before market close.

 

Dear developers! The problem with CopyTicks(), and in particular the synchronisation of volumes on a candle (stacking all the tick volumes of a candle in a candle and comparing it to volume[] of that candle). It continues.

Now we have 2 errors again:

1. Stable error of volume control on an opening candle (10.00). I test on RTS, SBRF, Si (all at -12.16). Error on each of these symbols!

2. If for some reason there is an error of volume control on the candlestick after 10.00 in real time, the same error occurs on the history. However! If you change the server, the error on the history disappears.

 

Example to previous post (on error 2):

2016.10.31 12:13:43.699 (Si-12.16,M1)   VolumeControl: Контроль свечи 2016.10.31 10:05 пройден! Контрольная сумма = 3480 (1353+2127)
2016.10.31 12:13:43.699 (Si-12.16,M1)   VolumeControl: Контроль свечи 2016.10.31 10:06 пройден! Контрольная сумма = 4103 (2236+1867)
2016.10.31 12:13:43.699 (Si-12.16,M1)   VolumeControl: ОШИБКА на свече 2016.10.31 10:07! Сумма объемов на покупку = 1074, сумма объемов на продажу = 3917, контрольная сумма (покупки+продажи) = 5009
2016.10.31 12:13:43.699 (Si-12.16,M1)   VolumeControl: Контроль свечи 2016.10.31 10:08 пройден! Контрольная сумма = 3121 (1479+1642)
2016.10.31 12:13:43.699 (Si-12.16,M1)   VolumeControl: Контроль свечи 2016.10.31 10:09 пройден! Контрольная сумма = 3760 (1046+2714)

This is before the server change. And here's the log after the server change:

2016.10.31 12:18:12.109 (Si-12.16,M1)   VolumeControl: Контроль свечи 2016.10.31 10:05 пройден! Контрольная сумма = 3480 (1353+2127)
2016.10.31 12:18:12.109 (Si-12.16,M1)   VolumeControl: Контроль свечи 2016.10.31 10:06 пройден! Контрольная сумма = 4103 (2236+1867)
2016.10.31 12:18:12.109 (Si-12.16,M1)   VolumeControl: Контроль свечи 2016.10.31 10:07 пройден! Контрольная сумма = 5009 (1082+3927)
2016.10.31 12:18:12.109 (Si-12.16,M1)   VolumeControl: Контроль свечи 2016.10.31 10:08 пройден! Контрольная сумма = 3121 (1479+1642)
2016.10.31 12:18:12.110 (Si-12.16,M1)   VolumeControl: Контроль свечи 2016.10.31 10:09 пройден! Контрольная сумма = 3760 (1046+2714)

Here it is, the localised "BORDER"! I myself do not draw here control, values in brackets do not adjust, I do not need it. But there is an error, and it can be fixed by changing the server!

This is the log from the history control (when starting the indicator/clicking the "refresh" button).

 

And now remarks on mistake #1.

Some time after the market opening (about 40 minutes have passed now). With full recalculation of the indicator - there is no error of controlling the candle at 10.00! Even without switching the server. It is as if someone has uploaded additional history to the server.

 

Another observation on error #2:

Если по какой-то причине возникает ошибка контроля объемов на свече после 10.00 в реальном времени, то эта же ошибка возникает и на истории. Однако! Если изменить сервер - ошибка на истории пропадает. 

It seems that the ticks that were previously received locally are cached on the machine and are only overwritten after a server change. That would be fine, but in case they were received in full! But as it turns out, the errors in the history accumulate. And the only way to get rid of them is to change the trade server (at least I know only this way).
Reason: