Skip to main content

Reversal

  • Speed limit is 10 times/s for average users. Frequency limit imposed according to user ID
  • Speed limit is 1 times/s for copy trade traders. Frequency limit imposed according to user ID

Description

Reversal logic is different under "double_hold"/"single_hold" hold mode:

double_hold

  • 1) You could usually specify a size(size > 0 and size <= position size), which the size will be closed from your current position and a same size will be opened on the opposite side
  • 2) "side" value: close_short or close_long

single_hold

  • 1) The size parameter is omitted, that means you could only close the whole position, then try to open on the opposite side with market price, the open position might fail due to margin condition
  • 2) "side" value: sell_single when position side is buy_single, buy_single when position side is sell_single

Note: Your position will be closed at market price and open in reverse side for the specific amount.

If the close position settled amount + available balance are insufficient to open the specific size of positions, or the reverse order value is less than 5 USDT, the specified size position will be closed and the position open will fail.

Your operation may not be 100% successful due to margin, market conditions and other factors.

You must have an exists position to trigger a reversal operation, or server will return error "Not enough position is available."

{
"code": "40757",
"msg": "Not enough position is available.",
"requestTime": 1665454799692,
"data": null
}

Set size

The reverse order size usually should be same as the original size. For example: original position size 100, in reversal request you should set the size to 100, Server will then close your original position 100, and open extra 100 in reversal side in market price with the best efforts.

original order
{
"size": "100",
"side": "open_long",
"orderType": "market",
"timeInForceValue": "normal",
"symbol": "TRXUSDT_UMCBL",
"marginCoin": "USDT"
}

Reversal - 1 times size

  • [reverse size] = [close size] = [open reverse size]
  • Original position size: 1 long BTCUSDT
  • Reverse order size: 1 close_long BTCUSDT
  • Ideally the 1 long BTCUSDT will be closed, and 1 short BTCUSDT will be opened
  • The reverse order size could also be set to 1.5 or 3 times of the original size(or even more), in reversal it will first close all of your position in market price, then try to open reverse position with the original size (that is: if reversal size is bigger than the original position size, the reversal size will be treated as the original position size)
Reversal - 1.5 times size
{
"size": "1.5",
"side": "close_long",
"orderType": "market",
"symbol": "BTCUSDT",
"marginCoin": "USDT",
"reverse":true
}

Reversal - 1.5 times size

  • Original position size: 1 long BTCUSDT
  • Reverse order size: 1.50 close_long BTCUSDT
  • Ideally the 1 long BTCUSDT will be closed, and 1 short BTCUSDT will be opened
  • The reverse order size could also be set to a number between 0 to 1 times of the original position size, in reversal it will first close your position with specific reversal size in market price, then try to open reverse position with the specific size
Reversal - 0.5 times size
{
"size": "0.5",
"side": "close_long",
"orderType": "market",
"symbol": "BTCUSDT",
"marginCoin": "USDT",
"reverse":true
}

Reversal - 0.5 times size

  • Original position size: 1 long BTCUSDT
  • Reverse order size: 0.5 close_long BTCUSDT
  • Ideally the 0.5 long BTCUSDT will be closed, and 0.5 short BTCUSDT will be opened; So at the end you should be holding 0.5 long BTCUSDT, and 0.5 short BTCUSDT
  • 'orderType' must be market price, a limit price order will be treated as market price order in reversal

Set side

  • If originally side is open_long, then in reversal you should set the side to close_long;
  • If originally side is open_short, then in reversal you should set the side to close_short;
  • Use sell_single when original position side is buy_single
  • Use buy_single when original position side is sell_single;

HTTP Request

  • POST /api/v2/mix/order/click-backhand
Request Example
curl -X POST "https://api.cointr.com/api/v2/mix/order/click-backhand" \
-H "ACCESS-KEY:your apiKey" \
-H "ACCESS-SIGN:*" \
-H "ACCESS-PASSPHRASE:*" \
-H "ACCESS-TIMESTAMP:1659076670000" \
-H "locale:zh-CN" \
-H "Content-Type: application/json" \
-d '{
"symbol": "ethusdt",
"productType": "USDT-FUTURES",
"marginCoin": "usdt",
"size": "30",
"clientOid": "12345"
}'

Request Parameters

ParameterTypeRequiredDescription
symbolStringYesTrading pair, e.g. ETHUSDT
marginCoinStringYesmarginCoin e.g: USDT
productTypeStringYesProduct type
USDT-FUTURES USDT professional futures
COIN-FUTURES Mixed futures
USDC-FUTURES USDC professional futures
SUSDT-FUTURES USDT professional futures demo
SCOIN-FUTURES Mixed futures demo
SUSDC-FUTURES USDC professional futures demo
sizeStringYesAmount
sideStringNoOrder direction
buy: Buy
sell: Sell
tradeSideStringNoDirection
Required in open and close (hedge mode) position .
For one-way positions, this field will be ignored
Open and Close
Notes:
For open long, fill in"Buy"; tradeSide should be "Open"
For open short, fill in "Sell"; tradeSide should be "Open"
For close long, fill in "Buy"; tradeSide should be "Close"
For close short, fill in "Sell"; tradeSide should be "Close"
clientOidStringNoCustomize order ID
marginCoinStringYesmargin coin
Response Example
{
"code": "00000",
"msg": "success",
"requestTime": 1695806875837,
"data": {
"clientOid": "121211212122",
"orderId": "1"
}
}

Return Parameter

ParameterTypeDescription
orderIdStringOrder ID
clientOidStringCustomize order ID