# 盈虧分析匯總

`GET` `/v1/portfolio/profit-analysis-summary`

獲取賬戶盈虧匯總，包含總資產、總盈虧和收益率指標。

## Parameters

### Query Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `start_date` | string | No | 分析開始日期，格式 `YYYY-MM-DD` |
| `end_date` | string | No | 分析結束日期，格式 `YYYY-MM-DD` |

## Request Example

```bash
curl --request GET \
  --url 'https://openapi.longbridge.com/v1/portfolio/profit-analysis-summary' \
  --header 'Authorization: Bearer <access_token>'
```

## Response

### Response Properties

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `updated_at` | string | No | 最後更新時間戳 |
| `sum_profit` | string | No | 總盈虧 |
| `sum_profit_rate` | string | No | 總盈虧率 |
| `profits` | object | No | 按類型分解的盈虧 |
| `└ stock` | string | No | 股票基本信息 |
| `└ fund` | string | No | 資金標誌/金額。 |
| `└ mmf` | string | No | 維持保證金系數。 |
| `└ other` | string | No | 其他值/數量。 |
| `└ summary_info` | object[] | No | 摘要信息。 |
| `└ ∟ profit_max` | string | No | 最大盈利金額。 |
| `└ ∟ loss_max` | string | No | 最大虧損金額。 |
| `└ ∟ profit_max_name` | string | No | 最大盈利標的名稱。 |
| `└ ∟ loss_max_name` | string | No | 最大虧損標的名稱。 |
| `└ ∟ asset_type` | string | No | 本組的元素類型（持倉 / 地區 / 資產類別 / 行業） |
| `└ ipo_subscription` | integer | No | IPO 認購次數。 |
| `└ ipo_hit` | integer | No | IPO 中籤次數。 |
| `└ cumulative_transaction_amount` | string | No | 累計成交額。 |
| `└ crypto` | string | No | 加密貨幣標誌。 |
| `└ trade_order_num` | string | No | 交易訂單數。 |
| `└ trade_stock_num` | string | No | 交易標的數。 |
| `is_traded` | boolean | No | 是否有交易紀錄 |
| `currency` | string | No | 貨幣 |
| `total_simple_earning_yield` | string | No | 總簡單收益率。 |
| `total_time_earning_yield` | string | No | 總時間加權收益率。 |
| `invest_amount` | string | No | 總投入金額 |
| `initial_asset_value` | string | No | 初始資產價值 |
| `ending_asset_value` | string | No | 期末資產價值 |
| `current_total_asset` | string | No | 當前總資產 |
| `start_time` | string | No | 統計開始時間戳 |
| `end_time` | string | No | 統計結束時間戳 |
| `trade_update_time` | string | No | 交易數據更新時間。 |
| `updated_date` | string | No | 最後更新日期 |
| `start_date` | string | No | 統計開始日期 |
| `end_date` | string | No | 統計結束日期 |
| `trade_update_date` | string | No | 交易數據更新日期。 |
| `trade_stock_num` | string | No | 交易標的數。 |

### Response JSON Example

```json
{
  "code": 0,
  "message": "success",
  "data": {
    "summary": {
      "currency": "USD",
      "sum_profit": "62905.97",
      "sum_profit_rate": "0.6128",
      "invest_amount": "102659.74",
      "current_total_asset": "165565.71",
      "initial_asset_value": "0.00",
      "ending_asset_value": "165565.71",
      "is_traded": true,
      "start_date": "2025-10-17",
      "start_time": "1760659200",
      "end_date": "2026-05-14",
      "end_time": "1778731947",
      "profits": {
        "stock": "66370.84",
        "crypto": "0",
        "fund": null,
        "ipo": null,
        "mmf": null,
        "other": null,
        "cumulative_transaction_amount": "1244920.28"
      }
    },
    "sublist": {
      "start": "2025-10-17",
      "start_date": "2025-10-17",
      "end": "2026-05-14",
      "end_date": "2026-05-14",
      "updated_at": "1778731947",
      "updated_date": "2026-05-14",
      "items": [
        {
          "symbol": "AAPL.US",
          "name": "Apple",
          "market": "US",
          "currency": "USD",
          "profit": "100.00",
          "profit_rate": "0.05",
          "holding_period": "180",
          "clearance_times": 0,
          "is_holding": true,
          "item_type": "Stock",
          "isin": "",
          "security_code": "AAPL",
          "underlying_profit": "100.00",
          "derivatives_profit": "0.00",
          "order_profit": null
        }
      ]
    }
  }
}
```
