Skip to Content

Modify Grid Order

Modify an existing grid order's rule. The whole grid_trading_rule is replaced with the one you submit, so pass the complete rule — not just the fields you changed.

CLI
# Modify a grid order's base/bound prices and quantities
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
# Validate the new rule without applying it
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_idstringYESGrid order ID, example: 764609681686573056
grid_trading_ruleobjectYESThe full grid rule to apply. Fields below.

grid_trading_rule

NameTypeRequiredDescription
submitted_base_pricestringYESBase price the grid is anchored to
upper_limit_pricestringYESUpper price bound
lower_limit_pricestringYESLower price bound
trigger_price_typeint32YESHow trigger thresholds are interpreted

Enum Value:
1 - spread (absolute)
2 - percent
trigger_spread_upstringNOUpward trigger spread, required when trigger_price_type is 1
trigger_spread_downstringNODownward trigger spread, required when trigger_price_type is 1
trigger_percent_upstringNOUpward trigger percent, required when trigger_price_type is 2
trigger_percent_downstringNODownward trigger percent, required when trigger_price_type is 2
trigger_quantitystringYESQuantity per trigger
upper_limit_quantitystringYESQuantity handled when the upper bound is reached
lower_limit_quantitystringYESQuantity handled when the lower bound is reached
time_in_forceint32YESTime in force

Enum Value:
0 - Day
1 - GTC (Good-Til-Canceled)
6 - GTD (Good-Til-Date)
expire_timeint64NOExpiry time (Unix timestamp, in seconds), required when time_in_force is 6 (GTD)
upper_limit_eventint32NOAction when the upper bound is reached

Enum Value:
1 - ignore (keep running)
2 - close position at last price
lower_limit_eventint32NOAction when the lower bound is reached

Enum Value:
1 - ignore (keep running)
2 - close position at last price
trigger_sell_depthint32NOSell-side order-book depth (-5 ~ 5). 0 = use grid_order_type_up instead of a depth level
trigger_buy_depthint32NOBuy-side order-book depth (-5 ~ 5). 0 = use grid_order_type_down instead of a depth level
grid_order_type_upstringNOSell-side order type when trigger_sell_depth is 0

Enum Value:
GMO / GLO / GTG
grid_order_type_downstringNOBuy-side order type when trigger_buy_depth is 0

Enum Value:
GMO / GLO / GTG
multiple_triggerbooleanNOWhether a single grid level may trigger multiple times
support_shortsellbooleanNOWhether short selling is allowed
rthint32NORegular-trading-hours flag (0 / 1 / 2)

Request Example

Response

Response Headers

  • Content-Type: application/json

Response Example

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

Response Status

StatusDescriptionSchema
200The grid order was modified successfully.None
400The modification was rejected with an incorrect request parameter.None