交易

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

錯誤碼

參見錯誤碼文檔。