定投统计
获取定投统计汇总信息,包括总投入金额和盈亏情况。
SDK Links
Python | longbridge.openapi.DCAContext.stats |
Rust | longbridge::dca::DCAContext#stats |
Go | DCAContext.Stats |
Node.js | DCAContext#stats |
Java | DCAContext.getStats |
C++ | longbridge::dca::DCAContext::stats |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | 否 | 按标的过滤 |
Request Example
Response
Response Example
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"
}
]
}
}Response Status
| Status | Description | Schema |
|---|---|---|
| 200 | 成功 | DcaStats |
| 400 | 请求错误 | None |
Schemas
DcaStatsResponse
| Name | Type | Required | Description |
|---|---|---|---|
| active_count | string | false | 活跃计划数量 |
| finished_count | string | false | 已完成计划数量 |
| suspended_count | string | false | 已暂停计划数量 |
| rest_days | string | false | 距下次扣款天数 |
| total_amount | string | false | 总投入金额 |
| total_profit | string | false | 总盈亏 |
| nearest_plans | object[] | false | 最近即将执行的定投计划(结构与 DcaPlan 一致) |
nearest_plans的子项结构与 查看定投计划 中的DcaPlan一致。

