OPEN-SOURCE SCRIPT
업데이트됨 SD Stochastic RSI Trend

SD Stochastic RSI Trend
SD Stochastic RSI Trend is a trend-following indicator that combines a percentile-based standard deviation filter with a Stochastic RSI momentum confirmation — identifying high-conviction directional moves while keeping exits fast and responsive.
The result is a dynamic line that moves with the market — turning blue when a bullish trend is confirmed and red when bearish, with a fill between the line and price for clear visual trend identification.
How It Works
Two independent systems validate whether a trend change is genuine:
The long condition requires both systems to agree simultaneously. The short condition only requires the SD filter — exits are deliberately faster than entries.
Why This Approach Works
Most trend indicators rely on price position alone to detect direction. SD Stochastic RSI Trend adds a second independent layer — momentum confirmation via Stochastic RSI — ensuring that a long signal only fires when price is statistically above its own median boundary AND momentum is genuinely building. This eliminates weak or noise-driven entries where price crosses a level without real conviction behind it.
The asymmetric design is intentional and reflects the structural reality of markets like crypto. Longs require both conditions — statistical price strength and momentum confirmation. Shorts only require the SD filter — allowing quick exits when the statistical boundary is lost without waiting for momentum to fully confirm.
Settings
How to trade it
Recommended Usage
All signals are confirmed on bar close.
SD Stochastic RSI Trend is a trend-following indicator that combines a percentile-based standard deviation filter with a Stochastic RSI momentum confirmation — identifying high-conviction directional moves while keeping exits fast and responsive.
The result is a dynamic line that moves with the market — turning blue when a bullish trend is confirmed and red when bearish, with a fill between the line and price for clear visual trend identification.
How It Works
Two independent systems validate whether a trend change is genuine:
- Standard Deviation Filter — a percentile median is calculated from a configurable price source. The standard deviation of this median defines an upper statistical boundary. Price must close above this boundary for a long and below it for a short — ensuring only statistically significant moves trigger a signal
- Stochastic RSI — measures where the RSI is relative to its own recent range. K must be above D for a long — confirming that momentum is genuinely building in the bullish direction. The Stochastic RSI is only required for long signals, making short exits faster and more responsive than entries
The long condition requires both systems to agree simultaneously. The short condition only requires the SD filter — exits are deliberately faster than entries.
Why This Approach Works
Most trend indicators rely on price position alone to detect direction. SD Stochastic RSI Trend adds a second independent layer — momentum confirmation via Stochastic RSI — ensuring that a long signal only fires when price is statistically above its own median boundary AND momentum is genuinely building. This eliminates weak or noise-driven entries where price crosses a level without real conviction behind it.
The asymmetric design is intentional and reflects the structural reality of markets like crypto. Longs require both conditions — statistical price strength and momentum confirmation. Shorts only require the SD filter — allowing quick exits when the statistical boundary is lost without waiting for momentum to fully confirm.
Settings
- Median Source — Price source for the percentile median calculation (default: hl2)
- Median Length — Lookback period for the percentile median (default: 62)
- SD Length — Lookback period for the standard deviation calculation (default: 30)
- K — Smoothing period for the Stochastic K line (default: 25)
- D — Smoothing period for the Stochastic D line (default: 8)
- RSI Length — Lookback period for the RSI calculation (default: 9)
- Stochastic Length — Lookback period for the Stochastic calculation (default: 30)
- Use Bar Coloring — Colors bars based on the current trend state (default: true)
- Color Background — Enables background coloring of the chart based on the current state (default: false)
- Background Transparency — Controls the transparency of the background color (default: 85)
How to trade it
- Long — when the line turns blue and sits below price with a blue fill above it, both systems have confirmed a bullish trend. This is the signal to look for long entries or to hold existing long positions
- Short / Cash — when the line turns red and sits above price with a red fill below it, the statistical boundary has been lost. This is the signal to exit longs, move to cash, or look for short entries depending on your strategy
- Avoid trading against the trend — if the line is red do not look for longs, if the line is blue do not look for shorts
Recommended Usage
- Best used on the 1D timeframe for clean and reliable trend identification
- Should not be used alone for trade entries — combine with an additional volume or structural indicator for confirmation
- The asymmetric design makes this indicator particularly well suited for bullish-biased markets like crypto — longs require full confirmation while shorts are fast and decisive
- Higher Stochastic Length values smooth the momentum signal — lower values make it more sensitive to short-term momentum shifts
- Adjust Median Length and SD Length together to control how wide the statistical boundary is — longer values create more stable signals, shorter values make the indicator more reactive
All signals are confirmed on bar close.
릴리즈 노트
Added an optional "Show Cloud" setting under Plot — when disabled the fill between the SD line and price is hidden, showing only the indicator line and bar coloring. Enabled by default.오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.