Hi all,
I'm using #property tester_file "tester_configs.bin" to pass a binary file containing pre-generated JSON configurations to my EA. This used to work perfectly for the past 3 months, but now for some reason, Mt5 refuses to copy my tester file when starting the optimization process.
-
The file is present but empty at the time of compiling the EA in release mode in <terminal_path>/MQL5/Files
-
The EA tries to open it at the start of a pass like this: FileOpen("tester_configs.bin", FILE_SHARE_READ | FILE_BIN) .
-
FileOpen() fails with error 5004 (ERR_CANNOT_OPEN_FILE).
Additional info:
-
I'm writing multiple configs in binary format as [length][json][length][json]... .
-
ASCII encoding is used ( Buffer.from(..., 'ascii') ) from a Nodejs script
-
File size is not excessive, between 21k to 1000k, used to work with even 89mb + binary files
-
Confirmed file is present in MQL5/Files/ before test, but does not get copied to <tester_path>/Agent-127.0.0.1-3xxx\MQL5\Files
Has anyone run into similar issues where tester_file is ignored for some files ? Could this be related to internal file validation or sandbox constraints?
I also tried from scratch with a simple .txt file with a different name, still not getting copied.
Using build 4885
Thanks in advance for any insights.
ow thats a headache .
I recall you had to hit compile , then close the terminal and the ide and restart them to work.
But i was fighting with it recently , i'll look into the test folder
try having the files in the common folder and open them from there in the tester by appending |FILE_COMMON in the arguments.
Or embed the file as an include
ow thats a headache .
I recall you had to hit compile , then close the terminal and the ide and restart them to work.
But i was fighting with it recently , i'll look into the test folder
Thanks for the reply! Closing metaeditor + terminal seems to have fixed the issue.
Regarding your proposal of going with the COMMON folder, in my case it is not doable, because when using my local farm during optimizations, remote agents do not have access to the common folder.
Thanks for the reply! Closing metaeditor + terminal seems to have fixed the issue.
Regarding your proposal of going with the COMMON folder, in my case it is not doable, because when using my local farm during optimizations, remote agents do not have access to the common folder.
yeah for an optimization its different.
Is the file opening and closing hindering the optimization speed in your experience?
yeah for an optimization its different.
Is the file opening and closing hindering the optimization speed in your experience?
No it's quite fast, when reading a file as binary, we don't have to get the whole file into memory to work with it, my EA has an optimized input that tells it which index to load, and will seek to it in the binary file and only load that part. My binary file is rarely above 10mb.
ow thats a headache .
I recall you had to hit compile , then close the terminal and the ide and restart them to work.
But i was fighting with it recently , i'll look into the test folder
There is a more simple way to refresh the newly compiled EA with embedded tester_file in the tester: just select (temporarily) another EA in the dropdown list of experts in the tester, then revert selection back to your required EA. No need to restart anything.
PS. AFAIR, this was needed to do once, subsequent runs with already existing resource file should pick up the file normally.
No it's quite fast, when reading a file as binary, we don't have to get the whole file into memory to work with it, my EA has an optimized input that tells it which index to load, and will seek to it in the binary file and only load that part. My binary file is rarely above 10mb.
i always wondered if the tester file directive places the file in memory and opens it up once
i always wondered if the tester file directive places the file in memory and opens it up once
Every agents (...MetaQuotes\Tester\D0E...\Agent-127.0.0.1-3xxx) receive their own copy, so the tester_file gets copied over during the synchronization. Each agent is then responsible for FileOpen()ing the file.
There is a more simple way to refresh the newly compiled EA with embedded tester_file in the tester: just select (temporarily) another EA in the dropdown list of experts in the tester, then revert selection back to your required EA. No need to restart anything.
PS. AFAIR, this was needed to do once, subsequent runs with already existing resource file should pick up the file normally.
Nice to know!
Every agents (...MetaQuotes\Tester\D0E...\Agent-127.0.0.1-3xxx) receive their own copy, so the tester_file gets copied over during the synchronization. Each agent is then responsible for FileOpen()ing the file.
Nice to know!
so they keep reopening it during each pass it does not stay in memory or smth since its not being altered (Which the tester cannot know i suppose)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
I'm using #property tester_file "tester_configs.bin" to pass a binary file containing pre-generated JSON configurations to my EA. This used to work perfectly for the past 3 months, but now for some reason, Mt5 refuses to copy my tester file when starting the optimization process.
The file is present but empty at the time of compiling the EA in release mode in <terminal_path>/MQL5/Files
The EA tries to open it at the start of a pass like this: FileOpen("tester_configs.bin", FILE_SHARE_READ | FILE_BIN) .
FileOpen() fails with error 5004 (ERR_CANNOT_OPEN_FILE).
Additional info:
I'm writing multiple configs in binary format as [length][json][length][json]... .
ASCII encoding is used ( Buffer.from(..., 'ascii') ) from a Nodejs script
File size is not excessive, between 21k to 1000k, used to work with even 89mb + binary files
Confirmed file is present in MQL5/Files/ before test, but does not get copied to <tester_path>/Agent-127.0.0.1-3xxx\MQL5\Files
Has anyone run into similar issues where tester_file is ignored for some files ? Could this be related to internal file validation or sandbox constraints?
I also tried from scratch with a simple .txt file with a different name, still not getting copied.
Using build 4885
Thanks in advance for any insights.