Optimisation Agents locking up/freezing...

 

Hi,

 

I'm having a few difficulties keeping my local agents running when doing an optimisation. The optimisation seems to start alright but after 4 or 5 passes, a random agent's "status" percentage will slow down to a crawl or freeze completely. Over the course of time, more and more agents end up doing this.

 I'm running MT5 (build 722) on a quad core i7-2630QM based machine, with 8GB of RAM (only use around 70% during the optimisation), running Windows 7 with all the latest updates. I've tried setting the "compatibility" option of the metatester64.exe file (right click on file in Windows Explorer, choose the compatibility tab...) to "Windows 7" but this doesn't seem to make any difference.

 

Anyone got any ideas? 

 
Did you try optimizing different EAs? Are there any errors in the strategy tester journal? You can also check the logs of your local agents (you can open it via context menu on the journal tab in the strategy tester).
 

Hi,

 

Firstly, thanks for your prompt response. As to your questions:

 

1. No, I haven't tried optimising any other EA's as yet. Note though that this EA runs fine if run through the simulator (which uses Agent 1 by default I believe?). No errors are produced when I run this simulation.

 

2. There aren't any errors produced in either the Stratagy tester journal or the Agent journals. Normally after each pass, you get the message pair "optimization pass 435 started" and "435 : passed within xxxxx ms". When an agent slows down to a crawl and I end up having to shutdown MT5 and kill that agent's process manually, I would obviously see the first message in the journal but not the second or any other error to spell out what went wrong.

However, when I shutdown MT5 and kill the remaining "metatester64.exe" processes (the number of these always corresponds with the number of slow agents I had in the previous optimisation) and then attempt to restart MT5 and restart the optimisation, I get the messages "MM 3 Network 23:39:07 previous connect context not freed" and "HF 2 127.0.0.1 23:39:07 cannot accept connect, agent is busy". I presume this is because I manually killed the processes and Windows 7 hadn't released the ports as yet...?

 

 


 
Also, is there any way of changing the port numbers used by the local agents? I suspect I may have another process on my machine in the port 3000-3009 range that fires out the occasional message...
 

Try to optimize any other EA (for instance, the standard MACD example).

There's no way to change the ports of the local agents, check if any other processes use that ports.

 
Alexx:

Try to optimize any other EA (for instance, the standard MACD example).

There's no way to change the ports of the local agents, check if any other processes use that ports.

Hi Alexx,

 

Thanks again for your prompt reply.

 

It was a good idea of yours to use the MACD example - I had no problems with it. After scouring my code, it appeared that several combinations of optimisation parameters would actually empty my trading account during the simulation run. Because I was doing a TradeCheck() when placing positions and reporting any errors in the log file, my code ended up writing "Not enough money in account" error messages on every tick. I've now handled these errors differently and everything appears to be working fine.

 

I'd also really like to commend MetaQuotes on MT5 - it really is an outstanding product, standing head and shoulders above MT4 and anything the competition currently has going. Having had to write my own genetic optimiser in the past (due to the fact that the one in MT4 (and any others on the market) weren't really up to it - particularly the lack of multithreading) and thereby having to duplicate the resulting trading system components between my own system and MT4, it's with great relief that I can finally dump my own system and simply use MT5 for everything!

Reason: