I've decided to "test" the Automatic validation tester, or in other words - to understand its errors. And yes, I've read this (The checks a trading robot must pass before publication in the Market) article. It says that for a Buy Limit order the check would be Ask-OpenPrice >= SYMBOL_TRADE_FREEZE_LEVEL, which would mean that if we place the Buy Limit order at Ask - SYMBOL_TRADE_FREEZE_LEVEL then there should be no [Invalid price] error, right? Well, the Automatic validation still shows errors such as: 2020.02.03 01:05:00 failed buy limit 0.2 XAUUSD at 1588.80 sl: 1588.00 tp: 1590.00 [Invalid price]
In fact, I'm placing the buy limit order at MathMax(20, SymbolInfoInteger(_Symbol, SYMBOL_TRADE_FREEZE_LEVEL)) points below the Ask price. Changing 20 to 40 fixes the error, but it isn't a solution.
I've also tried placing the order at MathMax(20, SymbolInfoInteger(_Symbol, SYMBOL_TRADE_FREEZE_LEVEL)) points below the Bid price (instead of Ask price) (even though "Ask" should be enough), and it still causes an [Invalid price] error. And, I also tried placing the order at MathMax(20, SymbolInfoInteger(_Symbol, SYMBOL_TRADE_FREEZE_LEVEL)) + 1 points below the Ask price, to make sure the gap is bigger than SYMBOL_TRADE_FREEZE_LEVEL points (even though the article says the gap can be SYMBOL_TRADE_FREEZE_LEVEL points). Yet again, it still causes an [Invalid price] error.
Attached is the code I used to "test" the Automatic validation tester.
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.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
It says that for a Buy Limit order the check would be Ask-OpenPrice >= SYMBOL_TRADE_FREEZE_LEVEL, which would mean that if we place the Buy Limit order at Ask - SYMBOL_TRADE_FREEZE_LEVEL then there should be no [Invalid price] error, right? Well, the Automatic validation still shows errors such as:
2020.02.03 01:05:00 failed buy limit 0.2 XAUUSD at 1588.80 sl: 1588.00 tp: 1590.00 [Invalid price]
In fact, I'm placing the buy limit order at MathMax(20, SymbolInfoInteger(_Symbol, SYMBOL_TRADE_FREEZE_LEVEL)) points below the Ask price.
Changing 20 to 40 fixes the error, but it isn't a solution.
I've also tried placing the order at MathMax(20, SymbolInfoInteger(_Symbol, SYMBOL_TRADE_FREEZE_LEVEL)) points below the Bid price (instead of Ask price) (even though "Ask" should be enough), and it still causes an [Invalid price] error.
And, I also tried placing the order at MathMax(20, SymbolInfoInteger(_Symbol, SYMBOL_TRADE_FREEZE_LEVEL)) + 1 points below the Ask price, to make sure the gap is bigger than SYMBOL_TRADE_FREEZE_LEVEL points (even though the article says the gap can be SYMBOL_TRADE_FREEZE_LEVEL points). Yet again, it still causes an [Invalid price] error.
Attached is the code I used to "test" the Automatic validation tester.
Any ideas what I'm doing wrong?