帳戶

定投統計

GEThttps://openapi.longbridge.com/v1/dailycoins/statistic

鑑權

簽名方式:每個請求用 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=。

僅支援 Longbridge 香港 / 新加坡賬戶

此方法僅支援 Longbridge 香港 / 新加坡賬戶,可操作任意標的,包括美股。

獲取定投統計匯總信息,包括總投入金額和盈虧情況。

>_ CLI
longbridge dca stats

請求

查詢參數

名稱類型必填說明
symbolstring可選按標的代碼篩選統計。

響應

響應欄位

名稱類型必填說明
active_countstring可選活躍計劃數量
finished_countstring可選已完成計劃數量
suspended_countstring可選已暫停計劃數量
rest_daysstring可選距下次扣款天數
total_amountstring可選總投入金額
total_profitstring可選總盈虧
nearest_plansobject[]可選最近即將執行的定投計劃(結構與 DcaPlan 一致)

響應 JSON 示例

{
  "code": 0,
  "message": "success",
  "data": {
    "active_count": "2",
    "finished_count": "1",
    "suspended_count": "0",
    "rest_days": "3",
    "total_amount": "5400",
    "total_profit": "120.50",
    "nearest_plans": [
      {
        "plan_id": "1239402174908207104",
        "symbol": "AAPL.US",
        "stock_name": "Apple Inc.",
        "market": "US",
        "status": "Active",
        "per_invest_amount": "100",
        "invest_frequency": "Monthly",
        "invest_day_of_month": "15",
        "next_trd_date": "1778853600",
        "cum_amount": "0",
        "cum_profit": "0"
      }
    ]
  }
}

錯誤碼

參見錯誤碼文檔。