how to use OrderModify to modify an opened order?

 

I have been able to use OrderModify to modify a pending order, but I don't know how to set the parameter for Price for an opened order. Apparently I cannot modify the Price value since the order has been opened.

According to the Documentation, I should be able to use the OrderModify function to modify an opened order. Please help.

Thanks.

 
It's impossible to modify Open price for an opened order. How do you imagine that?
 
I know. I know, but I should be able to modify the SL and TP, right?
 
pisceswzh:
I know. I know, but I should be able to modify the SL and TP, right?

Yes, you can change SL and/or TP for an opened order.

 

Select the order --- OrderSelect()

Use OrderOpenPrice() as the price...

bool result = OrderModify(OrderTicket(), OrderOpenPrice(), newSL or OrderStopLoss(), newTP or OrderTakeProfit(), OrderExpiration(), CLR_NONE);

 
phy:

Select the order --- OrderSelect()

Use OrderOpenPrice() as the price...

bool result = OrderModify(OrderTicket(), OrderOpenPrice(), newSL or OrderStopLoss(), newTP or OrderTakeProfit(), OrderExpiration(), CLR_NONE);

Dear,

If i have 2 opposites position running at the same time(hedge), lets say one is hit TP and another one want to modified. How to do it?

Reason: