How to link position with order STOP_MARKET and TAKE_PROFIT_MARKET?

Hello.

How to link main ORDER with ORDERS STOP_MARKET and TAKE_PROFIT_MARKET?

When STOP_MARKET or TAKE_PROFIT_MARKET trigger one of them still remain opened?

If I add manual order with TP/SL both ORDERS automatically closed.

Example:

  1. Orders have been added,
  2. Main order moved to position,
  3. Waiting, https://ibb.co/dJFjWjs
  4. Main order has been closed. One order is still opened, https://ibb.co/0Gyfr5Y

Thank you.

It isn’t possible to “link” SL/TP orders to a specific order per say. The relationship is automatically defined by the symbol|pair, and the position side if the position mode is in One-way.

Now concerning your other question, there has been various topics about it before, that answers your concern fully. The most recent one or the one that the moderators will redirect you towards as their gold standard approach.

Thank you!