Grid Order Detail
Query the full detail of a single grid order, including its rule, paged executed sub-orders (grid_sub_orders), and paged lifecycle history (grid_order_history).
SDK Links
Python | longbridge.openapi.GridContext.detail |
Rust | longbridge::grid::GridContext#detail |
Node.js | GridContext#detail |
Java | GridContext.getDetail |
C++ | longbridge::grid::GridContext::detail |
Request
| HTTP Method | GET |
| HTTP URL | /v1/gridtrading/detail |
Parameters
Content-Type: application/json; charset=utf-8
| Name | Type | Required | Description |
|---|---|---|---|
| order_id | string | YES | Grid order ID, example: 764609681686573056 |
| history_id | string | NO | Cursor for paging the lifecycle history. Pass the last history_id of a page to fetch older entries. |
| limit | int32 | NO | Page size for grid_sub_orders and grid_order_history |
Request Example
Response
Response Headers
- Content-Type: application/json
Response Example
json
{
"code": 0,
"message": "success",
"data": {
"order_id": "764609681686573056",
"symbol": "700.HK",
"stock_name": "TENCENT",
"status": "Performing",
"grid_status": "Performing",
"suspend_reason": "",
"sleeping_reason": "",
"submitted_base_price": "300",
"current_base_price": "300",
"upper_limit_price": "360",
"lower_limit_price": "240",
"trigger_price_type": 2,
"trigger_spread_up": "",
"trigger_spread_down": "",
"trigger_percent_up": "2",
"trigger_percent_down": "2",
"pullback_percent": "",
"pullback_spread": "",
"rebound_percent": "",
"rebound_spread": "",
"multiple_trigger": false,
"time_in_force": 1,
"trigger_quantity": "100",
"trigger_sell_quantity": "0",
"trigger_buy_quantity": "0",
"upper_limit_quantity": "200",
"lower_limit_quantity": "100",
"upper_limit_event": 1,
"lower_limit_event": 1,
"trigger_sell_depth": 0,
"trigger_buy_depth": 0,
"created_at": "2024-08-12T10:30:00+08:00",
"updated_at": "2024-08-12T10:30:00+08:00",
"settlement_currency": "HKD",
"expire_time": "",
"gtd": "",
"grid_sub_orders": [],
"sub_has_more": false,
"grid_order_history": [
{
"history_id": "764609681686573100",
"created_at": "2024-08-12T10:30:00+08:00",
"status": "Performing",
"suspend_reason": "",
"reason": "Grid order started"
}
],
"history_has_more": false,
"support_shortsell": false,
"rth": 0,
"grid_order_type_up": "GMO",
"grid_order_type_down": "GMO"
}
}Response Status
| Status | Description | Schema |
|---|---|---|
| 200 | The grid order detail was returned successfully. | grid_order_detail_rsp |
| 400 | The request was rejected with an incorrect parameter. | None |
Schemas
grid_order_detail_rsp
| Name | Type | Required | Description |
|---|---|---|---|
| order_id | string | true | Grid order ID |
| symbol | string | true | Security symbol, ticker.region format |
| stock_name | string | true | Security name |
| status | string | true | Grid order status, example: Performing / Suspended |
| grid_status | string | true | Detailed grid running status |
| suspend_reason | string | true | Reason the grid is suspended, empty when running |
| sleeping_reason | string | true | Reason the grid is dormant, empty when active |
| submitted_base_price | string | true | Base price the grid was anchored to at submission |
| current_base_price | string | true | Current base price after triggers |
| upper_limit_price | string | true | Upper price bound |
| lower_limit_price | string | true | Lower price bound |
| trigger_price_type | int32 | true | How trigger thresholds are interpreted Enum Value: 1 - spread (absolute)2 - percent |
| trigger_spread_up | string | true | Upward trigger spread (when trigger_price_type is 1) |
| trigger_spread_down | string | true | Downward trigger spread (when trigger_price_type is 1) |
| trigger_percent_up | string | true | Upward trigger percent (when trigger_price_type is 2) |
| trigger_percent_down | string | true | Downward trigger percent (when trigger_price_type is 2) |
| pullback_percent | string | true | Pullback percent |
| pullback_spread | string | true | Pullback spread |
| rebound_percent | string | true | Rebound percent |
| rebound_spread | string | true | Rebound spread |
| multiple_trigger | boolean | true | Whether a single grid level may trigger multiple times |
| time_in_force | int32 | true | Time in force Enum Value: 0 - Day1 - GTC6 - GTD |
| trigger_quantity | string | true | Quantity per trigger |
| trigger_sell_quantity | string | true | Cumulative quantity triggered on the sell side |
| trigger_buy_quantity | string | true | Cumulative quantity triggered on the buy side |
| upper_limit_quantity | string | true | Quantity handled when the upper bound is reached |
| lower_limit_quantity | string | true | Quantity handled when the lower bound is reached |
| upper_limit_event | int32 | true | Action at the upper bound Enum Value: 1 - ignore2 - close position at last price |
| lower_limit_event | int32 | true | Action at the lower bound Enum Value: 1 - ignore2 - close position at last price |
| trigger_sell_depth | int32 | true | Sell-side order-book depth (-5 ~ 5). 0 = use grid_order_type_up |
| trigger_buy_depth | int32 | true | Buy-side order-book depth (-5 ~ 5). 0 = use grid_order_type_down |
| created_at | string | true | Creation time, RFC3339 format |
| updated_at | string | true | Last update time, RFC3339 format |
| settlement_currency | string | true | Settlement currency, example: HKD |
| expire_time | string | true | Expiry time, RFC3339 format (when time_in_force is GTD) |
| gtd | string | true | Good-Til-Date, YYYY-MM-DD format |
| grid_sub_orders | object[] | false | Executed sub-orders for this grid |
| ∟ id | string | true | Sub-order ID |
| ∟ price | string | true | Order price |
| ∟ order_type | string | true | Order type |
| ∟ quantity | string | true | Order quantity |
| ∟ executed_qty | string | true | Executed quantity |
| ∟ action | int32 | true | Buy/sell direction |
| ∟ status | string | true | Sub-order status |
| ∟ submitted_at | string | true | Submission time, RFC3339 format |
| ∟ rth | int32 | true | Regular-trading-hours flag (0 / 1 / 2) |
| sub_has_more | boolean | true | Whether more sub-orders can be paged |
| grid_order_history | object[] | false | Lifecycle history entries |
| ∟ history_id | string | true | History entry ID, also used as the paging cursor |
| ∟ created_at | string | true | Event time, RFC3339 format |
| ∟ status | string | true | Grid status after the event |
| ∟ suspend_reason | string | true | Suspend reason, when applicable |
| ∟ reason | string | true | Human-readable description of the event |
| history_has_more | boolean | true | Whether more history entries can be paged via history_id |
| support_shortsell | boolean | true | Whether short selling is allowed |
| rth | int32 | true | Regular-trading-hours flag (0 / 1 / 2) |
| grid_order_type_up | string | true | Sell-side order type when trigger_sell_depth is 0Enum Value: GMO / GLO / GTG |
| grid_order_type_down | string | true | Buy-side order type when trigger_buy_depth is 0Enum Value: GMO / GLO / GTG |