- Read from file error!
- Please Help In Opening The File
- Cannot open file on Ubuntu
try:
string filename = "example.ini";
moneykrishna:
void OnTick() <<-- don't open the file every tick { string filename = TerminalInfoString(TERMINAL_DATA_PATH) + "\\MQL5\\Files\\example.ini"; <<-- incorrect path see documentation int file_handle = FileOpen(filename, 1); <<---- what is this supposed to be? don't use numerics for enumerations if (file_handle == INVALID_HANDLE) { Comment("Failed to open file: " + filename + GetLastError()); return; }https://www.mql5.com/en/docs/files/fileopen
Documentation on MQL5: File Functions / FileOpen
- www.mql5.com
FileOpen - File Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
tring filename = TerminalInfoString(TERMINAL_DATA_PATH) + "\\MQL5\\Files\\example.ini";
File Write Problem (Error: 5002) - Expert Advisors and Automated Trading - MQL5 programming forum #1-2 (2020)
and FolderDelete using TERMINAL_DATA_PATH - General - MQL5 programming forum (2017)
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