跳到主要内容

更新订单

类型: POST

描述: /future/trade/v1/order/update

Content-Type = application/x-www-form-urlencoded && application/json

参数

名称类型必填默认值描述范围
orderIdnumbertrue订单 ID
pricenumbertrue目标价格
origQtynumbertrue目标数量(张)
triggerProfitPricenumberfalseN/A止盈目标价格
triggerStopPricenumberfalseN/A止损价格
triggerPriceTypestringfalseLATEST_PRICE触发价格类型INDEX_PRICE; MARK_PRICE; LATEST_PRICE
profitDelegateOrderTypestringfalseN/A止盈订单类型LIMIT; MARKET
profitDelegateTimeInForcestringfalseN/A止盈订单有效方式GTC; IOC; FOK; GTX
profitDelegatePricenumberfalseN/A止盈订单价格
stopDelegateOrderTypestringfalseN/A止损订单类型LIMIT; MARKET
stopDelegateTimeInForcestringfalseN/A止损订单有效方式GTC; IOC; FOK; GTX
stopDelegatePricenumberfalseN/A止损订单价格
followUpOrderbooleanfalseN/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_orderOrder id 不存在
invalid_params参数设置有误
invalid_quantityorigQty必须为整数
invalid_priceprice设置不合法
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分钟内限价订单价格限制