# 移動停損追蹤

圖表交易的出場允許自訂函數來進行出場的設置，我們可以在 @QB\_Custum\_Position\_Control 中來進行自己喜好的移動停損追蹤模式\
\
在@QB\_Custum\_Position\_Control 找中到trailingstoptrack=Average(close,TSMPeriod);這一行，目前預設為使用簡單移動平均線進行移動停損追蹤\
\
亦可以使用其他方式，例如多單使用近期高點的拉回點數進行追蹤，我們只需要把原本的\
trailingstoptrack=Average(close,TSMPeriod);\
改成\
if marketposition>0 then trailingstoptrack=Highest(high,N) - 拉回點數;\
即可


---

# 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://yuting0103.gitbook.io/quantbrains/tu-biao-jiao-yi-qb-ping-tai/yi-dong-ting-sun-zhui-zong.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.
