# 交易串接

## 資金帳號查詢

```
account_lookup("XXXXXXXXXXXXXX")
XXXXXXXXXXXXXX→帶入交易連線的SessionKey
```

<div align="center"><img src="/files/-LkSsks0IFfap_C7pF_b" alt=""></div>

<div align="center"><img src="/files/-LkSst1n07Qif0U7XCvn" alt="取得回傳資料"></div>

<div align="center"><img src="/files/-LkSujbgdrMs8Uc_0Wv6" alt="回傳值為陣列放在字典內，所以要補一個[0]取得第一筆詳細帳戶資料"></div>

## 資金帳號遮罩

<div align="center"><img src="/files/-LkSv-0kTy0oFHGdsozz" alt=""></div>

<div align="center"><img src="/files/-LkSvB7bNFAs2boljO0m" alt="建立資金帳戶遮罩"></div>

```
ZMQsystem.margin("XXXXXXXXXXXXXX",AccountMask)
XXXXXXXXXXXXXX→帶入交易連線的SessionKey
提取資金帳戶細節資料
```

<div align="center"><img src="/files/-LkT-eroI9DqGVe3_-Vy" alt=""></div>

<div align="center"><img src="/files/-LkT-nzFCGEg8YkNZStZ" alt=""></div>

## 部位查詢

```
ZMQsystem.position("XXXXXXXXXXXXXX",AccountMask)
XXXXXXXXXXXXXX→帶入交易連線的SessionKey
提取資金帳戶的部位細節資料
```

<div align="center"><img src="/files/-LkT0stLNta6KyZdnVQm" alt=""></div>

<div align="center"><img src="/files/-LkT1rl01EkARAXwoBpI" alt=""></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://touchance-1.gitbook.io/touchance/python-api/jiao-yi-chuan-jie.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
