Order Modify Error 1 occurs in stop changing

 

Hi:

 

I met a problem when I use the OrderModify to change the stop value, an error pops as:

OrderModify error 1


For example, the message occurs when I try to place the stop 3 pips under the low price of previous close candle. 

It seems not affecting the result, but just keep showing the error message and it's really annoying me.

 

Any idea how to fix it?

 

Thanks

 
asuralm:

Hi:

 

I met a problem when I use the OrderModify to change the stop value, an error pops as:

OrderModify error 1


Read this:  https://www.mql5.com/en/forum/150158  . . . .  then modify your code to Print() the current stop value before you try to modify it and also the value you are trying to modify it to . . .  if it is the same then that is your issue.  

 
asuralm: when I use the OrderModify an error pops as: OrderModify error 1
You
Server
Change the SL to X
It is at X!
Change the SL to XIt is at X!
Change the SL to XYou are insane
 
RaptorUK:

Read this:  https://www.mql5.com/en/forum/150158  . . . .  then modify your code to Print() the current stop value before you try to modify it and also the value you are trying to modify it to . . .  if it is the same then that is your issue.  


Does it mean that if I just want to modify the ProfitTarget value, and remain the stop unchanged, the error message will keep showing?

Thanks 

 
asuralm:


Does it mean that if I just want to modify the ProfitTarget value, and remain the stop unchanged, the error message will keep showing?

Thanks 


No.  If you are changing the takeprofit price to a different price and keeping the stoploss at the same price, the error message will not be generated.

From the documentation for OrderModify():

If unchanged values are passed as the function parameters, the error 1 (ERR_NO_RESULT) will be generated.

So, only if you invoke OrderModify() but don't pass any modified parameters to the function, an error (error 1 - ERR_NO_RESULT) is generated. 

Reason: