Modify order already triggered

 

Hi,

I wanted to modify an order using the  command in MQL4 OrderModify, but, I think I might have not understood it correctly.

My idea is to modify an order that is already ongoing, meaning that it has been already triggered. So that, for example, I can increase the TP by some points if the market goes in my direction.

For that I was checking the OrderModify documentation

bool  OrderModify(

   int        ticket,      // ticket
   double     price,       // price
   double     stoploss,    // stop loss
   double     takeprofit,  // take profit
   datetime   expiration,  // expiration
   color      arrow_color  // color
   );

If my intention is just to modify an existing triggered order, in the example I mentioned above where I just want to change the TP...what should I write for the fields "price" and "stoploss" in this case?

 
Pedro Sanchez: .what should I write for the fields "price" and "stoploss" in this case?
  1. You can not use any Trade Functions until you first select an order.

  2. Select the order. Then you can use OrderTicket(), OrderOpenPrice(), OrderStopLoss(), your new TP, and OrderExpiration() in the call to only change the TP.

  3. If you always move the TP away from the market, it can never be triggered. What's the point of having one at all?
Reason: