orderModify/TrailingStop

 

Hello all, I'm currently developing an EA that needs to modify its open orders.

I used the codes shown below

if(trailingstop>0)
{
if(Bid-OrderOpenPrice()>Point*trailingstop)
{
if(OrderStopLoss()<Bid-Point*trailingstop)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*trailingstop,OrderTakeProfit(),0,Green);
return(0);
}
}
}

But it only works if the number of open orders is not more than two.

At three or more open orders, the OrderModify is simpy ignored.

Please, how do I sole this problem.

 
zecomengineer:

Hello all, I'm currently developing an EA that needs to modify its open orders.

I used the codes shown below

<CODE REMOVED>

But it only works if the number of open orders is not more than two.

At three or more open orders, the OrderModify is simpy ignored.

Please, how do I sole this problem.

Please read some other posts before posting . . .

Please edit your post . . . please use the SRC button to post code: How to use the SRC button.



Where is your OrderSelect() ? please show enough of your code to be able to help you.

Why aren't you checking the return value from your OrderModify() and reporting errors and other useful variables if it fails ? This will help : What are Function return values ? How do I use them ?

Reason: