- How to fix validation error
- Error 131 (Invalid volumes in trade operations)
- problem with automatic validation
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
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.
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
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use