# 價差還原 Back-Adjustment

## 價差還原計算方式

### 結算日計算新、舊合約收盤價價差，將價差補上舊合約歷史資料的開、高、低、收。

#### 一般連續月合約 ( HOT )，以結算日收盤時計算價差。

| FITX 2206 收盤價 ( 6/15 13:30 ) | 16062 |
| ---------------------------- | ----- |
| FITX 2207 收盤價 ( 6/15 13:45 ) | 15546 |
| 價差                           | -516  |
| 價差還原後收盤價                     | 15546 |

&#x20;

#### 自定連續月合約，以使用者自定的結算日、結算時間，收盤時計算價差。

自定連續月合約設定為 6/14 13:45 切換合約。

| FITX 2206 收盤價 ( 6/14 13:45 ) | 16055 |
| ---------------------------- | ----- |
| FITX 2207 收盤價 ( 6/14 13:45 ) | 15597 |
| 價差                           | -458  |
| 價差還原後收盤價                     | 15597 |

## 代碼規則

連續月合約代碼前面加上「Q」，即可取得價差還原的商品。\
以台指期為例，連續月代碼為TWF.FITX HOT，價差還原代碼設定為「Q.TWF.FITX HOT」。\
自定連續月代碼為TC.F.TWF.FITX.HOT\_FITX，價差還原代碼設定為「Q.TWF.FITX HOT\_FITX」。

{% content-ref url="/pages/lSr2LImmxnLAUJQN6J0N" %}
[自定連續月](/touchance/multicharts/zi-ding-lian-xu-yue.md)
{% endcontent-ref %}

## 建立商品

從 QuoteManager依照代碼規則新增自定商品。

![](/files/Ty3TskzU7KLqsJvCy6Nw)

## 價差還原前後差異

上方是一般連續月商品，換月後明顯有一大段跳空價差。\
下方為價差還原後的商品，將新舊合約之間的價差還原，補正跳空造成的回測計算失真。

![](/files/QtMdoUNnpigYTZ0Q9JOV)


---

# 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/multicharts/jia-zhi-han-shu/jia-cha-huan-yuan-backadjustment.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.
