Solving Automatic Validation Problems Arising During Product Submission in MQL5 Market

11 January 2017, 16:26
Stanislav Korotky
31
3 429

If you're distributing some products for MetaTrader 4/5 via the Market, you probably know that a special "welcome" stage of automatic product validation has been added recently by MetaQuotes on the site. It starts just after you submit a compiled file, in case that all other stuff is already filled in. Only products that passed the validation successfully can be sent to moderators for manual checkup.

What this automatic validation does exactly is a secret, but developers receive many negative test reports for their new and updated products, so it's possible to deduce some rules and tests running behind the scenes. And most important, that we can suggest some methods to pass the validation if it failed with one of known errors.

The automatic validation performs a non-visual test of the product on 4 different symbols and timeframes (which may vary). Here is an example of the test list for MetaTrader 5:

  • EURUSD,H1 (netting)
  • XAUUSD,D1 (netting)
  • GBPUSD,M30 (netting)
  • EURUSD,M1 (netting)

Of course, a developer should make his/her product in strict accordance with the documentation (MetaTrader 5, MetaTrader 4). In addition, there is a number of guides specifically prepared for product publishers, such as:

Nevertheless, you may still encounter problems with the validation, even if all requirements stated in the abovementioned documents are met. Here is the list of errors known to arise most frequently:

  • Not available
  • Empty strategy tester report
  • There are no trading operations
  • Tester takes too long
  • Log files size exceeded 2053 MB, test terminated

If you know an error not listed here and specific to the validator itself (not an error in your product), please, let me know.

Let's consider them one by one.

Not available

This is an internal error of the automatic validation infrastructure. It's not related to your product. You can do nothing. Just wait a bit for MetaQuotes to fix the problem. If you think you waited enough and the problem is still there, write to the service desk, and wait more ;-).

Empty strategy tester report

The same as above, but it seems to be less severe than "Not available", so you will probably wait a shorter period before it vanishes "automatically".

There are no trading operations

This error is specific for expert advisers only. The rule is: expert advisers must trade. If your robot should be used only on a specific symbol timeframe, then here is what MetaQuotes say: "Products can not apply restrictions. All limitations should be marked as recommendations in the product description." If your robot does not trade by design (a helper tool, for example), choose approriate category ("Utilities") in the product properties.

One of possible reasons for this error to come is when your code contains a checkup like this:

if(!TerminalInfoInteger(TERMINAL_TRADE_ALLOWED))
{
  return ERROR_CODE;
}

Such conditions should be accompanied with IsTesting()/MQLInfoInteger(MQL_TESTER) call. The automatic tester is not connected to an account, and the tester is always considered as allowed to trade. Correct code should be:

if(!TerminalInfoInteger(TERMINAL_TRADE_ALLOWED) && ! MQLInfoInteger(MQL_TESTER))
{
  return ERROR_CODE;
}

 

Tester takes too long time

The product performs too lengthy operations and its source code should be improved (refactored). The real time limit for the test is somewhat about 30 minutes for a submission, but range of dates for testing is not known at the moment. Hardware being used on the servers is not known as well. Nevertheless you may try the following approaches:

  • Run the built-in profiler and try to optimize/remove most lengthy parts of code.
  • Eliminate objects, canvases, drawings while testing is performed without visual mode (this is the mode used by the automatic validator).
MQL4 notation to check this
bool allowLenghtyOperations = !IsTesting() || IsVisualMode();
MQL5 notation:
bool allowLenghtyOperations = !MQLInfoInteger(MQL_TESTER) || MQLInfoInteger(MQL_VISUAL_MODE);
  • Add special parameter to limit number of bars to calculate.
  • Implement some throttling technique, for example instead of updates on every tick do it not frequently than every N seconds.

 

Log files size exceeded 2053 MB, test terminated

This can be both a problem in your product or in the validator state. Make sure you do not generate too many prints in your code, test it locally in different environments to make sure that infinite loops are eliminated and unrecoverable trading errors are handled appropriately.


'File.ex{4|5}' has newer unsupported version, please update your client terminal

This error means that you use a beta version of MQL compiler, which is newer than the versions supported by the tester, and hence your compiled code is incompatible with it. This can happen if you've updated (intentionally or accidentally) your MetaTrader from MetaQuotes server, which distributes official beta versions. Release versions of the platform are available through brokers. Actually, I suggest not to use even latest release versions of compilers for the Market products. Many users keep working with a bit outdated terminal versions, some brokers may not propagate all releases timely, and at the same time many updates break back compatibility (it was the case many times in past). That is, new executable code you upload to the market may not work properly in previous terminal versions. I have no idea why MQ do not respect back compatibility (which is an important principle in software design), so MQL developers need to keep track of the compiler "improvements" on their own and hold back unwanted upgrades until they are supported by majority of your users.


Not synchronized with trade server

This indicates a technical problem with the automatic validator service. We can do nothing - just recompile your file and submit it again after a while.