delete
https://api.connex.trade/api/v1/trading/positions
Permission
- Primary API Key:
TRADE, batch close positions of main portfolio - Sub-Portfolio API Key:
TRADE, batch close positions of current portfolio
Need to cancel all open orders before calling this endpoint to batch close existing positions.
Rate Limit
- 4 requests per 10 seconds
Note
- Close Positions API is designed for the instant position close purpose, which is usually to make sure no more positions will be there after the call.
- The standard process to use this endpoint is to :
- cancell all open order
- close positions
- close positions API is only for market orders to close. To close an position with limit order, please place limit order with 【reduceonly】
Request
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symList | String | N | Trading pair unique identifier , Support up to 20 pairs, separated by "," . example: BINANCE_PERP_BTC_USDT, OKX_PERP_BTC_USDT. symList can't be empty if closeAllPos=false. |
| positionSide | String | N | NONE / LONG / SHORT. NONE stands for one-way mode position. Unable to close positions if NONE passed , when the account mode is two-ways (BOTH) mode. If your positionMode is both, positionSide must be LONG or SHORT |
| closeAllPos | String | N | true / false. default false. In false case, symList mustn't be empty. In true case, ignore symList and close all open positions in specific exchange |
| exchangeType | String | N | OKX / BINANCE. empty to close all exchange positions. Only applies to closeAllPos = true. |
Respone
| Field name | Type | Remarks |
|---|---|---|
| sym | String | Trading pair unique identifier , example: BINANCE_PERP_BTC_USDT, OKX_PERP_BTC_USDT |
| orderId | String | orderId, if cannot close position, it don't have orderId |
| positionSide | String | NONE / LONG / SHORT |
| orderId | String | order id to close the current sym |
| success | String | true / false. where it is able to issue an order to close the current sym |
| errorMsg | String | error message if unable to issue an order to close the current sym |
