What on earth is going on? - page 7

 

If SHARE_READ solved the problem, then you were opening exactly the same file from parallel copies of EA.

And your "no sharing" statement was false, as I pointed out above.

All in all, it's scary for you.

 
Renat Fatkhullin:

If SHARE_READ solved the problem, then you were opening exactly the same file from parallel copies of EA.

And your "no sharing" statement was false, as I pointed out above.

All in all, it's scary for you.

I didn't quite understand you.

Parallel copies of the EA appeared in the optimiser. It is logical to expect that the optimizer would also make parallel copies of the files these EAs are accessing.

My Expert Advisor itself does not need SHARE_READ a priori at all. So here we have what? If the Expert Advisor handles a file, it has to "fumble" specifically for the optimizer.

I'll take it into account, but I think this is not right. )))

 
Сергей Таболин:

It is logical to expect that the optimiser will also make parallel copies of the files these experts refer to.
It's scary for you.
 
Renat Fatkhullin:
Scary for you.

Come on ))))

Just write in the documentation "when an EA accesses a file, to optimise itSHARE_READ is mandatory!"

 
Andrey Dik:

You think that a global EA variable retains its value from past optimizer runs and is carried over to the next ones?

Yeah,Andrey F. Zelinsky, he said it right. when optimizing, everything that is initialized globally (not in OnInit) is initialized only once.

p/s/ The reason for TC's problem is funny - Neural Networks, AI and so on... and work with files is not important ))

 
Aleksey Mavrin:

Yeah, Andrey F. Zelinsky, he said it right. During optimization everything that is initialized globally (not in OnInit) is initialized only once.

p/s/ The reason for TC's problem is funny - Neural Networks, AI and so on... and file handling is not important ))

It's not a bad thing when you are an old man.

 

Dear, just a word, because no one for whom working with files is important, until I printed it out, either, suggested that this might be the problem ;) :) Anyway, that's sorted.

Now a distracted question: what is the difference between the following lines?

   filename = "ERR_dir\\"+filename+(MQLInfoInteger(MQL_OPTIMIZATION) ? ".opt" : ".tst");
   filename = "ERR_dir\\"+filename+(MQLInfoInteger(MQL_TESTER) ? ".tst" : ".opt");

And, if possible, an explanation - why?

 

if the file is written to COMMON, it is mandatory to have SHARE_READ and a rather tricky write race control. It's kind of decent not to shoot the heel in public.

In general, it's good practice that advisors don't write anything in the common. They can read it, but it is written or copied there by the trader who is personally responsible for this. For all Expert Advisors in all terminals, these are words given from above.

If a file is written to a common directory without SHARE_XXX, but the optimizer generates errors of shared access, this is a bug of the terminal developers
 
You can test without optimisation.
 
Сергей Таболин:

Dear, just a word, because no one for whom working with files is important, until I printed it out, either, suggested that this might be the problem ;) :) Anyway, that's sorted.

Now a distracted question: what is the difference between the following lines?

And, if you can explain - why?


in the second case will always give out .tst

Reason: