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

 

Hallo,


Ist es möglich, das Skript so zu ändern, dass die erzeugte .csv-Datei von der Gegenwart in die Vergangenheit umgewandelt wird?

Vielen Dank für Ihre Aufmerksamkeit.

Dankeschön

 
CarlosFa:

Ist es möglich, das Skript so zu ändern, dass die erzeugte .csv-Datei von der Gegenwart in die Vergangenheit übertragen wird?

Ja, ändern Sie einfach diese Zeile:

for ( int i = copy_count-1; i > 0; i -- )

in die folgende:

for ( int i = 1; i < copy_count; i ++ )
 
metatrader 5 benutzerdefinierte Diagramm konvertieren Datei. Datei lässt sich nicht öffnen, bitte um Hilfe
 
Lvbey:

Vielen Dank, bei mir hat es geklappt!

Aber ich fand, dass es eine Zeile des Codes sollte wie folgt sein(über Zeile 125 in diesem Skript):

Zeile 125: for ( int i = copy_count-1; i >= 0; i -- )...

wegen des i > 0 (ich denke, es sollte i >= 0 sein), gibt es nicht den ersten Datensatz.

^_^

Wenn Sie > 0 durch >= 0 ersetzen, erhalten Sie auch die Daten des letzten (d. h. jüngsten, aktuellen) Balkens, die wahrscheinlich unvollständig sind. Dies mag zwar das gewünschte Verhalten sein, aber es kann ziemlich irreführend sein.


Vielen Dank , Andrey Khatimlianskii!

 
Hallo mein Freund, wenn ich das Skript ausführe, erscheint die letzte Kerze nicht in den .csv-Dateien. Zum Beispiel war in Brasilien der letzte Verhandlungstag der 4. September und der Export zeigt nur bis zum 3. September.
Ich habe die .csv-Datei in der Standardform von Metatrader 5 exportiert (Datei> Speichern) und die Kerze vom 4. September erscheint. Können Sie mir helfen?
 
gscruzz:
Hallo mein Freund, wenn ich das Skript ausführe, erscheint die letzte Kerze nicht in den .csv-Dateien. Zum Beispiel war in Brasilien der letzte Verhandlungstag der 4. September und der Export zeigt nur bis zum 3. September.
Ich habe die .csv-Datei in der Standardform von Metatrader 5 exportiert (Datei> Speichern) und die Kerze vom 4. September erscheint. Können Sie mir helfen?

Hallo!

Ändern Sie einfach "i > 0" in "i >= 0" in dieser Zeile:

for ( int i = copy_count-1; i >= 0; i -- )
 

Hallo,

ich glaube, ich mache etwas falsch. Nachdem ich meinen EA auf dem Strategy Tester ausgeführt habe, ziehe ich dieses Skript in den Ausgabetabelle, aber ich erhalte nur leere Ergebnisse. Es gibt etwas wirklich grundlegendes, das ich nicht bekomme. Können Sie mir helfen?

Vielen Dank

The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
What are the differences between the three modes of testing in MetaTrader 5, and what should be particularly looked for? How does the testing of an EA, trading simultaneously on multiple instruments, take place? When and how are the indicator values calculated during testing, and how are the events handled? How to synchronize the bars from different instruments during testing in an "open prices only" mode? This article aims to provide answers to these and many other questions.
 

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.