Download MetaTrader 5
To add comments, please log in or register
Do you have questions to the application's developer - ask them in Comments section
Ming Luo
293
Ming Luo 2014.08.13 08:07 

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

Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.08.13 08:22  
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.  

whroeder1
13656
whroeder1 2014.08.13 11:57  
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
Ming Luo
293
Ming Luo 2014.08.13 13:45  
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 

GreenMoney
379
GreenMoney 2014.08.13 15:28  
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. 

/
To add comments, please log in or register