Hello,
I think the question is very primitive, but it does not work.
There is a script for MT5 that loads the history of quotes for the specified dates to the file. But you need a history of quotes only for the last 72 hours and do not want to change the dates every hour.
Here is the original script
input datetime start_date = D’01.10.2018′; // Start Date
input datetime end_date = D’01.10.2019′; // End Date
As I logically understand it, start_date is equal to the current date, and end_date = start_date + 72 hours.
Please tell me how to write it.
borfor
Thanks!
vitales
That is, you have this code start_date = TimeCurrent () – 72*3600 – Shows the date 24-hours ago from the current time?
According to the help, the TimeCurrent() function returns the server time when the last quote for any of the symbols in the “market overview”arrived. At the weekend, quotes are not transmitted to the terminal, perhaps the error is related to this.
barabashkakvn
Check if TimeCurrent() returns a value of 0 (i.e. 1970.01.00)
borfor
Vitaly, thank you.
I really messed up a little, end_date should be the current date and time, then start_date will be start_date = end_date-72*3600
This is understandable. And how to set end_date to the current date and time? If you can show it in the code, the script code is attached. Since I’m trying to just insert this function, but it writes an error when compiling.
vitales
end_date = start_date + 72*3600