Trade
Authorization
Signed mode: every request is signed with your App Key/Secret. Header set:
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string · header | Required | The account Access Token from the OpenAPI dashboard — passed as the raw token (no Bearer prefix) and included in the signature calculation. |
X-Api-Key | string · header | Required | Your App Key. |
X-Timestamp | string · header | Required | Request timestamp in seconds (Unix epoch). |
X-Api-Signature | string · header | Required | HMAC-SHA256 signature. Format: HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=. |
Get a paged list of your grid orders, optionally filtered by market, symbol, or status.
# List all grid orders (default)
longbridge grid
# Filter by symbol and status
longbridge grid --symbol 700.HK --status Performing
Request
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | Optional | Page number, starts at `1` |
limit | integer | Optional | Page size |
market | string | Optional | Market filter **Enum Value:** `US` / `HK` / `CN` / `SG` |
symbol | string | Optional | Security symbol, `ticker.region` format, example: `700.HK` |
status | string | Optional | Grid order status filter, comma-joined, example: `Performing,Suspended` |
sort_by | string | Optional | Field to sort by |
sort_order | string | Optional | Sort direction |
Response
Response properties
| Name | Type | Required | Description |
|---|---|---|---|
grid_order | object[] | Optional | Grid orders |
└ order_id | string | Required | Grid order ID |
└ symbol | string | Required | Stock symbol, use `ticker.region` format, example: `AAPL.US` |
└ stock_name | string | Required | Stock name |
└ market | string | Required | Market |
└ status | string | Required | Grid order status |
└ grid_status | string | Required | Grid running status |
└ submitted_base_price | string | Required | Submitted base price the grid is anchored to |
└ current_base_price | string | Required | Current base price |
└ pre_trigger_base_price | string | Required | Base price before the last trigger |
└ post_trigger_base_price | string | Required | Base price after the last trigger |
└ upper_limit_price | string | Required | Upper price bound |
└ lower_limit_price | string | Required | Lower price bound |
└ trigger_price_type | int32 | Required | Trigger price type. **Enum Value:**, `1` - Spread, `2` - Percent |
└ trigger_spread_up | string | Required | Upward trigger spread, used when `trigger_price_type` is `1` |
└ trigger_spread_down | string | Required | Downward trigger spread, used when `trigger_price_type` is `1` |
└ trigger_percent_up | string | Required | Upward trigger percent, used when `trigger_price_type` is `2` |
└ trigger_percent_down | string | Required | Downward trigger percent, used when `trigger_price_type` is `2` |
└ pullback_percent | string | Required | Pullback percent |
└ pullback_spread | string | Required | Pullback spread |
└ rebound_percent | string | Required | Rebound percent |
└ rebound_spread | string | Required | Rebound spread |
└ trigger_sell_order_type | string | Required | Sell-side grid order type. **Enum Value:**, `GMO` - Grid market order, `GLO` - Grid limit order, `GTG` - Grid touch-to-go |
└ trigger_buy_order_type | string | Required | Buy-side grid order type. **Enum Value:**, `GMO` - Grid market order, `GLO` - Grid limit order, `GTG` - Grid touch-to-go |
└ trigger_sell_depth | int32 | Required | Sell-side order-book depth, range `-5..5`; `0` means use `trigger_sell_order_type` |
└ trigger_buy_depth | int32 | Required | Buy-side order-book depth, range `-5..5`; `0` means use `trigger_buy_order_type` |
└ trigger_quantity | string | Required | Quantity per trigger |
└ trigger_sell_quantity | string | Required | Sell-side trigger quantity |
└ trigger_buy_quantity | string | Required | Buy-side trigger quantity |
└ upper_limit_quantity | string | Required | Quantity handled at the upper bound |
└ lower_limit_quantity | string | Required | Quantity handled at the lower bound |
└ upper_limit_event | int32 | Required | Event when the upper bound is reached. **Enum Value:**, `1` - Ignore (keep grid running), `2` - Close position at last price |
└ lower_limit_event | int32 | Required | Event when the lower bound is reached. **Enum Value:**, `1` - Ignore (keep grid running), `2` - Close position at last price |
└ multiple_trigger | boolean | Required | Whether a single grid level can trigger multiple times |
└ trigger_times | int32 | Required | Number of times the grid has triggered |
└ total_buy_quantity | string | Required | Total bought quantity |
└ total_sell_quantity | string | Required | Total sold quantity |
└ total_profit_balance | string | Required | Total profit balance |
└ settlement_currency | string | Required | Settlement currency |
└ time_in_force | int32 | Required | Time in force type. **Enum Value:**, `0` - Day, `1` - Good-Til-Canceled, `6` - Good-Til-Date |
└ gtd | string | Required | Good-Til-Date expiry date, format: `YYYY-MM-DD` |
└ created_at | string | Required | Creation time, formatted as RFC3339 |
└ rth | int32 | Required | Regular trading hours flag. **Enum Value:**, `0`, `1`, `2` |
└ support_shortsell | boolean | Required | Whether short selling is allowed |
└ grid_order_type_up | string | Required | Sell-side order type when depth is `0`. **Enum Value:**, `GMO` - Grid market order, `GLO` - Grid limit order, `GTG` - Grid touch-to-go |
└ grid_order_type_down | string | Required | Buy-side order type when depth is `0`. **Enum Value:**, `GMO` - Grid market order, `GLO` - Grid limit order, `GTG` - Grid touch-to-go |
has_more | boolean | Required | Whether there are more pages |
Response JSON example
{
"code": 0,
"message": "success",
"data": {
"grid_order": [
{
"order_id": "764609681686573056",
"symbol": "700.HK",
"stock_name": "TENCENT",
"market": "HK",
"status": "Performing",
"grid_status": "Performing",
"submitted_base_price": "300.000",
"current_base_price": "300.000",
"pre_trigger_base_price": "300.000",
"post_trigger_base_price": "306.000",
"upper_limit_price": "360.000",
"lower_limit_price": "240.000",
"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": "",
"trigger_sell_order_type": "GMO",
"trigger_buy_order_type": "GMO",
"trigger_sell_depth": 0,
"trigger_buy_depth": 0,
"trigger_quantity": "100",
"trigger_sell_quantity": "100",
"trigger_buy_quantity": "100",
"upper_limit_quantity": "200",
"lower_limit_quantity": "100",
"upper_limit_event": 1,
"lower_limit_event": 1,
"multiple_trigger": false,
"trigger_times": 3,
"total_buy_quantity": "300",
"total_sell_quantity": "200",
"total_profit_balance": "1250.00",
"settlement_currency": "HKD",
"time_in_force": 1,
"gtd": "",
"created_at": "2025-01-15T09:30:00+08:00",
"rth": 0,
"support_shortsell": false,
"grid_order_type_up": "GMO",
"grid_order_type_down": "GMO"
}
],
"has_more": false
}
}Error code
See the Error Codes page for the full list of error codes.