-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EA MtApi5 get locked/frozen under mutli-symbol optimization mode during backtesting #261
Comments
More testings: At this moment, inside C# side, unlike first iteration, it's very difficult for MtApi5Client.BeginConnect(port) to connect to the MtApi5 EA. Even the MtApi5Client.ConnectionState sometimes changed to CONNECTED after some retrials, commands from MtApi5Client dll towards MtApi5 EA always get "Response from MetaTrader is null" at this stage. I doubt maybe some resource was not completely released/closed inside |
Root cause is found, but I think my handling is not suitable to create pull request, better just put my findings and dirty handling here as reference to @vdemydiuk . It's about In MT5 multiple symbol optimization backtesting mode, when one symbol's processing end and MT5 start another symbol's backtesting, it looks very likely violating the situation "Mt5Expert has received new tick during 2 sec in testing mode", thus invoking As it's just local machine backtesting, my dirty handling is only comment-out this lines, then it works:
Here's the log before my handling as reference:
|
This API does not work with the optimization. |
MetaTrader Terminal has auto-update mechanism, which will auto-close-and-restart the terminals periodically. So disconnection handling is as-expected. So far my dirty modification somehow allows me to do multi-symbol optimization, with random pauses every a number of symbols, which requires a few stop-and-start clicks to resume the progress... |
Maybe this will help you. Do you know that you can start the strategy tester individually via the CLI ? Metatrader advanced start. https://www.metatrader5.com/en/terminal/help/start_advanced/start |
Interesting! Combining with some CLI and dynamic .ini file generation coding work, it seems possible to do many things instead of relying of optimisation option in UI! |
Situation:
When running backtesting on MtApi5 with multiple symbols optimization mode, once the last tick of a symbol within the date-range is proceeded, MtApi5 will stay frozen. No connection/command will be able to sent to MtApi5 at this status.
Expected behaviour:
When trying backtesting multiple symbols optimization mode on other default sample EA, once all ticks of a symbol are proceeded, the ticks of next symbols will be started proceeded until the last symbol is also proceeded.
How to reproduce the situation:
Then start the backtesting, wait a for a moment until the last tick of 1st symbol is reached. Then it will stay in frozen status.
What's also tested:
I tried re-connecting to the MtApi5 by the dotnet dll via the port, but unlike normal situation which was be ok to reconnect, it will be null response when it's under the frozen status.
The text was updated successfully, but these errors were encountered: