But I found that there is a line of code should be like this(about line 125 in this script):
line 125: for ( int i = copy_count-1; i >= 0; i -- )...
because of the i > 0(I think it should be i >= 0), there is not the first record.
^_^
if you replace > 0 with >= 0, you retrieve also the data of the last (ie most recent, the current) bar, which is probably incomplete. While this may be the desired behaviour, it may be quite misleading.
Hello my friend, when I run the script the last candle does not appear in the .csv files. For example, in Brazil, the last day of negotiations was the last 4th of September and the export only shows until the 3rd of September.
I exported the .csv in the standard form of Metatrader 5 (File> Save) and the September 4th candle appears. Would you help me?
Hello my friend, when I run the script the last candle does not appear in the .csv files. For example, in Brazil, the last day of negotiations was the last 4th of September and the export only shows until the 3rd of September.
I exported the .csv in the standard form of Metatrader 5 (File> Save) and the September 4th candle appears. Would you help me?
I believe I am doing something wrong. After I finish running my EA on the Strategy Tester, I drag and drop this script into the output chart but I only get empty results. There´s something really basic that I am not getting. Can you help me?
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 attemptsif(++fail_cnt >= 100)
returnfalse;
Doesn't matter if it is 100 or 1 million attempts, the following block never succeeds:
//copying of next part forces data loadingif (CopyTime(symbol,period,size-1,1,times)==1)
{
returntrue;
}
Also in CheckServerHistory:
//Enough data on server?if (first_server_date>TimeCurrent()-size*PeriodSeconds(period))
returnfalse;
this hard condition is *always* returning false because the recognised 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.
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 recognised 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.
Autor: Andrey Khatimlianskii
Hello,
Is it possible to change the script so that the generated .csv file is made from the present to the past?
Grateful for the attention.
Thank you
Is it possible to change the script so that the generated .csv file is made from the present to the past?
Yes, just change this row:
to the following:
Thank you very much. It's works for me!
But I found that there is a line of code should be like this(about line 125 in this script):
line 125: for ( int i = copy_count-1; i >= 0; i -- )...
because of the i > 0(I think it should be i >= 0), there is not the first record.
^_^
if you replace > 0 with >= 0, you retrieve also the data of the last (ie most recent, the current) bar, which is probably incomplete. While this may be the desired behaviour, it may be quite misleading.
Thanks Andrey Khatimlianskii !
Hi!
Just change "i > 0" to "i >= 0" in this row:
Hello,
I believe I am doing something wrong. After I finish running my EA on the Strategy Tester, I drag and drop this script into the output chart but I only get empty results. There´s something really basic that I am not getting. Can you help me?
Thanks
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:
this hard condition is *always* returning false because the recognised 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.
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:
this hard condition is *always* returning false because the recognised 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.