账户
鉴权
签名方式:每个请求用 App Key / Secret 签名。请求头如下:
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
Authorization | string · header | 必填 | OpenAPI 后台 上的账户 Access Token,作为原始 token 传入(不带 Bearer 前缀),并参与签名计算。 |
X-Api-Key | string · header | 必填 | 你的 App Key。 |
X-Timestamp | string · header | 必填 | 请求时间戳,单位秒(Unix 时间)。 |
X-Api-Signature | string · header | 必填 | HMAC-SHA256 签名。格式:HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=。 |
仅支持 Longbridge 香港 / 新加坡账户
此方法仅支持 Longbridge 香港 / 新加坡账户,可操作任意标的,包括美股。
获取定投统计汇总信息,包括总投入金额和盈亏情况。
请求
查询参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
symbol | string | 可选 | 按标的代码筛选统计。 |
响应
响应字段
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
active_count | string | 可选 | 活跃计划数量 |
finished_count | string | 可选 | 已完成计划数量 |
suspended_count | string | 可选 | 已暂停计划数量 |
rest_days | string | 可选 | 距下次扣款天数 |
total_amount | string | 可选 | 总投入金额 |
total_profit | string | 可选 | 总盈亏 |
nearest_plans | object[] | 可选 | 最近即将执行的定投计划(结构与 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"
}
]
}
}错误码
参见错误码文档。