File operations are carried out in a sandbox. You can't use direct file paths. File paths are relative to the "MQL5\Files" path.
Note
For security reasons, work with files is strictly controlled in the MQL5 language. Files with which file operations are conducted using MQL5 means, cannot be outside the file sandbox.
Deletes the specified file from a local folder of the client terminal (MQL5\Files or MQL5\Tester\Files in case of testing). If common_flag = FILE_COMMON, then the function removes the file from the shared folder for all client terminals \Terminal\Common\Files.
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
Hi, I tried to delete a file and clear a cache from strategy tester and here's how I do it.
and here's the print statement from the journal
2024.01.13 14:03:12.187 Core 1 2022.10.06 00:00:00 ===== ERROR - failed to clear folder C:\Users\ezral\AppData\Roaming\MetaQuotes\Terminal\C71DA05AFD17F05D0A3C50314A211092\Tester\cache\ with error code 5002 =====
2024.01.13 14:03:12.187 Core 1 2022.10.06 00:00:00 Location Path: \MQL5\Files\Reports\10 mean reversion\ATRl\PERIOD_M15\
2024.01.13 14:03:12.187 Core 1 2022.10.06 00:00:00 backtest: \MQL5\Files\Reports\10 mean reversion\ATR\PERIOD_M15\ATR AUDCAD Long Trade Report.xml
2024.01.13 14:03:12.187 Core 1 2022.10.06 00:00:00 Forward test: \MQL5\Files\Reports\10 mean reversion\ATR\PERIOD_M15\ATR AUDCAD Long Trade Report.forward.xml
2024.01.13 14:03:12.187 Core 1 2022.10.06 00:00:00 ===== ERROR - failed to delete backtest report with error code 5002 =====
ERR_WRONG_FILENAME
5002
Invalid file name
Anyone knows how to fix this?