ERROR: Modification failed due to order or position being close to market

 

Morning

I'm traying to publish my EA, and after local testing, i don't find any error.

But when i update to market, verification process say:


test on EURUSD,H1 (netting) 2020.05.05 10:06:00 failed modify #6 sell 0.3 EURUSD sl: 1.09088, tp: 1.08857 -> sl: 1.09075, tp: 1.08857 [Modification failed due to order or position being close to market] strategy tester report 6 total trades


My EA checks all market recommendations as pending orders, incorrect volumes, minimus stops a Takeprofits.... So I have no idea because it doesn't work. Somebody can help me? some Ideas?

Thanks

The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
The idea of ​​automated trading is appealing by the fact that the trading robot can work non-stop for 24 hours a day, seven days a week. The robot does not get tired, doubtful or scared, it's is totally free from any psychological problems. It is sufficient enough to clearly formalize the trading rules and implement them in the algorithms, and...
 

You can't move stops (or pending prices) closer to the market than the minimum: MODE_STOPLEVEL * _Point or SymbolInfoInteger(SYMBOL_TRADE_STOPS_LEVEL).
          Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial

On some ECN type brokers the value might be zero (broker doesn't know.) Use a minimum of two (2) PIPs.

 
William Roeder:

You can't move stops (or pending prices) closer to the market than the minimum: MODE_STOPLEVEL * _Point or SymbolInfoInteger(SYMBOL_TRADE_STOPS_LEVEL).
          Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial

On some ECN type brokers the value might be zero (broker doesn't know.) Use a minimum of two (2) PIPs.

Thanks for the answer.

I 've checked SYMBOL_TRADE_STOPS_LEVELS and SYMBOL_TRADE_FREEZE_LEVEL but something doesn't work.

i'am managing at same time take profit and stop loss, so maybe i did a mistake, but i cannot to find. I'am reviewing 

 
Jesus Victor Lerga Bezunartea: but something doesn't work.

"Doesn't work" is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless.
     How To Ask Questions The Smart Way. 2004
          When asking about code

There are no mind readers here and our crystal balls are cracked.

 

Thanks for your English corrections. 

Fortunetely, my great experience as programmer  is better than my English, and finaly i fixed it.

 
Jesus Victor Lerga Bezunartea:

Thanks for your English corrections. 

Fortunetely, my great experience as programmer  is better than my English, and finaly i fixed it.

Hi!

May you please share where the error was?


Regards,

Alex

 
Hello, how did you solve the error?
 
Andres Enrique Osterling Letts #: Hello, how did you solve the error?

Search the forum on how to handle Freeze Level and Stops Level, just as William pointed in his post :

Forum on trading, automated trading systems and testing trading strategies

ERROR: Modification failed due to order or position being close to market

William Roeder, 2020.09.23 13:57

You can't move stops (or pending prices) closer to the market than the minimum: MODE_STOPLEVEL * _Point or SymbolInfoInteger(SYMBOL_TRADE_STOPS_LEVEL).
          Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial

On some ECN type brokers the value might be zero (broker doesn't know.) Use a minimum of two (2) PIPs.


 
Jesus Victor Lerga Bezunartea #:

Thanks for your English corrections. 

Fortunetely, my great experience as programmer  is better than my English, and finaly i fixed it.

how did you fix this error?

Reason: