交易
鑑權
簽名方式:每個請求用 App Key / Secret 簽名。請求頭如下:
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
Authorization | string · header | 必填 | OpenAPI 後台 上的賬戶 Access Token,作為原始 token 傳入(不帶 Bearer 前綴),並參與簽名計算。 |
X-Api-Key | string · header | 必填 | 你的 App Key。 |
X-Timestamp | string · header | 必填 | 請求時間戳,單位秒(Unix 時間)。 |
X-Api-Signature | string · header | 必填 | HMAC-SHA256 簽名。格式:HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=。 |
該接口用於修改訂單的價格,數量。
# Replace the order ID below with your actual order ID
longbridge order replace 693664675163312128 --qty 200 --price 255.00
請求
請求體
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
order_id | string | 必填 | 訂單 ID |
quantity | string | 必填 | 改單數量,例如:`200` |
price | string | 可選 | 改單價格,例如:`388.5`. `LO` / `ELO` / `ALO` / `ODD` / `LIT` 訂單必填 |
trigger_price | string | 可選 | 觸發價格,例如:`388.5`. `LIT` / `MIT` 訂單必填 |
limit_offset | string | 可選 | 指定價差。`TSLPAMT` / `TSLPPCT` 訂單在 `limit_depth_level` 為 0 時必填 |
trailing_amount | string | 可選 | 跟蹤金額。`TSLPAMT` 訂單必填 |
trailing_percent | string | 可選 | 跟蹤漲跌幅。`TSLPPCT` 訂單必填 |
remark | string | 可選 | 備註 (最大 64 字符) |
limit_depth_level | integer | 可選 | 指定買賣檔位,`TSLPAMT` / `TSLPPCT` 訂單必填 |
monitor_price | string | 可選 | 監控價格,`TSLPAMT` / `TSLPPCT` 訂單必填 |
trigger_count | integer | 可選 | 觸發次數,`LIT` / `MIT` / `TSLPAMT` / `TSLPPCT` 訂單必填 |
attached_params | object | 可選 | 附加單參數(止盈止損) |
attached_params.attached_order_type | string | 可選 | 附加單訂單類型。**可選值:**, `PROFIT_TAKER` - 止盈,`STOP_LOSS` - 止損,`BRACKET` - 括號單 |
attached_params.profit_taker_price | string | 可選 | 止盈觸發價格 |
attached_params.stop_loss_price | string | 可選 | 止損觸發價格 |
attached_params.time_in_force | string | 可選 | 附加單有效期類型。**可選值:**, `Day` - 當日有效,`GTC` - 撤單前有效,`GTD` - 到期前有效(此時繼承主單 expire_date) |
attached_params.expire_time | integer | 可選 | 到期時間(Unix 時間戳,單位秒) |
attached_params.profit_taker_id | integer | 可選 | 止盈單 ID,修改現有止盈單時填寫 |
attached_params.stop_loss_id | integer | 可選 | 止損單 ID,修改現有止損單時填寫 |
attached_params.cancel_all_attached | boolean | 可選 | 是否取消所有附加單 |
attached_params.main_id | integer | 可選 | 主單 ID |
attached_params.quantity | string | 可選 | 附加單數量 |
attached_params.market_price | string | 可選 | 市價 |
attached_params.activate_order_type | string | 可選 | 觸發後提交的訂單類型,例如 `LIT`(限價單)或 `MIT`(市價單) |
attached_params.profit_taker_submit_price | string | 可選 | 止盈限價委託價格,`activate_order_type` 為 `LIT` 時必填 |
attached_params.stop_loss_submit_price | string | 可選 | 止損限價委託價格,`activate_order_type` 為 `LIT` 時必填 |
attached_params.activate_rth | string | 可選 | 觸發後提交的訂單是否允許盤前盤後。**可選值:**, `RTH_ONLY` - 不允許盤前盤後,`ANY_TIME` - 允許盤前盤後 |
attached_params.profit_taker_depth_level | integer | 可選 | 止盈限價委託價格的買賣檔位,`activate_order_type` 為 `LIT` 時有效 |
attached_params.stop_loss_depth_level | integer | 可選 | 止損限價委託價格的買賣檔位,`activate_order_type` 為 `LIT` 時有效 |
響應
響應 JSON 示例
{
"code": 0,
"message": "success",
"data": {}
}錯誤碼
參見錯誤碼文檔。