Error During Automated product validation

 

Hi,


I am getting following errors



Test report for version 6.2

Validation state: Validation completed with errors

  • Errors count1
  • Started2024.05.25 03:45:24
  • Finished2024.05.25 03:46:05
  • TypeExpert Advisor
 

Solving Automatic Validation Problems Arising During Product Submission in MQL5 Market - Other - 11 January 2017 - Traders' Blogs

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;
}


See too: https://www.mql5.com/en/search#!keyword=there%20are%20no%20trading%20operations&module=mql5_module_forum