Skripte: sHistoryExport - praktisches Skript, um historsiche Daten im МetaТrader 4 Format zu exportieren

 

2021.01.05 21:10:32.910 HistoryExport (Usa500,H1) Downloading history and writing files: 0.0% complete...


// no more than 100 failed attempts
if(++fail_cnt >= 100)
   return false;

Doesn't matter if it is 100 or 1 million attempts, the following block never succeeds:

//copying of next part forces data loading
if (CopyTime(symbol,period,size-1,1,times)==1)
{
   return true;
}
Also in CheckServerHistory:
//Enough data on server?
if (first_server_date>TimeCurrent()-size*PeriodSeconds(period))
   return false;

this hard condition is *always* returning false because the recognized first_server_date is usually nearer to the present than the expected history would reach into the past. Especially if you assign in the charts option the "max bars in chart" to "unlimited" then TERMINAL_MAXBARS will return 1000000 and thus this condition would always consider that there is never enough history loaded.

 
Das Script ist jetzt nicht so lang, geh es mit dem Debugger durch, um zu sehen bei welcher Zeile das Skript warum 'falsch abbiegt'.
 
Marcel Fitzner:

2021.01.05 21:10:32.910 HistoryExport (Usa500,H1) Downloading history and writing files: 0.0% complete...


Doesn't matter if it is 100 or 1 million attempts, the following block never succeeds:

Also in CheckServerHistory:

this hard condition is *always* returning false because the recognized first_server_date is usually nearer to the present than the expected history would reach into the past. Especially if you assign in the charts option the "max bars in chart" to "unlimited" then TERMINAL_MAXBARS will return 1000000 and thus this condition would always consider that there is never enough history loaded.

You're right, I just copied this code from the standard library.

I've already rewritten these functions to fit my needs. But not ready to update the publication at the moment.

Grund der Beschwerde: