> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tqx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 貨幣資料

> 取得 TQX 投研流程使用的貨幣換算資料。

## 取得貨幣資料

### 方法名稱：get\_currency

### 入參

| 欄位          | 類型                                 | 說明                 | 是否必填 |
| :---------- | :--------------------------------- | :----------------- | :--- |
| start\_date | Optional\[str]                     | 開始日期,eg:"20250702" | 非必填  |
| end\_date   | Optional\[str]                     | 結束日期,eg:"20250702" | 非必填  |
| fields      | Optional\[Union\[str, List\[str]]] | 匯率清單               | 非必填  |

### 回應參數

| 字段       | 類型     | 描述     |
| :------- | :----- | :----- |
| date     | str    | 日期     |
| CNY\_HKD | double | 人民幣對港幣 |
| CNY\_USD | double | 人民幣對美元 |
| HKD\_USD | double | 港幣對美元  |
| HKD\_CNY | double | 港幣對人民幣 |
| USD\_CNY | double | 美元對人民幣 |
| USD\_HKD | double | 美元對港幣  |

### 使用範例

#### 取得單一港股的部分回測因子

```python theme={null}
import tqx_data
result = tqx_data.get_currency(
    start_date="20260101",
    end_date="20260131",
    field=[],
)
print(result)
```
