更新订单
类型: POST
描述: /future/trade/v1/order/update
Content-Type =
application/x-www-form-urlencoded && application/json
参数
| 名称 | 类型 | 必填 | 默认值 | 描述 | 范围 |
|---|---|---|---|---|---|
| orderId | number | true | 订单 ID | ||
| price | number | true | 目标价格 | ||
| origQty | number | true | 目标数量(张) | ||
| triggerProfitPrice | number | false | N/A | 止盈目标价格 | |
| triggerStopPrice | number | false | N/A | 止损价格 | |
| triggerPriceType | string | false | LATEST_PRICE | 触发价格类型 | INDEX_PRICE; MARK_PRICE; LATEST_PRICE |
| profitDelegateOrderType | string | false | N/A | 止盈订单类型 | LIMIT; MARKET |
| profitDelegateTimeInForce | string | false | N/A | 止盈订单有效方式 | GTC; IOC; FOK; GTX |
| profitDelegatePrice | number | false | N/A | 止盈订单价格 | |
| stopDelegateOrderType | string | false | N/A | 止损订单类型 | LIMIT; MARKET |
| stopDelegateTimeInForce | string | false | N/A | 止损订单有效方式 | GTC; IOC; FOK; GTX |
| stopDelegatePrice | number | false | N/A | 止损订单价格 | |
| followUpOrder | boolean | false | N/A | 如果为 true,表示追单 |
限流规则
200/s/apikey
请求示例
Request
REQUEST_BODY='{
"orderId":"1234567890",
"price":"3800",
"origQty":1
}'
# 以上三个参数是必须的,可选参数请参考可选参数列表
curl -X POST "https://fapi.xt.com/future/trade/v1/order/update" \
-H "validate-appkey: $APPKEY" \ # 必须
-H "validate-timestamp: $TIMESTAMP" \ # 必须
-H "validate-singature: $SINGATURE" \ # 必须
-H "Content-Type: application/json" \ # 必须
-d "${REQUEST_BODY}" # 必须
响应示例
Response
{
"error": {
"code": "",
"msg": ""
},
"msgInfo": "",
"result": {},
"returnCode": 0
}
错误码
| 错误码 | 描述 |
|---|---|
| invalid_order | Order id 不存在 |
| invalid_params | 参数设置有误 |
| invalid_quantity | origQty必须为整数 |
| invalid_price | price设置不合法 |
| invalid_trigger_profit_price | 止盈价格设置不合法 |
| invalid_trigger_stop_price | 止损价格设置不合法 |
| trigger_profit_price_less_than_order_delegate_price | 触发止盈价格不可小于订单委托价格(多) |
| trigger_profit_price_more_than_order_delegate_price | 触发止盈价格不可大于订单委托价格(空) |
| trigger_stop_price_more_than_order_delegate_price | 触发止损价格不可大于订单委托价格(多) |
| trigger_stop_price_less_than_order_delegate_price | 触发止损价格不可小于订单委托价格(空) |
| invalid_time_in_force | 无效的订单有效期 |
| on_board_30_minutes_limit_order_price_limit | 上板后30分钟内限价订单价格限制 |