There is an
expert Advisor that uses a dll.
correctly both live and in the tester, and when optimizing on several agents in
if you stop the tester before the end of the test, a strange situation occurs.
1) DllMain is not called withthe DLL_PRICESS_DETACH parameter when it is stopped.
2) If you run the tester again after that, the tester itself endlessly
tries to access the agent.
Log of the strategy Tester window»:
Log of the testing agent itself. Stop:
EH 0 22:58:08.909 Tester shutdown tester machine
QI 0 22:58:08.910 Tester 1 of 17 passes processed in 0:00:00.078
GS 0 22:58:08.910 Tester try to cancel expert execution
IK 0 22:58:08.911 Tester expert execution canceled
GM 0 22:58:08.912 Tester tester process stopped
RJ 0 22:58:08.913 Tester tester agent shutdown finished
CR 0 22:58:20.354 127.0.0.1 login (build 1881)
PE 0 22:58:20.361 Tester account info found with currency USD
CN 0 22:58:20.370 Network 1482 bytes of tester parameters loaded
MJ 0 22:58:20.370 Network 14524 bytes of input parameters loaded
QN 0 22:58:20.370 Tester expert file added: ExpertsХХХХХХ.ex5. 156648 bytes loaded
FQ 2 22:58:20.370 Tester file Librariesmy_library.dll write error 
GE 2 22:58:20.370 Tester requested data synchronization error
KN 3 22:58:20.372 Network additional connect from 127.0.0.1
KG 3 22:58:20.472 Network previous connect context not freed
RM 2 22:58:20.472 127.0.0.1 cannot accept connect, agent is busy
FK 3 22:58:21.374 Network additional connect from 127.0.0.1
RS 3 22:58:21.474 Network previous connect context not freed
unsuccessful attempt to copy the dll file to the tester folder is visible
(the file is occupied by the tester process).
three lines are repeated in a circle.
If you just wait 5 minutes, the metatester process ends on its own, and DllMain is called withthe DLL_PRICESS_DETACHparameter . After that, the tester runs successfully.
If you complete the “metatester” process through the task Manager, then the DllMain call does not occur, but the dll file is released and after
that the tester is also launched successfully.
could be the reason for this behavior?
Does this happen again on other expert advisors that use the dll?