I need to read dates and values from a CSV file but when I print the values in console it is as if they were not assigned or read.
This is the file to read:
This is the code:
I get in the console:
Did you only dare to read the documentation ?
FileReadDatetime
Reads from the file of CSV type a string of one of the formats: "YYYY.MM.DD HH:MI:SS", "YYYY.MM.DD" or "HH:MI:SS" - and converts it into a value of datetime type.
LoL I have to use the points!
yes, I read the documentation but in a hurry, and the cat in haste made her children blind.
I was really convinced that slashes were needed but thanks to your emphasis I could see the opposite.
thank you and don't die laughing
ok, no more chatter and let's be serious.
I changed the file from which to read the data like this:
1971.01.01;-18.8551 1971.01.02;-18.8966 1971.01.03;-18.9375 1971.01.04;-18.9780 1971.01.05;-19.179 1971.01.06;-19.0573 1971.01.07;-19.0961 1971.01.08;-19.1345 1971.01.09;-19.1723 1971.01.10;-19.2096 1971.01.11;-19.2464 1971.01.12;-19.2826 1971.01.13;-19.3183 1971.01.14;-19.3535 1971.01.15;-19.3881 1971.01.16;-19.42022 1971.01.17;-19.4558 1971.01.18;-19.4888 1971.01.19;-19.52013 1971.01.20;-19.5532
the problem remains the same, on the console it print 1970.01.01 00:00:00 0.0
I also tried to insert this code in the for loop:
FileSeek(fileHandle, i, SEEK_SET);in this case it prints me today's date
now what is the solution?
ok, no more chatter and let's be serious.
I changed the file from which to read the data like this:
the problem remains the same, on the console it print 1970.01.01 00:00:00 0.0
I also tried to insert this code in the for loop:
in this case it prints me today's datenow what is the solution?
Seriously ?
Seems I have to say you to read the documentation again. This time about FileReadDouble().
Please consider you have to read the documentation for all what you are using in MQL, we will win some time
Seriously ?
Seems I have to say you to read the documentation again. This time about FileReadDouble().
Please consider you have to read the documentation for all what you are using in MQL, we will win some time
Exactly! You can't use FileReadDouble() with CSV Text files. You can only use it with Binary files where the "doubles" are stored in Binary format, not in a textual format.
Instead use FileReadNumber().
- www.mql5.com
I need to read dates and values from a CSV file but when I print the values in console it is as if they were not assigned or read.
This is the file to read:
This is the code:
I get in the console:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I need to read dates and values from a CSV file but when I print the values in console it is as if they were not assigned or read.
This is the file to read:
This is the code:
I get in the console: