Skip to main content

Close position

DELETE 

/v1/trading/accounts/:account_id/positions/:position_id

Closes the selected open position.

Runtime restrictions:

  • unavailable if trade_mode is trading_disabled

The method supports both:

  • full close
  • partial close

Rules:

  • if volume is omitted, the whole remaining position volume is closed
  • if volume is provided, partial close is performed
  • volume must be greater than 0
  • volume must not exceed current open position volume

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

Supported filters:

  • volume: for partial close
  • price
  • deviation: optional maximum allowed price deviation for position close execution, expressed in points
  • close_by_position_id

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