Product Automatic validation error : Invalid Stops

 

Hi, while trying to validate my mt5 EA for the market I get these following errors:


test on EURUSD,H1 (netting)
 2018.06.22 00:00:00   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:00:08   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:01:00   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:01:03   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:01:07   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:01:11   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:01:15   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:16:32   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:16:33   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:16:34   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:19:36   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:19:42   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:19:59   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:20:00   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:20:01   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:20:03   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:20:05   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:20:07   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:20:08   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:20:10   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
 2018.06.22 00:20:12   failed modify #62 sell 0.20 EURUSD sl: 1.16448, tp: 1.14249 -> sl: 1.16025, tp: 1.14249 [Invalid stops]
strategy tester report 46 total trades
Can someone please tell me why the new sl: 1.16025 is invalid when the original stop loss was 1.16448? Please note that this error does not show up if I change the file name and upload it for automatic validation error again. I did check Freeze level, Check SL and TP, as well as OrderModifyCheck as mentioned in this page https://www.mql5.com/en/articles/2555. BR Syed

 
Syed Oarasul Islam:

Hi, while trying to validate my mt5 EA for the market I get these following errors:


Did you normalize the new stop-loss value to the number of Digits available?

 
John Davis:

Did you normalize the new stop-loss value to the number of Digits available?

Hello Davis,


Yes every double values are normalized in my EA. 

 

HI Syed, 

Did you found a solution to solve the Stop loss issue - we are running the same and we are thinking the SL is too close to the pricing with Trailing Stop... 

Saw this post

https://www.mql5.com/en/forum/285056

Invalid Stops MQL5 / - TP
Invalid Stops MQL5 / - TP
  • 2018.10.22
  • www.mql5.com
Hi All, I have an issue with sending orders, due to 2018.10.22 23:53:13.079 Core 1 2017.03.15 19:00:00 failed modify #2 sell 0.03 EURUSD sl: 0...
 
Fernando Gomez:

HI Syed, 

Did you found a solution to solve the Stop loss issue - we are running the same and we are thinking the SL is too close to the pricing with Trailing Stop... 

Saw this post

https://www.mql5.com/en/forum/285056

Hi Fernando,

In my EA I am trying to modify positions when spikes occurs. I think this is what causing the problem. It could be that by the moment EA tries to modify position the spikes move backwards. In that regards you are probably right. 

 
try

NormalizeDouble( value,_Digits);


ex:
         double sl = NormalizeDouble(Bid + 300*SymbolInfoDouble(_Symbol,SYMBOL_POINT),_Digits);
         double tp = NormalizeDouble(Bid - 300*SymbolInfoDouble(_Symbol,SYMBOL_POINT),_Digits);
 
Syed Oarasul Islam:

Hi, while trying to validate my mt5 EA for the market I get these following errors:


Please provide bid and ask at that moment and the minimum required distance.

 
Syed Oarasul Islam:

Hi Fernando,

In my EA I am trying to modify positions when spikes occurs. I think this is what causing the problem. It could be that by the moment EA tries to modify position the spikes move backwards. In that regards you are probably right. 

Hi Syed, I am having the similar problem. May I know have you solve the issue? 
 
any solution?
 
Ahmed Alaoui Chrifi:
any solution?
Look at those examples and about what to check:
Setting the TakeProfit and StopLoss levels within the SYMBOL_TRADE_STOPS_LEVEL minimum level
The checks a trading robot must pass before publication in the Market
The checks a trading robot must pass before publication in the Market
  • www.mql5.com
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.