no trading operations error 131 ERR_INVALID_TRADE_VOLUME &description

 
Hi

I'm trying to upload my Expert Advisors for Market.
However I face error with automatic validation.

no trading operations error 131 ERR_INVALID_TRADE_VOLUME 

I visited the page of how to fix but I don't understand &description that is in the function.

bool CheckVolumeValue(double volume,string &description)

Do you know the reason of error or could you please tell me how to use the function with & description?

Thank you
Kaede 
 
Kita Sawa Kaede: I'm trying to upload my Expert Advisors for Market. However I face error with automatic validation. no trading operations error 131 ERR_INVALID_TRADE_VOLUME. I visited the page of how to fix but I don't understand &description that is in the function. bool CheckVolumeValue(double volume,string &description). Do you know the reason of error or could you please tell me how to use the function with & description?

Read the section on "Invalid volumes in trade operations" again and reference the documentation on the following contract conditions.

SYMBOL_VOLUME_MIN

Minimal volume for a deal

SYMBOL_VOLUME_MAX

Maximal volume for a deal

SYMBOL_VOLUME_STEP

Minimal volume change step for deal execution

Articles

The checks a trading robot must pass before publication in the Market

MetaQuotes, 2016.08.01 09:30

Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
 
Hi thank you for your comment.

I saw but I don't understand how to use & description 
 

We have already discussed this issue with you before ...

Forum on trading, automated trading systems and testing trading strategies

Market Registration of EA Unable to Validate

Fernando Carreiro, 2022.08.30 14:20

For your screenshot with an Error 131 and it also has a link on "How to fix it". So follow up on it and fix your EA accordingly.

In regards to volume, you have to check the contract specification of the symbol and limit your volume to the minimum, maximum and step that is allowed for the symbol.

// Variables for symbol volume conditions
   double
      dbLotsMinimum = SymbolInfoDouble( _Symbol, SYMBOL_VOLUME_MIN  ),
      dbLotsMaximum = SymbolInfoDouble( _Symbol, SYMBOL_VOLUME_MAX  ),
      dbLotsStep    = SymbolInfoDouble( _Symbol, SYMBOL_VOLUME_STEP );
       
// Adjust volume for allowable conditions
   dbLots = fmin(  dbLotsMaximum,                           // Prevent too greater volume
            fmax(  dbLotsMinimum,                           // Prevent too smaller volume
            round( dbLots / dbLotsStep ) * dbLotsStep ) );  // Align to step value