Skip to main content

Close all positions

DELETE 

/v1/trading/accounts/:account_id/positions

Closes open positions for the selected account.

Runtime restrictions:

  • unavailable if trade_mode is trading_disabled

Filtering mode:

  • either use filter=all
  • or use any valid combination of filtering parameters

Supported filters:

  • instrument
  • side
  • profitable
  • unprofitable

Logical rules:

  • filter=all cannot be combined with any other filter
  • profitable and unprofitable are mutually exclusive
  • if neither profitable nor unprofitable is passed, both profitable and unprofitable positions may be closed

The method returns ACK response. Final transaction result is delivered through Server Events.

For fan-out bulk operations, the ACK response operation_id is the parent operation id. Each individual close event in Server Events contains envelope-level correlation fields:

  • parent_operation_id = ACK operation_id
  • operation_id = unique id of the concrete position close operation

Consistency and recovery notes:

  • Closed positions and final-state orders are retained for 1 month (subject to clarification).
  • If operation_id is not received in the REST ACK response, or is not received in Server events subscription, or an unknown operation_id is received, the client should restart Server events subscription and reconcile state using snapshots of currently open positions and pending orders.

Request

Responses

ACK