How to check for a specific data before download - page 2

 
Marcel Fitzner:

Since the OP has still not been answered - and I finally saw one of those crazy cases where my broker did not properly send the history of a symbol, I'd like to revive this thread.

One pic shall explain what I mean:

With a request (like Gustavo did):

firstServerDate is exactly the first date as shown in the chart (06.01.2012) and Bars("CRDI.IT", PERIOD_D1) will return ~2300 bars while the history - where actual values are available through CopyTime, CopyRates and so forth - starts at the 22.09.2016. (Btw. between that point and now are around 1100 bars)

For some reason CopyTime("CRDI.IT", PERIOD_D1, 2300, 1, times) (with times being a static array with just 1 element) hangs there for ~4 minutes(!!) until it eventually figures out that there is no data available and an error 4401 is produced.

To me the main question remains:

   Is there a smarter way to fetching the actually available history and avoid waiting for a lengthy time or is this the best possible way already? 

Maybe this is/was the case for other trader coder friends here as well. If you happen to have any good advice, I'd appreciate your help much!


This is the method I've been working with and which checks the server history:


Cheers,

Marcel

What server ?
 

Hi Alain,

server as in 

SERIES_SERVER_FIRSTDATE

which pulls the first date in the available history provided by the server of the broker I'm connecting to.

 
Marcel Fitzner:

Hi Alain,

server as in 

which pulls the first date in the available history provided by the server of the broker I'm connecting to.

I am asking you which broker server you are using, to check by myself.
 

I'm connecting to "ActivTradesEuropeServer" currently with this list of servers available:


 

The CopyTime method takes for any of these servers around 4 minutes according to the timestamps before and after calling CopyTime:


.. and so it loops and loops on 'CRDI.IT' until a predefined number of re-attempts have failed. If the number of re-attempts is 10 then 4 minutes x 10 = 40 minutes for symbol with an erroneous history :O

 
Marcel Fitzner:

The CopyTime method takes for any of these servers around 4 minutes according to the timestamps before and after calling CopyTime:


.. and so it loops and loops on 'CRDI.IT' until a predefined number of re-attempts have failed. If the number of re-attempts is 10 then 4 minutes x 10 = 40 minutes for symbol with an erroneous history :O

I only have a demo account, with a symbol CRDI.IT-d

I can't reproduce the problem unfortunately.

2021.04.17 13:51:10.542    206398 (CRDI.IT-d,H1)    ask for built bars...
2021.04.17 13:51:10.543    206398 (CRDI.IT-d,H1)    Copy Time... barsToTryToDownload-1: 1499, Symbol:CRDI.IT-d
2021.04.17 13:51:10.543    206398 (CRDI.IT-d,H1)    Could not copy 1 bar at bar #1499! Error : 4401
2021.04.17 13:51:10.557    206398 (CRDI.IT-d,H1)    ask for built bars...
2021.04.17 13:51:10.557    206398 (CRDI.IT-d,H1)    Copy Time... barsToTryToDownload-1: 1499, Symbol:CRDI.IT-d
2021.04.17 13:51:10.558    206398 (CRDI.IT-d,H1)    Could not copy 1 bar at bar #1499! Error : 4401
2021.04.17 13:51:10.573    206398 (CRDI.IT-d,H1)    ask for built bars...
2021.04.17 13:51:10.573    206398 (CRDI.IT-d,H1)    Copy Time... barsToTryToDownload-1: 1499, Symbol:CRDI.IT-d
2021.04.17 13:51:10.573    206398 (CRDI.IT-d,H1)    Could not copy 1 bar at bar #1499! Error : 4401

 

That's interesting. Thanks for testing out the routine.

Maybe deleting the cached history file works. I'll check tomorrow

Cheers,

Marcel

 

Just to wrap this up, I cleared the cache with history and tick data of that symbol, yet it had the same issue.

Luckily from around 2k symbols I'm processing periodically it is just this one, so it can be handled in an additional program instance that takes care for slowpokes like that one. :)