- Market validation fails with "1 error" but no details EA trades normally in local testing
- Discussion of article "The checks a trading robot must pass before publication in the Market"
- my EA validation failed with the message
I have read the official publication-check article (2555). I do not want to round volume up beyond the risk budget, remove protections, or add artificial validation-only trades.
There are some more:
- Solving Automatic Validation Problems Arising During Product Submission in MQL5 Market - blog post with some code example which should be included to be inside EA.
- there are no trading operations - the forum discussion thread; the users are sharing the codes/decision which they used to pass validation sucessfully
- How to resolve "no trading operations" validation failure? - (solved step by step) small forum thread
Could MetaQuotes identify the actual dates, initial deposit, leverage, symbol specifications and Input overrides used for a failed validation, or provide its Expert journal? If that is not available through the seller interface, is there a supported escalation route for reviewing legitimate risk/margin rejection without altering the product's intended trading behavior?
Because this validation process is provided to secure the potential buyers, means: there should not be any limitation and EA must trade, and all necessary checking (lot size, deposit side and more) should be inside EA's code.
Your own log already shows the cause: 27 skips because the minimum lot is bigger than 0.25% of the deposit. On a small deposit, a stop-based 0.25% risk works out to less than 0.01 lot on most symbols, so the EA never trades. The validator isn't the only one who will see that. A buyer with a small account will run it, see no trades, and think it's broken.
You don't have to weaken the logic to fix this. You can make the choice visible to the user instead. I'd add two inputs: allow the minimum lot when the risk budget is too small, and the highest risk % you'll accept for that minimum lot. Then log one clear line whenever a trade is skipped:
input double InpRiskPct = 0.25; // Risk per trade, % input bool InpAllowMinLot = true; // Use min lot if budget is too small input double InpMaxMinLotPct = 1.0; // ...but only if min lot risk <= this % double LotForRisk(double slPoints) { double eq = AccountInfoDouble(ACCOUNT_EQUITY); double tickVal = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE); double tickSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE); double minLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN); double step = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP); double lossPerLot = slPoints * _Point / tickSize * tickVal; if(lossPerLot <= 0 || eq <= 0) return 0; double lots = MathFloor(eq * InpRiskPct / 100.0 / lossPerLot / step) * step; if(lots < minLot) { double minLotPct = minLot * lossPerLot / eq * 100.0; if(!InpAllowMinLot || minLotPct > InpMaxMinLotPct) { PrintFormat("Skip: min lot %.2f would risk %.2f%% (limit %.2f%%)", minLot, minLotPct, InpAllowMinLot ? InpMaxMinLotPct : InpRiskPct); return 0; } lots = minLot; } double margin; if(!OrderCalcMargin(ORDER_TYPE_BUY, _Symbol, lots, SymbolInfoDouble(_Symbol, SYMBOL_ASK), margin) || margin > AccountInfoDouble(ACCOUNT_MARGIN_FREE)) { Print("Skip: not enough free margin for ", lots, " lots"); return 0; } return lots; }
The risk stays capped, it's just capped at a number the user chose. Before you submit again, run it yourself with small deposits (100 and 1,000) at a few leverage levels, on a symbol with a wide stop like XAUUSD. If it trades there without errors, it will usually pass. If you want strict 0.25% to be the default, that's a fair choice, but the validator will probably keep failing it on small deposits. Also check XAUUSD D1: if the test period is short, a D1 strategy may not get a signal at all, even with correct sizing.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use