Skip to content

Take profit & stop loss

Trigger orders, reduce-only behavior, and how OCO pairs protect a position without leaving a second leg exposed.

Updated Nov 4, 2026Traders2 min read
On this page

Take profit (TP) and stop loss (SL) orders are conditional orders that activate when the mark price crosses a trigger. They can be attached to a position or to a parent order.

Position TP/SL

A position TP/SL is a pair of reduce-only orders attached to an open position. When one leg executes, the other is canceled automatically (OCO). This prevents the classic mistake of closing a position twice and opening the opposite side by accident.

FieldMeaning
triggerPxPrice that activates the order
isMarketWhether the triggered order is market or limit
limitPxLimit price when isMarket is false
reduceOnlyMust be true for position TP/SL
sizeDefaults to the full position

Trigger direction

For a long position, a take-profit trigger is above the mark and a stop trigger is below it. For a short, the directions are reversed. The API rejects a trigger on the wrong side with Invalid trigger price.

Parent-order TP/SL

You can attach TP/SL to a limit order before it fills. The conditional orders are created only when the parent fills. This is useful for bracket orders: entry, target, and stop are submitted as one intent.

code
{
  "type": "order",
  "orders": [{
    "asset": 0,
    "isBuy": true,
    "limitPx": "103900",
    "sz": "0.01",
    "reduceOnly": false,
    "tif": "Gtc",
    "takeProfit": { "triggerPx": "110000", "isMarket": true },
    "stopLoss": { "triggerPx": "98000", "isMarket": true }
  }],
  "grouping": "normalTpsl"
}

Market vs limit triggers

  • Market trigger sends a market order when activated. It prioritizes exit certainty.
  • Limit trigger sends a limit order. It may not fill if the market gaps through the limit.

For stops in fast markets, a market trigger is usually safer. For take-profit orders, a limit trigger can capture a better price at the cost of a missed exit.

Partial TP/SL

You can attach multiple TP/SL orders to one position as long as the total reduce-only size does not exceed the position. This is how scale-out plans are expressed. Each order is independent; canceling one does not cancel the others unless they are part of the same OCO group.

Common failures

SymptomCauseFix
TP executed at a lossTrigger used mark price, fill used book priceUse a limit trigger or widen the target
SL did not executeTrigger was on the wrong sideCheck the trigger direction
Order rejected as reduce-onlyPosition was already closedCancel the stale order
Both legs executedOrders were not submitted as OCOUse position TP/SL grouping

Was this page helpful?