- void OnStart()
- {
- string terminal_data_path=TerminalInfoString(TERMINAL_DATA_PATH);
- string filename=terminal_data_path+"\\MQL4\\Files\"+"fractals.csv";
- int filehandle=FileOpen(filename,FILE_WRITE|FILE_CSV);
- if(filehandle<0)
- {
- Print("Failed to open the file by the absolute path ");
- Print("Error code ",GetLastError());
- }
- ResetLastError();
- filehandle=FileOpen("fractals.csv",FILE_WRITE|FILE_CSV);
- if(filehandle!=INVALID_HANDLE)
- {
- FileWrite(filehandle,TimeCurrent(),Symbol(), EnumToString(ENUM_TIMEFRAMES(_Period)));
- FileClose(filehandle);
- Print("FileOpen OK");
- }
- else Print("Operation FileOpen failed, error ",GetLastError());
复制代码
|