CopyTicksRange issue

 

hi all!

i have problem with two functions CopyTicks and CopyTicksRange 

when i use this functions its return no data sometimes(not Always) !?

here is my code

MqlTick ta[];
   datetime  Start_date=iTime(_Symbol,PERIOD_D1,0);
   ulong Start = ulong(Start_date)*1000;
   ulong End=(Start_date+24*60*60)*1000;
   
   //int c=CopyTicks(_Symbol,ta,COPY_TICKS_ALL,Start);
   int c=CopyTicksRange(_Symbol,ta,COPY_TICKS_ALL,Start,End);

i tried with any parameters without success

on some symbols (stock Market) the returned array(ta[]) is empty and (c=0)!!!?? 

thankyou

 
s88719:
...

on some symbols (stock Market) the returned array(ta[]) is empty and (c=0)!!!?? 

thankyou

We need to improve your code.

What will happen if iTime() returns 0 ?

Return Value

The opening time of the bar (indicated by the 'shift' parameter) on the corresponding chart or 0 in case of an error. For error details, call the GetLastError() function.

And it will return 0 soon or later, unless you run it on a D1 chart.

 
Alain Verleyen:

We need to improve your code.

What will happen if iTime() returns 0 ?

And it will return 0 soon or later, unless you run it on a D1 chart.

MT5 will also return a ZERO in the tick data sooner or later, so the developers should also improve their code ;)

I know you can easily code around this, but I reported this issue years ago and it is still not resolved:


Getting back on topic... 

The user (s88719) is most likely experiencing another problem that can be seen when the server date changes (or the market gets closed for the weekend). On the screenshot below you can see that the "last" price in the Market Watch window is up to date, but the requested tick data has a lot of missing ticks while at the same time the 1-minute data is complete.

Incorrect (incomplete) tick data:


Correct 1-minute data:


 
Artur Zas:

MT5 will also return a ZERO in the tick data sooner or later, so the developers should also improve their code ;)

I certainly agree, but that's beyond our control and we can just deal with the reality. And it's off-topic :-D
Getting back on topic... 

The user (s88719) is most likely experiencing another problem that can be seen when the server date changes (or the market gets closed for the weekend). On the screenshot below you can see that the "last" price in the Market Watch window is up to date, but the requested tick data has a lot of missing ticks while at the same time the 1-minute data is complete.

It's hard to say if it's related or not. Your screenshots are from January, is this issue still reproducible with latest build 2360 ? Was the results the same from mql5 code ?

 
Alain Verleyen:
I certainly agree, but that's beyond our control and we can just deal with the reality. And it's off-topic :-D

It's hard to say if it's related or not. Your screenshots are from January, is this issue still reproducible with latest build 2360 ? Was the results the same from mql5 code ?

This behavior is the easiest to spot at the end of the day, but almost always happens on Friday when the market closes so I will test will the latest build this Friday.

You always need to test different symbols and a few will always be out of synch.

The results are consistent with the MQL5 code.

 
Artur Zas:

This behavior is the easiest to spot at the end of the day, but almost always happens on Friday when the market closes so I will test will the latest build this Friday.

You always need to test different symbols and a few will always be out of synch.

The results are consistent with the MQL5 code.

Thanks, if you keep us posted, I will try to check too. Maybe we can push Metaquotes to fix it or at least have some explanations.
 
Alain Verleyen:

We need to improve your code.

What will happen if iTime() returns 0 ?

And it will return 0 soon or later, unless you run it on a D1 chart.

thankyou for your answer

but  i use it for D1 chart always but many time the result is 0

i check iTime() function in my code and it always return true (nonzero) result

 
Artur Zas:

MT5 will also return a ZERO in the tick data sooner or later, so the developers should also improve their code ;)

I know you can easily code around this, but I reported this issue years ago and it is still not resolved:


Getting back on topic... 

The user (s88719) is most likely experiencing another problem that can be seen when the server date changes (or the market gets closed for the weekend). On the screenshot below you can see that the "last" price in the Market Watch window is up to date, but the requested tick data has a lot of missing ticks while at the same time the 1-minute data is complete.

Incorrect (incomplete) tick data:


Correct 1-minute data:


hi Artur!

you are right

i have the same problem when market gets closed

as you mentioned many or all ticks is missing and i can't understand why!

this happens for results that i get by CopyTicks and CopyTicksRange functions

also when i export the data(list of deals) from DOM window (csv format) and compare it with real list of deals on the stock market site, this problem is still exist. 

 
s88719:

thankyou for your answer

but  i use it for D1 chart always but many time the result is 0

i check iTime() function in my code and it always return true (nonzero) result

You need to prove that if you are right and hope for a fix.

Add logging to your code, with the relevant data (chart timeframe, timeframe request, start/end date used, running time.

s88719:

hi Artur!

you are right

i have the same problem when market gets closed

as you mentioned many or all ticks is missing and i can't understand why!

this happens for results that i get by CopyTicks and CopyTicksRange functions

also when i export the data(list of deals) from DOM window (csv format) and compare it with real list of deals on the stock market site, this problem is still exist. 

The code you posted request ticks for a WHOLE day. I strongly doubt that the issue reported by Artur is the same as yours. (Unless your real code is different).

Please post verifiable and (preferably) reproducible data. So we can check it and forward it to Metaquotes developers.

Reason: