OPEN-SOURCE SCRIPT
업데이트됨 Spectre

SPECTRE - Precision Reversal Detection System
OVERVIEW
Spectre is a channel breakout indicator designed to identify high-probability reversal points by combining Donchian channel breaches with momentum confirmation. It generates BUY signals at oversold extremes and SELL signals at overbought extremes, filtered by trend strength to avoid low-conviction setups.
This indicator replaces the Regime Engine, which will continue to evolve independently as an experimental platform for testing new strategies and enhancements. Spectre was selected as the production replacement based on extensive backtesting across multiple assets and timeframes, which demonstrated superior win rates compared to alternative sell logic approaches (RSI-based exits outperformed CMO-based exits in 13 of 18 test configurations).
SIGNAL LOGIC
BUY CONDITIONS (all must be true):
Price touches or breaks below Donchian lower band
RSI is at or below oversold threshold (default: 35)
ADX confirms sufficient trend strength (default: ≥22)
BBWP confirms adequate volatility (default: ≥20%)
Cooldown period has elapsed since last buy
Cascade limit not reached
SELL CONDITIONS (all must be true):
Price touches or breaks above Donchian upper band
RSI is at or above overbought threshold (default: 70)
ADX confirms sufficient trend strength (default: ≥22)
BBWP confirms adequate volatility (default: ≥20%)
Cooldown period has elapsed since last sell
Cascade limit not reached
Price is not underwater (if protection enabled)
KEY FEATURES
NON-REPAINTING DONCHIAN CHANNELS
Uses previous bar's high/low extremes to prevent signal repainting. What you see in history is what you would have seen in real-time.
MULTI-FACTOR CONFIRMATION
Signals require agreement between price action (Donchian), momentum (RSI), and trend strength (ADX) to filter out low-quality setups.
VOLATILITY FILTER (BBWP)
Bollinger Band Width Percentile measures current volatility relative to historical norms. Low BBWP indicates compressed ranges where breakouts are less reliable - signals are blocked until volatility returns.
CASCADE PROTECTION
Limits consecutive signals in the same direction to prevent overexposure during extended trends. Resets when a signal fires in the opposite direction.
UNDERWATER PROTECTION (Unique to Spectre)
Tracks average entry price of recent buys and blocks sell signals when price has fallen significantly below this level. This prevents locking in large losses during drawdowns and allows positions to recover before exiting.
REGIME DETECTION
Visual background shading indicates current market regime based on Directional Indicator spread and On-Balance Volume trend. Green indicates bullish regime (+DI > -DI, OBV rising). Red indicates bearish regime (-DI > +DI, OBV falling). White/Gray indicates neutral or ranging conditions.
RECOMMENDED SETTINGS BY TIMEFRAME
For 5-minute charts, use RSI Buy 30-35, RSI Sell 70-75, ADX 20-24.
For 15-minute charts, use RSI Buy 30-35, RSI Sell 68-72, ADX 22-26.
For 30-minute charts (default), use RSI Buy 32-38, RSI Sell 68-72, ADX 22-26.
For 1-hour charts, use RSI Buy 35-40, RSI Sell 65-70, ADX 20-24.
For 4-hour charts, use RSI Buy 35-40, RSI Sell 65-70, ADX 18-22.
These are starting points - optimize for your specific assets.
INFO PANEL GUIDE
Regime shows current market bias (Bullish/Bearish/Neutral). RSI shows current value with buy/sell threshold status. ADX shows trend strength categorized as Weak (<15), Range (15-24), Trend (24-34), or Strong (>34). BBWP shows volatility percentile with a warning symbol when below minimum. Donchian shows price position relative to channel bands. Avg Buy shows average entry price and underwater status. Cascade shows current consecutive signal counts versus limits.
USAGE TIPS
Works best in ranging or mean-reverting markets
Reduce RSI thresholds in strong trends (tighter = fewer signals)
Increase ADX minimum in choppy markets to filter noise
Enable underwater protection for swing trading, disable for scalping
Use regime background to contextualize signals (buy in green, sell in red)
Combine with support/resistance levels for additional confirmation
OVERVIEW
Spectre is a channel breakout indicator designed to identify high-probability reversal points by combining Donchian channel breaches with momentum confirmation. It generates BUY signals at oversold extremes and SELL signals at overbought extremes, filtered by trend strength to avoid low-conviction setups.
This indicator replaces the Regime Engine, which will continue to evolve independently as an experimental platform for testing new strategies and enhancements. Spectre was selected as the production replacement based on extensive backtesting across multiple assets and timeframes, which demonstrated superior win rates compared to alternative sell logic approaches (RSI-based exits outperformed CMO-based exits in 13 of 18 test configurations).
SIGNAL LOGIC
BUY CONDITIONS (all must be true):
Price touches or breaks below Donchian lower band
RSI is at or below oversold threshold (default: 35)
ADX confirms sufficient trend strength (default: ≥22)
BBWP confirms adequate volatility (default: ≥20%)
Cooldown period has elapsed since last buy
Cascade limit not reached
SELL CONDITIONS (all must be true):
Price touches or breaks above Donchian upper band
RSI is at or above overbought threshold (default: 70)
ADX confirms sufficient trend strength (default: ≥22)
BBWP confirms adequate volatility (default: ≥20%)
Cooldown period has elapsed since last sell
Cascade limit not reached
Price is not underwater (if protection enabled)
KEY FEATURES
NON-REPAINTING DONCHIAN CHANNELS
Uses previous bar's high/low extremes to prevent signal repainting. What you see in history is what you would have seen in real-time.
MULTI-FACTOR CONFIRMATION
Signals require agreement between price action (Donchian), momentum (RSI), and trend strength (ADX) to filter out low-quality setups.
VOLATILITY FILTER (BBWP)
Bollinger Band Width Percentile measures current volatility relative to historical norms. Low BBWP indicates compressed ranges where breakouts are less reliable - signals are blocked until volatility returns.
CASCADE PROTECTION
Limits consecutive signals in the same direction to prevent overexposure during extended trends. Resets when a signal fires in the opposite direction.
UNDERWATER PROTECTION (Unique to Spectre)
Tracks average entry price of recent buys and blocks sell signals when price has fallen significantly below this level. This prevents locking in large losses during drawdowns and allows positions to recover before exiting.
REGIME DETECTION
Visual background shading indicates current market regime based on Directional Indicator spread and On-Balance Volume trend. Green indicates bullish regime (+DI > -DI, OBV rising). Red indicates bearish regime (-DI > +DI, OBV falling). White/Gray indicates neutral or ranging conditions.
RECOMMENDED SETTINGS BY TIMEFRAME
For 5-minute charts, use RSI Buy 30-35, RSI Sell 70-75, ADX 20-24.
For 15-minute charts, use RSI Buy 30-35, RSI Sell 68-72, ADX 22-26.
For 30-minute charts (default), use RSI Buy 32-38, RSI Sell 68-72, ADX 22-26.
For 1-hour charts, use RSI Buy 35-40, RSI Sell 65-70, ADX 20-24.
For 4-hour charts, use RSI Buy 35-40, RSI Sell 65-70, ADX 18-22.
These are starting points - optimize for your specific assets.
INFO PANEL GUIDE
Regime shows current market bias (Bullish/Bearish/Neutral). RSI shows current value with buy/sell threshold status. ADX shows trend strength categorized as Weak (<15), Range (15-24), Trend (24-34), or Strong (>34). BBWP shows volatility percentile with a warning symbol when below minimum. Donchian shows price position relative to channel bands. Avg Buy shows average entry price and underwater status. Cascade shows current consecutive signal counts versus limits.
USAGE TIPS
Works best in ranging or mean-reverting markets
Reduce RSI thresholds in strong trends (tighter = fewer signals)
Increase ADX minimum in choppy markets to filter noise
Enable underwater protection for swing trading, disable for scalping
Use regime background to contextualize signals (buy in green, sell in red)
Combine with support/resistance levels for additional confirmation
릴리즈 노트
Changed BBWP parameters to favor 5 and 15 min trades. Configurable in settings오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.