Skip to main content
A stop and a target are not two orders you happen to send together. They are the primitive: one pair, applied as one unit, held at the venue as cancel-linked siblings. You can attach the pair when the entry goes in, or set it on a position you already hold. Both paths land in the same place.
1

Attach the exits to the entry

stopLoss and takeProfit ride along with Place an order. Atomic here means the exits are placed with the order as one unit or not at all — there is no state where the entry landed and the protection silently did not.
A leg on an order carries both forms the wire contract defines: the absolute price and the tick offset from the entry.Read warnings on the response even when it succeeds: it reports non-fatal degradations on an otherwise accepted request, and they are yours to surface.
2

Set or replace the exits after entry

Set position exits sets or replaces the stop and target on a position you already hold. The pair is applied as one unit, exactly as at entry.
clientOrderId is required here — the route answers 400 without one. Key it on the instrument and the levels, as above, so a retry of the same intent dedups instead of fighting itself.
3

Move one leg and leave the other alone

Each level is three-state. A number sets it, null removes it, and omitting it leaves the resting leg untouched. Tightening a stop without touching the target is one field:
Sending "takeProfit": null in that body would have removed the target instead.
4

Read what is actually resting

List position exits returns the exits recorded around the account’s positions, with each entry’s legs and their states, at the account revision they were read at.
If you already hold a snapshot you do not need this route: the same brackets array is in the snapshot, at the revision that names it. This read takes no venue reading and allocates no revision.

What the states mean

A bracket is the protection around one position. Its legs are the individual orders. Two details that catch clients out:
  • The sibling. The stop and the target are cancel-linked siblings at the venue, paired by ocoGroup. The leg that does not fill is cancelled when its sibling does — you do not cancel it yourself, and you should not treat its disappearance as a fault.
  • Re-parenting. A pre_armed leg hangs off the entry order through parentOrderId. Once that entry fills, the leg protects the position and parentOrderId is null. Do not key a leg by its parent order.

When the engine moves the stop for you

A breakeven move or a trailing stop is run by the engine, not by you. List server-managed stops shows those instances, the phase each has reached, and — where one is paused — the pauseReason explaining why nothing is moving the stop. A pause is honest degradation, not failure: the venue-placed stop is still resting and still protecting the position. Both brackets and managedExits are account state, so an account stream frame carries them at the same revision as the positions and orders. There is no separate channel to subscribe to. A risk-locked account answers 423 to both the order route and the exits route. That is a state to display, not an error to retry.

Where to go deeper