Skip to navigation

Close position

Close the position of an instrument via a market order.

Authentication

OK-ACCESS-KEYstring
Your API key.
OK-ACCESS-SIGNstring

Base64-encoded HMAC-SHA256 signature of the prehash string.

OK-ACCESS-TIMESTAMPstring

ISO 8601 UTC timestamp, e.g. 2020-12-08T09:08:57.715Z.

OK-ACCESS-PASSPHRASEstring
The passphrase you set when creating the API key.

Request

This endpoint expects an object.
instIdstringRequired
Instrument ID
mgnModeenumRequired

Margin mode cross isolated

Allowed values:
posSideenumOptional

Position side This parameter can be omitted in net mode, and the default value is net. You can only fill with net. This parameter must be filled in under the long/short mode. Fill in long for close-long and short for close-short.

Allowed values:
ccystringOptional

Margin currency, required in the case of closing cross MARGIN position for Futures mode.

autoCxlbooleanOptional

Whether any pending orders for closing out needs to be automatically canceled when close position via a market order. false or true, the default is false.

clOrdIdstringOptional

Client-supplied ID A combination of case-sensitive alphanumerics, all numbers, or all letters of up to 32 characters.

tagstringOptional

Order tag A combination of case-sensitive alphanumerics, all numbers, or all letters of up to 16 characters.

Response

Successful response
codestringOptional

Result code. 0 means success; any other value is an error code.

msgstringOptional
Error message. Empty on success.
datalist of objectsOptional