跳轉到內容

修改網格訂單

修改已存在的網格訂單規則。提交的 grid_trading_rule 會整體替換原有規則,因此需要傳入完整的規則,而不是僅傳改動的欄位。

CLI
# 修改網格訂單的基準價、上下邊界價格和數量
longbridge grid replace 764609681686573056 --base-price 305 --upper-price 360 --lower-price 240 --trigger-type percent --trigger-up 2 --trigger-down 2 --quantity 100 --upper-quantity 200 --lower-quantity 100 --order-type GMO --tif gtc
# 僅校驗新規則而不實際應用
longbridge grid replace 764609681686573056 --base-price 305 --upper-price 360 --lower-price 240 --trigger-type percent --trigger-up 2 --trigger-down 2 --quantity 100 --upper-quantity 200 --lower-quantity 100 --order-type GMO --tif gtc --dry-run

Request

HTTP MethodPOST
HTTP URL/v1/gridtrading/replace

Parameters

Content-Type: application/json; charset=utf-8

NameTypeRequiredDescription
order_idstringYES網格訂單 ID,例如:764609681686573056
grid_trading_ruleobjectYES要應用的完整網格規則,欄位見下。

grid_trading_rule

NameTypeRequiredDescription
submitted_base_pricestringYES網格錨定的基準價
upper_limit_pricestringYES價格上邊界
lower_limit_pricestringYES價格下邊界
trigger_price_typeint32YES觸發閾值的計算方式

可選值:
1 - 價差(絕對值)
2 - 百分比
trigger_spread_upstringNO向上觸發價差,trigger_price_type1 時必填
trigger_spread_downstringNO向下觸發價差,trigger_price_type1 時必填
trigger_percent_upstringNO向上觸發百分比,trigger_price_type2 時必填
trigger_percent_downstringNO向下觸發百分比,trigger_price_type2 時必填
trigger_quantitystringYES每次觸發的數量
upper_limit_quantitystringYES到達上邊界時處理的數量
lower_limit_quantitystringYES到達下邊界時處理的數量
time_in_forceint32YES訂單有效期類型

可選值:
0 - 當日有效
1 - GTC(撤單前有效)
6 - GTD(到期前有效)
expire_timeint64NO到期時間(Unix 時間戳,單位秒),time_in_force6(GTD)時必填
upper_limit_eventint32NO到達上邊界時的動作

可選值:
1 - 忽略(保持運行)
2 - 以最新價平倉
lower_limit_eventint32NO到達下邊界時的動作

可選值:
1 - 忽略(保持運行)
2 - 以最新價平倉
trigger_sell_depthint32NO賣方向盤口檔位(-5 ~ 5)。為 0 時使用 grid_order_type_up 而非檔位
trigger_buy_depthint32NO買方向盤口檔位(-5 ~ 5)。為 0 時使用 grid_order_type_down 而非檔位
grid_order_type_upstringNOtrigger_sell_depth0 時的賣方向訂單類型

可選值:
GMO / GLO / GTG
grid_order_type_downstringNOtrigger_buy_depth0 時的買方向訂單類型

可選值:
GMO / GLO / GTG
multiple_triggerbooleanNO單個網格檔位是否可多次觸發
support_shortsellbooleanNO是否允許賣空
rthint32NO常規交易時段標誌(0 / 1 / 2

Request Example

Response

Response Headers

  • Content-Type: application/json

Response Example

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

Response Status

StatusDescriptionSchema
200網格訂單修改成功。None
400修改被拒絕,請求參數錯誤。None