PROTECTED SOURCE SCRIPT
配對交易waynecoin製作2_回歸零即止盈

進場:兩個幣價差大幅偏離平均值(超過設定標準差),認為出現「極端偏差」,所以進行配對交易
出場:只要 zScore 回到 0,即「兩幣回歸均值關係」,立刻平倉
冷卻機制:每次出場後,必須經過設定的K線數才能再次進場,有效減少過度頻繁交易
這種回歸0止盈法的優點
減少來回掃損:避免只在邊界平倉(如 zScore 回到 1),能抓到更大一段的均值回歸
簡單直觀:規則容易判斷,不需要額外判斷趨勢或震盪
適合盤整行情:這種策略在橫盤或均值回歸明顯的市場表現較好
需搭配wayncoin製作2來使用,因為腳本原因他一次只能單筆持倉,所以相比較wayncoin製作2會遺漏一些信號,但可以這版本的離場信號做為離場,在該跟k線收盤後出現離場信號在做離場
Entry: When the price spread between the two coins deviates significantly from the mean (exceeds the set standard deviation), this is considered an "extreme deviation," so a pairs trade is initiated.
Exit: As soon as the zScore returns to 0—meaning the price relationship between the two coins has reverted to the mean—the position is closed immediately.
Cooldown mechanism: After each exit, a specified number of candlesticks must pass before a new entry is allowed, effectively reducing over-trading.
Advantages of the “exit at zScore=0” method:
Reduces whipsaw losses: By avoiding exits at just the boundaries (e.g., zScore returning to 1), it can capture a larger portion of the mean reversion move.
Simple and intuitive: The rules are easy to follow, without needing to judge additional trends or market regimes.
Well-suited to ranging markets: This strategy performs better in sideways or clearly mean-reverting markets.
Note:
This method should be used together with “waynecoin version 2.” Due to script limitations, it only allows one position at a time, so compared to waynecoin version 2, some signals may be missed. However, you can use the exit signals from this version to close positions—when an exit signal appears after the close of the corresponding candlestick, close the position.
出場:只要 zScore 回到 0,即「兩幣回歸均值關係」,立刻平倉
冷卻機制:每次出場後,必須經過設定的K線數才能再次進場,有效減少過度頻繁交易
這種回歸0止盈法的優點
減少來回掃損:避免只在邊界平倉(如 zScore 回到 1),能抓到更大一段的均值回歸
簡單直觀:規則容易判斷,不需要額外判斷趨勢或震盪
適合盤整行情:這種策略在橫盤或均值回歸明顯的市場表現較好
需搭配wayncoin製作2來使用,因為腳本原因他一次只能單筆持倉,所以相比較wayncoin製作2會遺漏一些信號,但可以這版本的離場信號做為離場,在該跟k線收盤後出現離場信號在做離場
Entry: When the price spread between the two coins deviates significantly from the mean (exceeds the set standard deviation), this is considered an "extreme deviation," so a pairs trade is initiated.
Exit: As soon as the zScore returns to 0—meaning the price relationship between the two coins has reverted to the mean—the position is closed immediately.
Cooldown mechanism: After each exit, a specified number of candlesticks must pass before a new entry is allowed, effectively reducing over-trading.
Advantages of the “exit at zScore=0” method:
Reduces whipsaw losses: By avoiding exits at just the boundaries (e.g., zScore returning to 1), it can capture a larger portion of the mean reversion move.
Simple and intuitive: The rules are easy to follow, without needing to judge additional trends or market regimes.
Well-suited to ranging markets: This strategy performs better in sideways or clearly mean-reverting markets.
Note:
This method should be used together with “waynecoin version 2.” Due to script limitations, it only allows one position at a time, so compared to waynecoin version 2, some signals may be missed. However, you can use the exit signals from this version to close positions—when an exit signal appears after the close of the corresponding candlestick, close the position.
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。