transferring experienced data between two EA

To add comments, please log in or register
happylulux
19
happylulux  
Hi,

first: Sorry if it is a noob question, I started to learn mql5 last week so i'm trying to do...

Basically, i have two EA: One that I first run on "history data" mode (metaeditor: debug->start profiling on history data), which will "train" with data from the three last years. When the DeInit function is called, I store all the variables on a binary file. Until this point, everything is working.

The second EA have to read value learned from the first EA on the binary file. But this binary file is deleted when I try to run this second EA, so i cannot access to it. The problem is when i try to use the second ea in "history data" mode.

Does anyone have the solution to my problem?


I have a temporary solution that is to put a breakpoint just before the FileOpen line, to copy the binary file on the right folder(the "metaquote\tester"\....\agent...\mql5\files file) and then to let run all the process, but it's a bit a shitty solution i think...
And other question: is it possible to store automatically the file in an other folder?


Best regards
Anthony Garot
3633
Anthony Garot  

Are you saying that the binary file is deleted by EA 2 when you run it?

Files don't just delete themselves, so why is EA 2 deleting it?

Did you write EA 2?

Alain Verleyen
39054
Alain Verleyen  
happylulux:
Hi,

first: Sorry if it is a noob question, I started to learn mql5 last week so i'm trying to do...

Basically, i have two EA: One that I first run on "history data" mode (metaeditor: debug->start profiling on history data), which will "train" with data from the three last years. When the DeInit function is called, I store all the variables on a binary file. Until this point, everything is working.

The second EA have to read value learned from the first EA on the binary file. But this binary file is deleted when I try to run this second EA, so i cannot access to it. The problem is when i try to use the second ea in "history data" mode.

Does anyone have the solution to my problem?


I have a temporary solution that is to put a breakpoint just before the FileOpen line, to copy the binary file on the right folder(the "metaquote\tester"\....\agent...\mql5\files file) and then to let run all the process, but it's a bit a shitty solution i think...
And other question: is it possible to store automatically the file in an other folder?


Best regards

This is normal. Use common folder with FILE_COMMON flag.

happylulux
19
happylulux  

Alain, thank you, it's working, what I had to do is to modify the line "int h=FileOpen("file",FILE_READ|FILE_BIN);" by "int h=FileOpen("file",FILE_READ|FILE_BIN|FILE_COMMON);" and then it's storing in the terminal\common\files file. Now it's not deleted by the second EA anymore.


Anthony, yep, the file is existing until i run the second EA, the second EA delete the file created by the first EA.

Thanks to all.

Alain Verleyen
39054
Alain Verleyen  
happylulux:

Alain, thank you, it's working, what I had to do is to modify the line "int h=FileOpen("file",FILE_READ|FILE_BIN);" by "int h=FileOpen("file",FILE_READ|FILE_BIN|FILE_COMMON);" and then it's storing in the terminal\common\files file. Now it's not deleted by the second EA anymore.


Anthony, yep, the file is existing until i run the second EA, the second EA delete the file created by the first EA.

Thanks to all.

Nope. That's not the second EA which delete the file, it's the Strategy Tester. And it's normal behaviour.

To add comments, please log in or register