I have the following rule for trailing a stop level when the current order (previously selected) is of OP_BUY type.
However, when I run the EA through the tester, I get a few 'modify' lines and a lot of 'OrderModify: error 1' lines. This error is supposed to happen when the OrderModify command does not change anything about the order.
I can't understand why the error occurs since it is only supposed to be run when the MA at the previous bar is higher than the _current_ stop level.
Please help.
Thanks,
Ravi
PS - I get the same error when used in inverse when the current order is of type OP_SELL.
Inserted Code
if(iMA(Symbol(), 0, lma, 0, 1, 0, 1) > OrderStopLoss()) OrderModify(OrderTicket(), OrderOpenPrice(), iMA(Symbol(), 0, lma, 0, 1, 0, 1), 0, 0, Blue);
I can't understand why the error occurs since it is only supposed to be run when the MA at the previous bar is higher than the _current_ stop level.
Please help.
Thanks,
Ravi
PS - I get the same error when used in inverse when the current order is of type OP_SELL.