This is clearly a childish question, so it's this way. Somehow I didn't pay attention to it before. The note to the description of the IndicatorDigits function says the following:
By default, the price accuracy of the financial instrument to whose chart the indicator is attached is used.
int File()
{
int P=0;
int filehandle=FileOpen("C:\\Users\\Михаил\\Desktop\\qqq.csv",FILE_READ|FILE_CSV);
if(filehandle!=INVALID_HANDLE)
{
datetime d = FileReadDatetime(filehandle);
int I=FileReadNumber(filehandle);
FileClose(filehandle);
Comment(d+" "+I);
}
else {Comment(GetLastError());}
return P;
}
For security reasons, the MQL5 language strictly controls operations with files. The files that are handled by the MQL5 language file operations cannot be outside the file "sandbox".
If you want to work with directories outside the sandbox, create a shortcut/symbolic link to the necessary directory with"MQL4\\Files" in it.
If you want to work with directories outside the sandbox, create a shortcut/symbolic link to the required directory in it"MQL4\\Files".
OK, copied the file to the Files folder, redid the code, same error
int File()
{
int P=0;
int filehandle=FileOpen(TerminalInfoString(TERMINAL_DATA_PATH)+"\\MQL5\\Files\\"+"qqq.csv",FILE_READ|FILE_CSV);
if(filehandle!=INVALID_HANDLE)
{
datetime d = FileReadDatetime(filehandle);
int I=FileReadNumber(filehandle);
FileClose(filehandle);
Comment(d+" "+I);
}
else {Comment(GetLastError());}
return P;
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Most likely, you put the terminal on the system drive and in the Program Files folder.
If so, choose another drive. Or at least to the root of your system drive. At the start of the installation there is a Setup button
Somehow I didn't pay attention to it before. The note to the description of the IndicatorDigits function says the following:
- The default setting is 4 digits ;
- if IndicatorDigits(Digits) is explicitly specified - 5.
Is it a glitch or what?Although the file exists
Although the file exists
FileOpen
For security reasons, the MQL5 language strictly controls operations with files. The files that are handled by the MQL5 language file operations cannot be outside the file "sandbox".
FileOpen
If you want to work with directories outside the sandbox, create a shortcut/symbolic link to the required directory in it"MQL4\\Files".OK, copied the file to the Files folder, redid the code, same error
OK, copied the file to Files, redid the code, same error
That's enough. There's a pretty good example given there, with the wrong, and the right file opening.
That's enough. There's a pretty good example given there, with the wrong, and the right opening of the file.
when testing an EA, where should the read-only file be located?
when testing an EA, where should the read file be located?
This is from MQL5, but the essence is the same.

This is from MQL5, but the essence is the same.
I found the directory the program accesses, but for some reason it deletes this file qqq.csv during testing