change Stop loss on a second order after first order takes profit

 

Hello there,

I've got a simple question . I'm opening 2 order both with the same stop loss but with a different take profit each . After order 1 takes profit I would like to change the stop loss of order 2, how can I "pass" the message that order 1 has taken profit ?

Thank you

 
Assuming that both orders are on the same chart then after one order has closed the number of orders on the chart will now be 1? So if the number of orders on the chart is 1 modify the still open order.
 
Ickyrus:
Assuming that both orders are on the same chart then after one order has closed the number of orders on the chart will now be 1? So if the number of orders on the chart is 1 modify the still open order.
I wouldn't make the assumption . . . I would check the OrderStopLoss() of both orders to make sure that they are part of the pair concerned.
 
julz:
I've got a simple question . I'm opening 2 order both with the same stop loss but with a different take profit each . After order 1 takes profit I would like to change the stop loss of order 2, how can I "pass" the message that order 1 has taken profit ?

Since you only open in pairs. Count the number of open orders for the current symbol/MN/TF. If the count is one, you have your answer.

The alternative is to open one order with the longer TP. When price reaches the shorter TP, move the stop to BE and do a partial close.

Reason: