OPEN-SOURCE SCRIPT

Dual RSI Spread Strategy [Custom]

106
[中文描述]
概述
这是一个综合性的动量交易工具,结合了双重 RSI 交叉系统与经典 RSI 背离检测功能。该指标旨在通过分析短期与长期动量的“剪刀差”来识别潜在的超买/超卖区域,并辅以顶底背离信号作为反转确认。

核心功能与逻辑

1. 双重 RSI 差值信号 (Dual RSI Spread) 该策略同时计算两条 RSI 曲线:

短周期 RSI (默认 13):对价格变化反应灵敏。

长周期 RSI (默认 42):代表长期趋势基准。

交易信号基于两条 RSI 的差值 (Spread) 生成,逻辑如下:

🟢 买入信号 (Buy):当 长周期 RSI - 短周期 RSI > 20。这意味着短期动量严重低于长期基准,市场可能处于深度超卖状态,存在均值回归需求。

🔴 卖出信号 (Sell):当 短周期 RSI - 长周期 RSI > 20。这意味着短期动量冲高过快,远超长期基准,市场可能过热。

2. RSI 顶底背离 (Divergence) 指标内置了经典的背离检测算法(可选择开启/关闭),应用于短周期 RSI:

Bullish Divergence (看涨背离):价格创新低,但 RSI 底部抬高。

Bearish Divergence (看跌背离):价格创新高,但 RSI 顶部降低。 (注意:背离功能默认关闭,请在设置中勾选 "Calculate Divergence" 开启)

3. 高度自定义

支持自定义 RSI 长度、平滑类型 (SMA/EMA) 及平滑长度。

支持自定义差值阈值(默认 20)。

完整的告警支持:可分别为差值信号和背离信号设置 TradingView 告警。

如何使用 建议将“差值信号”作为预警,结合“背离信号”作为确认。当出现“买入”标签且随后出现 Bullish 背离时,胜率通常更高。



[English Description]
Overview
This is a comprehensive momentum trading tool that combines a Dual RSI Cross System with Classic RSI Divergence Detection. It is designed to identify potential overbought/oversold conditions by analyzing the "spread" between short-term and long-term momentum, reinforced by divergence signals for reversal confirmation.

Key Features & Logic

1. Dual RSI Spread Signals The script calculates two RSI lines simultaneously:

Short RSI (Default 13): Sensitive to immediate price changes.

Long RSI (Default 42): Represents the longer-term baseline.

Trading signals are generated based on the Spread (Difference) between these two lines:

🟢 BUY Signal: Triggers when Long RSI - Short RSI > 20. This implies short-term momentum is significantly below the long-term baseline, suggesting a deep oversold condition and potential mean reversion.

🔴 SELL Signal: Triggers when Short RSI - Long RSI > 20. This implies short-term momentum has spiked too far above the baseline, suggesting an overheated market.

2. RSI Divergence The indicator includes a built-in divergence detection algorithm (optional) applied to the Short RSI:

Bullish Divergence: Price makes a lower low, but RSI makes a higher low.

Bearish Divergence: Price makes a higher high, but RSI makes a lower high. (Note: Divergence is disabled by default. Please check "Calculate Divergence" in the settings to enable).

3. Fully Customizable

Configurable RSI lengths, Smoothing types (SMA/EMA), and Smoothing lengths.

Adjustable Spread Threshold (Default is 20).

Full Alert Support: Set alerts specifically for Spread Signals or Divergence detections.

How to Use It is recommended to use the "Spread Signals" as an early warning system and the "Divergence Signals" as confirmation. A setup where a "BUY" spread label is followed by a Bullish Divergence line often presents a higher probability trade.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.