Scripts: sHistoryExport - handy script to export the historical data in the МТ4 format - page 4
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.