# 交易串接

## 資金帳號查詢

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

<div align="center"><img src="https://3597972080-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LjshLkSszAVTJikUlPY%2F-LkSmdfkpcyC2R-AQmZp%2F-LkSsks0IFfap_C7pF_b%2Fimage.png?alt=media&#x26;token=528aae6b-cf9c-47f3-915c-d98d1fbb2363" alt=""></div>

<div align="center"><img src="https://3597972080-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LjshLkSszAVTJikUlPY%2F-LkSmdfkpcyC2R-AQmZp%2F-LkSst1n07Qif0U7XCvn%2Fimage.png?alt=media&#x26;token=4310f297-aaf6-41f8-b48d-b1c9054247d8" alt="取得回傳資料"></div>

<div align="center"><img src="https://3597972080-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LjshLkSszAVTJikUlPY%2F-LkSmdfkpcyC2R-AQmZp%2F-LkSujbgdrMs8Uc_0Wv6%2Fimage.png?alt=media&#x26;token=368cc5c5-bfef-4f71-b000-fa07b06704bd" alt="回傳值為陣列放在字典內，所以要補一個[0]取得第一筆詳細帳戶資料"></div>

## 資金帳號遮罩

<div align="center"><img src="https://3597972080-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LjshLkSszAVTJikUlPY%2F-LkSmdfkpcyC2R-AQmZp%2F-LkSv-0kTy0oFHGdsozz%2Fimage.png?alt=media&#x26;token=6ed7ce38-dd92-4f92-888a-e1919c33266e" alt=""></div>

<div align="center"><img src="https://3597972080-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LjshLkSszAVTJikUlPY%2F-LkSmdfkpcyC2R-AQmZp%2F-LkSvB7bNFAs2boljO0m%2Fimage.png?alt=media&#x26;token=1ae4a972-5cd8-4465-aa14-e9482b1149d3" alt="建立資金帳戶遮罩"></div>

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

<div align="center"><img src="https://3597972080-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LjshLkSszAVTJikUlPY%2F-LkSmdfkpcyC2R-AQmZp%2F-LkT-eroI9DqGVe3_-Vy%2Fimage.png?alt=media&#x26;token=dd63d216-47d9-435c-88dc-3bd84708528d" alt=""></div>

<div align="center"><img src="https://3597972080-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LjshLkSszAVTJikUlPY%2F-LkSmdfkpcyC2R-AQmZp%2F-LkT-nzFCGEg8YkNZStZ%2Fimage.png?alt=media&#x26;token=003b1087-a166-4722-aff9-6c9935a598a2" alt=""></div>

## 部位查詢

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

<div align="center"><img src="https://3597972080-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LjshLkSszAVTJikUlPY%2F-LkSmdfkpcyC2R-AQmZp%2F-LkT0stLNta6KyZdnVQm%2Fimage.png?alt=media&#x26;token=2ef9fd21-50dc-498a-ad8b-ea2c6687efb6" alt=""></div>

<div align="center"><img src="https://3597972080-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LjshLkSszAVTJikUlPY%2F-LkSmdfkpcyC2R-AQmZp%2F-LkT1rl01EkARAXwoBpI%2Fimage.png?alt=media&#x26;token=1e684e1e-79f4-41c5-ba40-0cb7cf85db4c" alt=""></div>
