# 成交明細訂閱

`WS` `push · cmd 104`

> **行情權限要求 · 免費**
> 美股：預設免費贈送 US LV1 實時行情（近 1000 筆，含盤前、盤中、盤後、夜盤全時段）。
> 港股：預設贈送 LV1 實時行情（近 1000 筆）。
> 美股期權：預設無權限，需購買「OPRA 美股期權行情 (OpenAPI)」行情卡，最多可獲取近 1000 筆。
> _OpenAPI 行情權限獨立於 App/Web 行情權限_

訂閱的標的的實時逐筆成交明細推送。

```protobuf
message PushTrade {
  string symbol = 1;
  int64 sequence = 2;
  repeated Trade trade = 3;
}
```

## Push Fields

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `symbol` | string | No | 標的代碼，例如：AAPL.US |
| `sequence` | int64 | No | 序列號 |
| `trades` | object[] | No | 逐筆明細數據 |
| `└ price` | string | No | 價格 |
| `└ volume` | int64 | No | 成交量 |
| `└ timestamp` | int64 | No | 成交時間 |
| `└ trade_type` | string | No | 交易類型說明 |
| `└ direction` | int32 | No | 交易方向：0 neutral, 1 down, 2 up |
| `└ trade_session` | int32 | No | 交易時段，詳見 TradeSession |

## Response JSON Example

```json
{
  "symbol": "700.HK",
  "sequence": 160808750000000,
  "trade": [
    {
      "price": "158.760",
      "volume": 1,
      "timestamp": 1651103979,
      "trade_type": "I",
      "direction": 0,
      "trade_session": 2
    }
  ]
}
```
