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?
Read this: https://forum.mql4.com/61528 . . . . 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?
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