交易

修改订单

PUThttps://openapi.longbridge.com/v1/trade/order

鉴权

签名方式:每个请求用 App Key / Secret 签名。请求头如下:

名称类型必填说明
Authorizationstring · header必填OpenAPI 后台 上的账户 Access Token,作为原始 token 传入(不带 Bearer 前缀),并参与签名计算。
X-Api-Keystring · header必填你的 App Key。
X-Timestampstring · header必填请求时间戳,单位秒(Unix 时间)。
X-Api-Signaturestring · header必填HMAC-SHA256 签名。格式:HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=。

该接口用于修改订单的价格,数量。

>_ CLI
# Replace the order ID below with your actual order ID
longbridge order replace 693664675163312128 --qty 200 --price 255.00

请求

请求体

名称类型必填说明
order_idstring必填订单 ID
quantitystring必填改单数量,例如:`200`
pricestring可选改单价格,例如:`388.5`. `LO` / `ELO` / `ALO` / `ODD` / `LIT` 订单必填
trigger_pricestring可选触发价格,例如:`388.5`. `LIT` / `MIT` 订单必填
limit_offsetstring可选指定价差。`TSLPAMT` / `TSLPPCT` 订单在 `limit_depth_level` 为 0 时必填
trailing_amountstring可选跟踪金额。`TSLPAMT` 订单必填
trailing_percentstring可选跟踪涨跌幅。`TSLPPCT` 订单必填
remarkstring可选备注 (最大 64 字符)
limit_depth_levelinteger可选指定买卖档位,`TSLPAMT` / `TSLPPCT` 订单必填
monitor_pricestring可选监控价格,`TSLPAMT` / `TSLPPCT` 订单必填
trigger_countinteger可选触发次数,`LIT` / `MIT` / `TSLPAMT` / `TSLPPCT` 订单必填
attached_paramsobject可选附加单参数(止盈止损)
attached_params.attached_order_typestring可选附加单订单类型。**可选值:**, `PROFIT_TAKER` - 止盈,`STOP_LOSS` - 止损,`BRACKET` - 括号单
attached_params.profit_taker_pricestring可选止盈触发价格
attached_params.stop_loss_pricestring可选止损触发价格
attached_params.time_in_forcestring可选附加单有效期类型。**可选值:**, `Day` - 当日有效,`GTC` - 撤单前有效,`GTD` - 到期前有效(此时继承主单 expire_date)
attached_params.expire_timeinteger可选到期时间(Unix 时间戳,单位秒)
attached_params.profit_taker_idinteger可选止盈单 ID,修改现有止盈单时填写
attached_params.stop_loss_idinteger可选止损单 ID,修改现有止损单时填写
attached_params.cancel_all_attachedboolean可选是否取消所有附加单
attached_params.main_idinteger可选主单 ID
attached_params.quantitystring可选附加单数量
attached_params.market_pricestring可选市价
attached_params.activate_order_typestring可选触发后提交的订单类型,例如 `LIT`(限价单)或 `MIT`(市价单)
attached_params.profit_taker_submit_pricestring可选止盈限价委托价格,`activate_order_type` 为 `LIT` 时必填
attached_params.stop_loss_submit_pricestring可选止损限价委托价格,`activate_order_type` 为 `LIT` 时必填
attached_params.activate_rthstring可选触发后提交的订单是否允许盘前盘后。**可选值:**, `RTH_ONLY` - 不允许盘前盘后,`ANY_TIME` - 允许盘前盘后
attached_params.profit_taker_depth_levelinteger可选止盈限价委托价格的买卖档位,`activate_order_type` 为 `LIT` 时有效
attached_params.stop_loss_depth_levelinteger可选止损限价委托价格的买卖档位,`activate_order_type` 为 `LIT` 时有效

响应

响应 JSON 示例

{
  "code": 0,
  "message": "success",
  "data": {}
}

错误码

参见错误码文档。