Move SL of second position to breakeven when first position hits TP
-
Hello everyone, fxDreema beginner here. As it says in the title, I would like to make my EA move the SL of a second trade to breakeven when the first trade hits TP. How would i go about it? How could i also make it so that the trailing stop of the second trade is the same size as was the trade's stop loss? The stoploss of the second trade is based on ATR. Thanks to everyone in advance.
-
I think i managed to solve the question of how to move stop loss to breakeven after tp. I therefore need help only with the question of how to make the trailing stop the same as was the stop loss of the trade. The stop loss is based on ATR.
EDIT:If I understand correctly, i could do that by copying the candle ID of the first trade candle into the trailing stop... if I'm not mistaken that is done with variables? How can I do that? -
@subotai Not sure I fully understand you. You opened two buy trades and both have the same SL level, based on the ATR. Then the SL of first one is moved to break even, right? The second still holds its own SL, if I understand it correctly. So what's your issue exactly?
-
Thank you for your comment. Luckily I managed to make it work once i learned the magic of variables.