---
title: "Close a position"
method: DELETE
path: "/trade/positions/{positionId}"
tags: ["Trading"]
---

# Close a position

`DELETE /trade/positions/{positionId}`

Place an order to close an existing position. Isn't guaranteed to close the positions, or close it immediately. Will attempt to place an IOC, then GTC closing order, so the execution might be delayed. If you want to fully close position set parameter `qty` to `0`, but if you want to partially close a position just set the `qty` parameter to the number of lots that you want to close. 

 NOTE: if you don't know what is the `positionId` value (you only have an `orderId` of the order that opened the position), you can use the `GET /trade/accounts/{accountId}/ordersHistory` route to get the list of all final orders and their IDs. Just match the `orderId` with the `positionId`.

## Path parameters

- `positionId` integer, required

## Query parameters

- `strategyId` string

## Headers

- `accNum` integer, required
- `developer-api-key` string

## Request body

- ClosePosition
  - `qty` number

## Response `200`

- SuccessResponse
  - `s` string, required — Status will always be `ok`.

## Other responses

- `204` — No Content
- `401` — Unauthorized
- `403` — Forbidden

---

[API](https://skmtc.net/tradelocker/apis/trading-api.md) · [All operations](https://skmtc.net/tradelocker/apis/trading-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tradelocker/trading-api/revisions/5b184d9b617c/schema)
