OPEN-SOURCE SCRIPT
Keltner SD SuperTrend | RakoQuant

Keltner SD SuperTrend by RakoQuant is a structural trend-following system that replaces ATR volatility with Standard Deviation inside a SuperTrend framework.
Instead of using raw range-based expansion, this model measures statistical dispersion around an EMA baseline, producing cleaner volatility envelopes in both compression and expansion phases.
The result is a SuperTrend variant that reacts to true deviation structure, not just candle range.
RakoQuant Architecture
1. EMA Baseline (Structural Mean)
The core baseline is an EMA:
* Provides directional bias
* Anchors volatility expansion
* Serves as slope reference for momentum gating
This keeps the model responsive without being overly reactive.
2. Standard Deviation Volatility (σ Engine)
Instead of ATR, this system uses:
Upper Band = EMA + (Multiplier × StdDev) Lower Band = EMA − (Multiplier × StdDev)
This shifts the logic from range volatility to statistical dispersion.
Key effects:
* Compression phases tighten sharply
* Breakouts emerge from structured contraction
* Noise-based volatility spikes are reduced
* Trend shifts become more statistically defined
3. SuperTrend Trailing Logic
Classic trailing band mechanics are applied:
* Bands trail only in trend direction
* Once flipped, they do not reset until structurally broken
* Regime continuity is maintained
This prevents band “repainting” behavior and keeps state transitions clean.
4. Momentum Gate (Structural Confirmation)
An optional slope-based confirmation layer is included:
Momentum = EMA slope normalized by Standard Deviation
This ensures:
* Flips require directional bias
* Weak breaks in flat conditions are filtered
* Volatility expansion aligns with structural movement
It adds discipline without over-complicating the model.
Signal Model (RakoQuant Regime Logic)
The indicator operates using state-based architecture:
* Bullish Regime when SuperTrend flips upward
* Bearish Regime when SuperTrend flips downward
Flip events are:
* Deterministic
* Backtest-ready
* Alert-enabled
No repainting. No hidden smoothing. Clean state transitions.
Visual System
Keltner SD SuperTrend includes modular visual configuration:
* Multiple palette options (RakoQuant Neon, Classic, Gold/Indigo, Ocean/Coral, Mono)
* Line style control (Line Break default to prevent shelf artifacts)
* Dual-layer glow system
* Optional fill (to mid or to price)
* Optional EMA baseline display
* Candle painting toggle
* Optional UP/DN markers
The default Line Break style avoids the “box shelf” effect common in naive SuperTrend implementations.
Practical Use Cases
Trend Continuation Use flips to capture directional expansion from statistical compression.
Breakout Detection Watch for SD tightening before regime transition.
Volatility Rotation Observe how dispersion expands during strong directional phases.
System Integration Pairs cleanly with:
* Momentum oscillators
* Volume filters
* Higher timeframe bias systems
Design Philosophy (RakoQuant)
This tool reflects the RakoQuant framework:
* Statistical dispersion > raw range volatility
* Structural regime tracking > visual-only overlays
* Deterministic outputs > black-box smoothing
* Strategy-ready architecture
Everything is manual, open-source, and reproducible.
Chart Example

Instead of using raw range-based expansion, this model measures statistical dispersion around an EMA baseline, producing cleaner volatility envelopes in both compression and expansion phases.
The result is a SuperTrend variant that reacts to true deviation structure, not just candle range.
RakoQuant Architecture
1. EMA Baseline (Structural Mean)
The core baseline is an EMA:
* Provides directional bias
* Anchors volatility expansion
* Serves as slope reference for momentum gating
This keeps the model responsive without being overly reactive.
2. Standard Deviation Volatility (σ Engine)
Instead of ATR, this system uses:
Upper Band = EMA + (Multiplier × StdDev) Lower Band = EMA − (Multiplier × StdDev)
This shifts the logic from range volatility to statistical dispersion.
Key effects:
* Compression phases tighten sharply
* Breakouts emerge from structured contraction
* Noise-based volatility spikes are reduced
* Trend shifts become more statistically defined
3. SuperTrend Trailing Logic
Classic trailing band mechanics are applied:
* Bands trail only in trend direction
* Once flipped, they do not reset until structurally broken
* Regime continuity is maintained
This prevents band “repainting” behavior and keeps state transitions clean.
4. Momentum Gate (Structural Confirmation)
An optional slope-based confirmation layer is included:
Momentum = EMA slope normalized by Standard Deviation
This ensures:
* Flips require directional bias
* Weak breaks in flat conditions are filtered
* Volatility expansion aligns with structural movement
It adds discipline without over-complicating the model.
Signal Model (RakoQuant Regime Logic)
The indicator operates using state-based architecture:
* Bullish Regime when SuperTrend flips upward
* Bearish Regime when SuperTrend flips downward
Flip events are:
* Deterministic
* Backtest-ready
* Alert-enabled
No repainting. No hidden smoothing. Clean state transitions.
Visual System
Keltner SD SuperTrend includes modular visual configuration:
* Multiple palette options (RakoQuant Neon, Classic, Gold/Indigo, Ocean/Coral, Mono)
* Line style control (Line Break default to prevent shelf artifacts)
* Dual-layer glow system
* Optional fill (to mid or to price)
* Optional EMA baseline display
* Candle painting toggle
* Optional UP/DN markers
The default Line Break style avoids the “box shelf” effect common in naive SuperTrend implementations.
Practical Use Cases
Trend Continuation Use flips to capture directional expansion from statistical compression.
Breakout Detection Watch for SD tightening before regime transition.
Volatility Rotation Observe how dispersion expands during strong directional phases.
System Integration Pairs cleanly with:
* Momentum oscillators
* Volume filters
* Higher timeframe bias systems
Design Philosophy (RakoQuant)
This tool reflects the RakoQuant framework:
* Statistical dispersion > raw range volatility
* Structural regime tracking > visual-only overlays
* Deterministic outputs > black-box smoothing
* Strategy-ready architecture
Everything is manual, open-source, and reproducible.
Chart Example
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.