> For the complete documentation index, see [llms.txt](https://touchance-1.gitbook.io/touchance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://touchance-1.gitbook.io/touchance/multicharts/jia-zhi-han-shu/mcextendquote/gethistick.md).

# GetHisTick

## 語法

```
GetHisTick(Data_Type,Symbol_Name,Field_Date,Field_Time);
```

## 範例

列印商品 CME.GC HOT 的報價資訊

```
once cleardebug;

// bid
value1 = GetHisTick( 1, "CME.GC HOT", date, time_s);

// ask
value2 = GetHisTick( 2, "CME.GC HOT", date, time_s);

// last
value3 = GetHisTick( 3, "CME.GC HOT", date, time_s);

// qty
value4 = GetHisTick( 4, "CME.GC HOT", date, time_s);

// vol
value5 = GetHisTick( 5, "CME.GC HOT", date, time_s);

print(D,"	",t,",	bid=",value1,",	ask=",value2,",	last=",value3,",	qty=",value4,",	volume=",value5,NewLine);


```

輸出結果

```
1200214.00	1300.00,	bid=1577.50,	ask=1577.60,	last=1577.60,	qty=   1.00,	volume=36223.00

1200214.00	1400.00,	bid=1577.90,	ask=1578.00,	last=1578.00,	qty=   1.00,	volume=39177.00

1200214.00	1500.00,	bid=1578.20,	ask=1578.30,	last=1578.30,	qty=   3.00,	volume=42834.00

1200214.00	1600.00,	bid=1578.30,	ask=1578.40,	last=1578.40,	qty=   1.00,	volume=49019.00

1200214.00	1700.00,	bid=1578.50,	ask=1578.70,	last=1578.60,	qty=   2.00,	volume=55125.00

1200214.00	1800.00,	bid=1578.70,	ask=1578.90,	last=1578.80,	qty=   1.00,	volume=55279.00
```

## **參數**

| **名稱**       | **類型** | **說明**                 |
| ------------ | ------ | ---------------------- |
| Data\_Type   | 數值型    | 獲取價量資訊                 |
|              |        | 價格：1：買一價, 2：賣一價, 3：成交價 |
|              |        | 量：4：成交量, 5：累積成交量       |
| Symbol\_NAME | 字串型    | 商品合約代號，如”CME.GC HOT”   |
| Field\_Date  | 數值型    | 查詢日期，如 1200114。        |
| Field\_Time  | 數值型    | 獲取報價的時間精確到秒，如145900    |

{% hint style="warning" %}
僅限歷史報價獲取，無即時資料。
{% endhint %}
