How to modify the stop loss/take profit of two orders on one symbol.



I'm not going to post code just yet because I understand why what I am trying to do and how I am trying to do it is not work, I just do not understand how I am meant to deal with it!

I have an EA that at a particular point creates two stop orders at the same price in the same direction with differing take profits but the same stop loss, once the first trade is hits the first take profit I would like to adjust the stop loss of the second to be break even. 

My PositionsTotal is only ever 1 (or 0), which I understand is a broker setting and some allow you to choose whether you can have one combined or multiple, but not something I appear to bee able to change as far as I can see in my broker account.

Before the stops are triggered I can adjust the tp and sl easily, but once they are triggered I cant figure out how to do it, OrdersTotal becomes 0 - makes sense as they are no longer orders and are part of my position.

So how would I go about adjusting the take profit, or the stoploss of the remaining? I feel like the answer is staring me in the face but I just cant see it. Could somebody point me in the right direction?



Basic Principles - Trading Operations - MetaTrader 5 Help
Basic Principles - Trading Operations - MetaTrader 5 Help
Before you proceed to study the trade functions of the platform, you must have a clear understanding of the basic terms: order, deal and position...