Set Cross Exit Trigger
Endpoint for setting a stop-loss / take-profit bracket or a trailing stop on a non-isolated margin position. A position holds one trailing stop and up to 20 brackets, so long as their counts fit the position. Requires an open position unless anchor_order_id is supplied, and fires reduce-only orders.
Authorizations
Your API key ID
RSA-PSS signature of the request
Request timestamp in milliseconds
Path Parameters
Ticker of the market whose position the trigger protects.
Query Parameters
Subaccount number (0 for primary, 1-63 for subaccounts). Defaults to 0.
x >= 0Body
For bracket, supply stop_loss_price and/or take_profit_price. For trailing, supply exactly one of trail_amount or trail_bps. Fields belonging to the other kind are rejected, as is a body that sets neither — cancel with DELETE. A leg you omit is cleared.
Contracts this trigger closes when it fires. Omit it to cover the whole position, which then requires that no partial or anchored trigger already covers part of it. If supplied, it must be a whole number of contracts.
"10.00"
Ties the trigger to an order: its size follows that order's cumulative fill, and it stays pending until the order first fills. Bracket only; mutually exclusive with count. If the order cannot currently be validated, the request returns 409 with error code anchor_order_unavailable before writing anything, so retrying is safe.
Your own identifier, required on a count or anchor_order_id create because those append a trigger rather than replace one; rejected on every other write. Replaying a key returns the trigger the first request made, in whatever state it has since reached. Keys are single-use per account and belong to the position they created on: reusing one returns the original even once it is canceled, and presenting it for another subaccount or ticker returns 409 with error code idempotency_key_already_used.
64Which trigger family this write targets. Defaults to bracket.
bracket, trailing Mark price at which the stop-loss leg fires. Bracket only.
"0.5600"
Mark price at which the take-profit leg fires. Bracket only.
"0.5600"
Absolute trailing distance in dollars. Trailing only; mutually exclusive with trail_bps.
"0.5600"
Trailing distance in basis points of the tracked watermark (not the entry price). Trailing only; mutually exclusive with trail_amount.
1 <= x <= 9999Response
Exit trigger set successfully
Unique identifier for this trigger.
Market the protected position is on.
Trigger family. bracket is a stop-loss / take-profit pair; trailing is a trailing stop whose stop level ratchets with the liquidation mark.
bracket, trailing pending_on_entry awaits an initial or further fill from the anchor order before arming — an order-anchored trigger returns here after closing its current quantity, so this status can follow active and carries a non-zero filled_count when it does. active is live and evaluated against the mark each tick. filled, failed, and canceled are terminal.
pending_on_entry, active, filled, failed, canceled, unknown Contracts this trigger closes when it fires. 0 means the whole position.
"10.00"
Contracts closed so far across fire attempts.
"10.00"
Why the trigger reached its terminal status.
user_canceled, position_closed, entry_not_filled, order_rejected, position_flipped Leg that fired the last time the trigger fired.
stop_loss, take_profit Order placed the last time the trigger fired. An order-anchored trigger keeps it after returning to pending_on_entry, so its presence does not mean the trigger is done.
Order this trigger follows, for order-anchored triggers. Cleared once that order reaches a terminal state, so use client_trigger_id to correlate a trigger with the request that made it.
The idempotency key the create supplied, for appending creates.
Stop-loss leg price. Bracket triggers only.
"0.5600"
Take-profit leg price. Bracket triggers only.
"0.5600"
Absolute trailing distance. Trailing triggers only.
"0.5600"
Trailing distance in basis points of the watermark. Trailing triggers only.
Most favorable liquidation mark seen since creation — the peak for long positions, the trough for short. Trailing triggers only.
"0.5600"
Level whose breach fires the stop: watermark minus the trail for longs, plus for shorts. Trailing triggers only.
"0.5600"