Local agents failing without any (apparent) reason

 

Hi,

After updating to build 4040 I'm experiencing problems with optimizations: my local agents (the threads of my PC) fail without any apparent reason. When this happens, the optimizations starts being much slower and the results are all zeros. I attached a screenshot of the Strategy Tester window to show what I mean.

This does not happen in general the first time I optimize. Then, after the first optimization, I have to restart MT5 to perform a new optimization.

Anyone else is having this problem? It would be nice to roll back to a previous version, to see if this depends on anything in my code, but apparently this is not possible...

Thanks

Files:
mt5.png  55 kb
 
f.pap:

Hi,

After updating to build 4040 I'm experincing problems with optimizations: my local agents (the threads of my PC) fail without any apparent reason. When this happens, the optimizations starts being much slower and the results are all zeros. I attached a screenshot of the Strategy Tester window to show what I mean.

This does not happen in general the first time I optimize. Then, after the first optimization, I have to restart MT5 to perform a new optimization.

Anyone else is having this problem? It would be nice to roll back to a previous version, to see if this depends on anything in my code, but apparently this is not possible...

Thanks

What appears in the .log tab when the error occurs?

 
Manuel Espinosa #:

What appears in the .log tab when the error occurs?

Today I had the chance to try build 3802 that I used without problems during last summer and I have the same behavior, so it should be some bug that I introduced in my code.

BTW, Is there a way to see the calls to the Print() function produced by the Expert Advisor while optimizing?

 
f.pap #: Today I had the chance to try build 3802 that I used without problems during last summer and I have the same behavior, so it should be some bug that I introduced in my code. BTW, Is there a way to see the calls to the Print() function produced by the Expert Advisor while optimizing?

I finally discovered that the problem is related to the SymbolExists() function that apparently has a strange behavior, at least with custom symbols that require currency conversion.

Using the wizard, I created a simple EA (attached) performing a lot of trades but calling the SymbolExists() function just once, at the end of the OnInit() function. If you use it with a custom symbol in a currency different from the one of your account and set to true the last input (for calling the SymbolExists() function), then your graph is flat and you start having a lot of messages like this:

  2023.10.25 09:07:06.840 Core 01 2019.09.03 17:53:00  no prices for symbol EURUSD (1970.01.01 00:00:00 0.00000, 0.00000)

As I said, apparenlty the problem only occurs when using the EA with custom symbols. I tried the same EA with 'normal' symbols and everything seems to run smoothly. Moreover, I have an account in EUR and I have this behavior with symbols in USD, so symbols that require currency convertion. With my account, this EA works perfectly with EUR symbols.

BTW, should I move this post to somewhere else (e.g. bug report section or some other place)?

Thanks!

Files:
 

I created a slightly different test, containing 3 inputs for calling SymboExists() with EURUSD, with another usually existing symbol (USDCAD) and with an inexisting symbol. The problem occurs only when I call SymbolExists() with EURUSD. As I said, I have a EUR account and using a USD custom symbol, and EURUSD is the symbol it needs to use for currency conversion.

Files:
 
f.pap #: I created a slightly different test, containing 3 inputs for calling SymboExists() with EURUSD, with another usually existing symbol (USDCAD) and with an inexisting symbol. The problem occurs only when I call SymbolExists() with EURUSD. As I said, I have a EUR account and using a USD custom symbol, and EURUSD is the symbol it needs to use for currency conversion.

Some more hints... If I replace the SymbolExist() function with this:

bool MySymbolExist(const string symbol) { return SymbolInfoInteger(symbol, SYMBOL_EXIST); }

my EA works correctly, but in this case:

bool MySymbolExist(const string symbol) { return SymbolInfoInteger(symbol, SYMBOL_EXIST) && !SymbolInfoInteger(symbol, SYMBOL_CUSTOM); }

the problem reappears. There should be some interaction between the check whether the symbol is a custom symbol and the custom symbol I'm using for the EA. In my case, the symbol passed to the function is "EURUSD" and the symbol I'm using for running the EA is a custom symbol.