Errors, bugs, questions - page 946

 
Sorry again...

This isn't working out for me.

void OnDeinit(const int reason)
{
  Comment("");
  string folder=(SubFolder+"\\experts\\files\\"); 
  string file_name=(Symbol()+".csv");     // variable for storing file names
  string filter=".csv"; // filter for searching the files
//--- receive the search handle in the local folder's root
  long search_handle=FileFindFirst(filter,folder);
//--- check if FileFindFirst() executed successfully
  if(search_handle!=INVALID_HANDLE)
  {
//--- searching files in the loop
    do
    {
//--- reset the error value
      ResetLastError();
//--- receive the file creation date
      PrintFormat(Symbol()+".csv"+" file deleted!",file_name);
//--- delete the old file
      FileDelete(file_name);
    }
    while(FileFindNext(search_handle,folder));
//--- close the search handle
    FileFindClose(search_handle);
  }
  else
  {
    Print(Symbol()+".csv"+" File not found!");
    return;
  }
//--- check what files have remained
  PrintFormat("Results:");
}

 
Rone:
Thank you for your reply. A word or two about ON_EXTERNAL_EVENT - in what situations should it be used?
To transfer an event from an application to another application (for example).
 
G001:
Sorry again...

It's not working for me.

This is the base path:
C:\Users\User\AppData\Roaming\MetaQuotes\Terminal\***********\MQL5\Files
i.e.
FileOpen("experts\\files\\1.txt",FILE_WRITE);

Will create the next tree:

C:\Users\User\AppData\Roaming\MetaQuotes\Terminal\**********MQL5\Files\experts\files\1.txt

and if you useFILE_COMMON

FileOpen("experts\\files\\1.txt",FILE_WRITE|FILE_COMMON);
then the file will be created in:
C:\ProgramData\MetaQuotes\Terminal\Common\Files\experts\files\1.txt
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы ввода/вывода / Флаги открытия файлов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы ввода/вывода / Флаги открытия файлов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы ввода/вывода / Флаги открытия файлов - Документация по MQL5
 
fyords:
This is the base path:ie.

will create the next tree:

and if you useFILE_COMMON

then the file will be created in:

Thank you, I have a file created:

input string SubFolder = "TransMission";
int Handle=FileOpen(SubFolder+"\\experts\\files\\"+Symbol()+".csv",FILE_WRITE|FILE_SHARE_READ|FILE_ANSI,';');

How do I look for it there?

 
G001:

Thank you, I have a file created:

How do I look for it there?

So you have it:

C:\Users\***\AppData\Roaming\MetaQuotes\Terminal\**********\MQL5\Files\TransMission\experts\files\***.txt

Or did I misunderstand the question?
If you open it with a second EA, you specify exactly the same path.

 
In the strategy tester(visualisation mode), should IndicatorRelease work ?
 
sion:
In the strategy tester(visualisation mode), should IndicatorRelease work?
No, it should not
 
stringo:
No, it should not.
It may be desirable to add this fact in the manual of this function. The Expert Advisor doesn't start well with my method of startup (although it's not really needed).
 
fyords:

So you have it:

Or have I misunderstood the question?
If you open with a second EA, you specify exactly the same path.

Yes, that's right, there.
The same indicator should also delete the file from there when you deinitialise it.
Документация по MQL5: Файловые операции / FileDelete
Документация по MQL5: Файловые операции / FileDelete
  • www.mql5.com
Файловые операции / FileDelete - Документация по MQL5
 
G001:
Yes, that's right, there.
The same indicator should also delete the file from there when deinitialised.

Then what are the problems

FileDelete(SubFolder+"\\experts\\files\\"+Symbol()+".csv");