交易

按 ID 查询网格订单

POSThttps://openapi.longbridge.com/v1/gridtrading/list

鉴权

签名方式:每个请求用 App Key / Secret 签名。请求头如下:

名称类型必填说明
Authorizationstring · header必填OpenAPI 后台 上的账户 Access Token,作为原始 token 传入(不带 Bearer 前缀),并参与签名计算。
X-Api-Keystring · header必填你的 App Key。
X-Timestampstring · header必填请求时间戳,单位秒(Unix 时间)。
X-Api-Signaturestring · header必填HMAC-SHA256 签名。格式:HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=。

按 ID 查询指定的网格订单。

>_ CLI
# Query specific grid orders by ID
longbridge grid --ids 764609681686573056 764609681686573057

请求

请求体

名称类型必填说明
order_idsarray必填待查询的网格订单 ID

响应

响应字段

名称类型必填说明
grid_orderobject[]可选网格订单
└ order_idstring必填网格订单 ID
└ symbolstring必填标的代码,使用 `ticker.region` 格式,例如:`AAPL.US`
└ stock_namestring必填标的名称
└ marketstring必填市场
└ statusstring必填网格订单状态
└ grid_statusstring必填网格运行状态
└ submitted_base_pricestring必填网格锚定的提交基准价格
└ current_base_pricestring必填当前基准价格
└ pre_trigger_base_pricestring必填上次触发前的基准价格
└ post_trigger_base_pricestring必填上次触发后的基准价格
└ upper_limit_pricestring必填价格上限
└ lower_limit_pricestring必填价格下限
└ trigger_price_typeint32必填触发价格类型。**Enum Value:**, `1` - 价差,`2` - 百分比
└ trigger_spread_upstring必填向上触发价差,`trigger_price_type` 为 `1` 时使用
└ trigger_spread_downstring必填向下触发价差,`trigger_price_type` 为 `1` 时使用
└ trigger_percent_upstring必填向上触发百分比,`trigger_price_type` 为 `2` 时使用
└ trigger_percent_downstring必填向下触发百分比,`trigger_price_type` 为 `2` 时使用
└ pullback_percentstring必填回调百分比
└ pullback_spreadstring必填回调价差
└ rebound_percentstring必填反弹百分比
└ rebound_spreadstring必填反弹价差
└ trigger_sell_order_typestring必填卖出方网格订单类型。**Enum Value:**, `GMO` - 网格市价单,`GLO` - 网格限价单,`GTG` - 网格触价单
└ trigger_buy_order_typestring必填买入方网格订单类型。**Enum Value:**, `GMO` - 网格市价单,`GLO` - 网格限价单,`GTG` - 网格触价单
└ trigger_sell_depthint32必填卖出方盘口深度,范围 `-5..5`;`0` 表示使用 `trigger_sell_order_type`
└ trigger_buy_depthint32必填买入方盘口深度,范围 `-5..5`;`0` 表示使用 `trigger_buy_order_type`
└ trigger_quantitystring必填每次触发数量
└ trigger_sell_quantitystring必填卖出方触发数量
└ trigger_buy_quantitystring必填买入方触发数量
└ upper_limit_quantitystring必填触及上限时处理的数量
└ lower_limit_quantitystring必填触及下限时处理的数量
└ upper_limit_eventint32必填触及上限时的处理事件。**Enum Value:**, `1` - 忽略(保持网格运行), `2` - 以最新价平仓
└ lower_limit_eventint32必填触及下限时的处理事件。**Enum Value:**, `1` - 忽略(保持网格运行), `2` - 以最新价平仓
└ multiple_triggerboolean必填单个网格档位是否可多次触发
└ trigger_timesint32必填网格已触发次数
└ total_buy_quantitystring必填累计买入数量
└ total_sell_quantitystring必填累计卖出数量
└ total_profit_balancestring必填累计收益余额
└ settlement_currencystring必填结算货币
└ time_in_forceint32必填订单有效期类型。**Enum Value:**, `0` - 当日有效,`1` - 撤单前有效,`6` - 指定日期前有效
└ gtdstring必填指定日期前有效的到期日期,格式:`YYYY-MM-DD`
└ created_atstring必填创建时间,格式为 RFC3339
└ rthint32必填盘中交易时段标识。**Enum Value:**, `0`, `1`, `2`
└ support_shortsellboolean必填是否允许卖空
└ grid_order_type_upstring必填深度为 `0` 时卖出方的订单类型。**Enum Value:**, `GMO` - 网格市价单,`GLO` - 网格限价单,`GTG` - 网格触价单
└ grid_order_type_downstring必填深度为 `0` 时买入方的订单类型。**Enum Value:**, `GMO` - 网格市价单,`GLO` - 网格限价单,`GTG` - 网格触价单

响应 JSON 示例

{
  "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"
      }
    ]
  }
}

错误码

参见错误码文档。