Skip to main content
POST /api/v1/positions/{position}/close requires a verified account, trading permission, and a persisted Idempotency-Key for this closing intent.

Full close

Select the Position ticket from your account’s positions. Do not use the opening request ID or order ID. Omit volume to request the entire current position volume:

Partial close

Specify the volume to close in MT5 units: 10000 = 1 lot. To close 0.5 lots:
Volume must be positive, no greater than the current position, and comply with the symbol minimum, maximum and step. Omitted or null volume means the full observed volume. The optional comment is limited to 31 characters.

Server calculations

The API searches only the verified account, resolves the symbol and volume, and closes BUY with SELL at Bid or SELL with BUY at Ask. It derives current price, precision and FOK/IOC using the account group’s effective symbol settings. The Dealer request includes the position ticket so it targets that specific position. Do not send symbol, side, price or digits. Legacy bodies containing these fields now return 422 and must be updated. Close-only symbols are supported.

Submit and confirm

Persist the body in closing.json and a unique key for this intent:
Replaying the same body, ticket and key returns the original submission without looking up the position again or sending another order. A new key is a new intent. Save the returned request ID and query its result. IOC can execute partially even for a full-close request. Check the remaining position before deciding on another operation; the API never automatically resubmits it. Missing or foreign tickets return 403. Excessive volume, invalid steps or extra fields return 422. Stale quotes prevent submission. Concurrent activity may change the position; the broker validates final execution. Submission alone does not guarantee that the position is fully closed.