下单
POST: /v1/future-u/trade/order/create
Content-Type: application/x-www-form-urlencoded && application/json
Parameters
参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
---|---|---|---|---|---|
clientOrderId | string | false | N/A | 自定义订单id | |
symbol | string | true | 交易对 | ||
orderSide | string | true | N/A | 买卖方向:BUY;SELL | BUY;SELL |
orderType | string | true | N/A | 订单类型:LIMIT;MARKET | LIMIT;MARKET |
origQty | number | true | N/A | 数量(张) | |
price | number | false | N/A | 价格 | |
timeInForce | string | false | GTC | 有效方式:GTC;IOC;FOK;GTX | GTC;IOC;FOK;GTX |
triggerProfitPrice | number | false | N/A | 止盈价 | |
triggerStopPrice | number | false | N/A | 止损价 | |
positionSide | string | true | N/A | 仓位方向:LONG;SHORT | LONG;SHORT |
OrigQty 计算公式
公式 origQty = Truncate ((Balance * Percent * Leverage ) / (Mark_price * Contract_size))
解释
Truncate : 取整数部分
Balance : (walletBalance - openOrderMarginFrozen) , api: /v1/future-u/user/compat/balance/list
Percent : 用户输入 , 例如: 0.2
Leverage : 杠杆倍数 , 例如: 20
Mark_price : 市场标记价格 , 例如: 88888 (btc_usdt)
Contract_size : 合约面值 , api: /v1/future-u/market/public/symbol/detail , Contract multiplier(face value)
举例
truncate(10000 * 0.2 * 20 / 88888 / 0.0001) = 4500
限流规则
200/s/apikey
Response
{
"msgInfo": {
"code": "",
"msg": ""
},
"msg": "",
"data": {},
"code": 200
}