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.
{
"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)
{
"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
{
"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
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
Parameter | Type | Required | Description |
---|---|---|---|
symbol | String | Yes | Trading pair, e.g. ETHUSDT |
marginCoin | String | Yes | marginCoin e.g: USDT |
productType | String | Yes | Product typeUSDT-FUTURES USDT professional futuresCOIN-FUTURES Mixed futuresUSDC-FUTURES USDC professional futuresSUSDT-FUTURES USDT professional futures demoSCOIN-FUTURES Mixed futures demoSUSDC-FUTURES USDC professional futures demo |
size | String | Yes | Amount |
side | String | No | Order direction buy: Buy sell: Sell |
tradeSide | String | No | Direction 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" |
clientOid | String | No | Customize order ID |
marginCoin | String | Yes | margin coin |
{
"code": "00000",
"msg": "success",
"requestTime": 1695806875837,
"data": {
"clientOid": "121211212122",
"orderId": "1"
}
}
Return Parameter
Parameter | Type | Description |
---|---|---|
orderId | String | Order ID |
clientOid | String | Customize order ID |