Solving Automatic Validation Problems Arising During Product Submission in MQL5 Market - blog post
- 2017.08.07
- www.mql5.com
Forum on trading, automated trading systems and testing trading strategies
Sergey Golubev, 2025.08.24 09:12
...The checks a trading robot must pass before publication in the Market - Invalid volumes in trade operations
============
EA should open trades for all the pairs without limitation. As to XAUUSD so you can write about it in the description for example.
From this blog post (Solving Automatic Validation Problems Arising During Product Submission in MQL5 Market) -
The EA can trade also on forex Pairs, but suggested on Gold ( I wrote this of course in the descrition)
What I understood, the problem is on "Invalid Price"
2023.02.14 15:32:40 failed buy stop 0.2 EURUSD at 1.08000 [Invalid price]
But there is no other explanation. "Invalit price" error is quite generic error and that way it is very difficoult to fix any error.
Well, I triying to change SL/TP/Trail etc etc....But the Validation fail anyway.
Also more I change those Values more we go "away" from the original work of that EA and the performance will go from good to mediocre.
Maybe that is the reason there are only very few EA's that has good performance here on the market.
BTW: my EA already working on Live account.
The EA process for validation, when is your first time publishing, is quite hard to pass, but once you understand it, is easy. :)
For each EA the change that you need to do is specific, it is not same so you need to check the code...
I'll suggest using the strategy tester in the exact time that the EA shows, and then implementing multiple if filters and start debugging...
For this specific case of invalid price there should be an specfic command for checking this, so the solution could be as simple as adding an only if clause...
if(invalid_price)
{
Print("Invalid Price");
}
else
{
trade.buy;
trade.sell;
}
The EA process for validation, when is your first time publishing, is quite hard to pass, but once you understand it, is easy. :)
For each EA the change that you need to do is specific, it is not same so you need to check the code...
I'll suggest using the strategy tester in the exact time that the EA shows, and then implementing multiple if filters and start debugging...
For this specific case of invalid price there should be an specfic command for checking this, so the solution could be as simple as adding an only if clause...
if(invalid_price)
{
Print("Invalid Price");
}
else
{
trade.buy;
trade.sell;
}
However, there has arised another problem: the verification process seems to trade with an amount of $1000 an 0.2 lotsize on Gold! that would be completaly overtrading in a real world! and of course it does not have enough money for trade and validation fail.
The EA, of course does not have that lotsize for trading and is set to 0.03 (and even if I change to 0.01 it doesn't matter) So question is: why and where the verification process is using that high lotsize if that lotsize in nowhere written in the code?
test on EURUSD,H1 (hedging) strategy tester report 12 total trades test on XAUUSD,D1 (hedging) 2022.02.02 09:45:15 current account state: Balance: 1000.00, Credit: 0.00, Commission: 0.00, Accumulated: 0.00, Assets: 0.00, Liabilities: 0.00, Equity 1033.20, Margin: 718.38, FreeMargin: 314.82 2022.02.02 09:45:15 calculated account state: Assets: 0.00, Liabilities: 0.00, Equity 1033.20, Margin: 1077.39, FreeMargin: -44.19 2022.02.02 09:45:15 not enough money for order [#8 sell stop 0.2 XAUUSD at 1795.07]
BTW: this is the error I get.
test on EURUSD,H1 (hedging) strategy tester report 12 total trades test on XAUUSD,D1 (hedging) 2022.02.02 09:45:15 current account state: Balance: 1000.00, Credit: 0.00, Commission: 0.00, Accumulated: 0.00, Assets: 0.00, Liabilities: 0.00, Equity 1033.20, Margin: 718.38, FreeMargin: 314.82 2022.02.02 09:45:15 calculated account state: Assets: 0.00, Liabilities: 0.00, Equity 1033.20, Margin: 1077.39, FreeMargin: -44.19 2022.02.02 09:45:15 not enough money for order [#8 sell stop 0.2 XAUUSD at 1795.07]
You can add another if for checking free margin, and also the minum possible lot.
Open the strategy tester on XAUUSD, D1 on 2022.02.02 and run it with the account size, you will see the why is the EA failing the test.
Seeing that verification process I can say: The guys here on mql5 are for sure coders, but they haven't any clue about live trading.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Not sure if this is the rigth please to post.
So, I am triyng half day to upload an EA for Gold trading to the Market. (That's my first time, and maybe also last)
Verification alwasy fail and it just give me the following output below. Hovever, the EA works on Gold and verification test is made on EURUSD, OF COURSE the sl/tp etc. are quite different on that forex pair! (this way it will never pass that "test")
Any info would be appreciated.
______________
test on EURUSD,H1 (hedging) 2023.02.14 15:32:40 failed buy stop 0.2 EURUSD at 1.08000 [Invalid price] 2023.02.14 15:32:59 failed buy stop 0.2 EURUSD at 1.08000 [Invalid price] 2023.02.14 15:33:00 failed buy stop 0.2 EURUSD at 1.08000 [Invalid price] 2023.02.14 15:33:20 failed buy stop 0.2 EURUSD at 1.08000 [Invalid price] 2023.03.10 16:40:40 failed buy stop 0.2 EURUSD at 1.06663 [Invalid price] 2023.03.10 16:40:59 failed buy stop 0.2 EURUSD at 1.06663 [Invalid price] _____________