You don't need to specify folder.
If file exists in "Files" folder, this is enough:
int fileHandle = FileOpen(fileName, FILE_READ|FILE_CSV);
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
I understand MT5 can not write file to directories other than in its own sub directory for security reason. Here, I am trying to read a file.
I am putting a csv file, "ssTestData.csv", to the folder "C:\Users\nick\AppData\Roaming\MetaQuotes\Terminal\158904DFD898D640E9B813D10F9EB397\Files\" in my Windows 8 computer.
The folder path is obtained by this code:
Here is the code I use to read file content, but the handle value is always -1.
I suspect the problem is because of the wrong path and the code couldn't find the file. I also tried to use fileName directly without the "directory+", but handle value is always -1.
Can you please tell me where I should put the "ssTestData.csv", and how to specify the path for reading?
Thanks a lot!