• Get access

[MQL5] CSV files get deleted once read in strategy tester?

To add comments, please log in or register
OrangeTrading
26
OrangeTrading  

In MT5 strategy test, the FileOpen() function deletes the files. 

Why is this happening and what is the solution, please?

 handle=FileOpen(FileName,FILE_CSV|FILE_READ,',');
Alain Verleyen
39007
Alain Verleyen  
OrangeTrading:

In MT5 strategy test, the FileOpen() function deletes the files. 

Why is this happening and what is the solution, please?

FileOpen() doesn't delete files, they are delete automatically.

You have to use #property tester_file. See documentation.

OrangeTrading
26
OrangeTrading  
Alain Verleyen:

FileOpen() doesn't delete files, they are delete automatically.

You have to use #property tester_file. See documentation.


Thanks for your info.

So in my case to maintain the file "data.csv" I add:


#property tester_file "Data.csv"


But then I still see the file being deleted. What am I doing wrong?

Alain Verleyen
39007
Alain Verleyen  
OrangeTrading:

Thanks for your info.

So in my case to maintain the file "data.csv" I add:



But then I still see the file being deleted. What am I doing wrong?

You didn't do anything wrong. As I said it's deleted automatically.

You need to use #property°tester_file, so it will be copied (automatically) again when needed.

What's the problem ?

Ian Frazão
11
Ian Frazão  
Alain Verleyen:

You didn't do anything wrong. As I said it's deleted automatically.

You need to use #property°tester_file, so it will be copied (automatically) again when needed.

What's the problem ?

Hi there,


I also need some help with this automatically file being deleted. How do I use #property°tester_file in order to copy the file I need?


I created a csv file wich is erased every time I run the EA, so I'd like to keep this file in folder.

To add comments, please log in or register