OPEN-SOURCE SCRIPT
SWMA Momentum SuperTrend | RakoQuant

SWMA Momentum SuperTrend by RakoQuant is a regime-aware trend system built on a Symmetrically Weighted Moving Average (SWMA) baseline, enhanced with momentum normalization and adaptive SuperTrend trailing logic.
Unlike traditional SuperTrend models that rely on raw EMA or simple smoothing, this version introduces:
* SWMA structural baseline
* ATR volatility envelopes
* Momentum gating logic
* Intraday smoothing filters
* Multi-mode parameter presets
The result is a SuperTrend variant designed to reduce noise while preserving structural transitions.
RakoQuant Architecture
1. SWMA Baseline (Symmetric Structure)
The baseline begins with:
SWMA → EMA smoothing layer
This dual-stage structure provides:
* Symmetric weighting (less directional bias than EMA alone)
* Reduced micro-volatility noise
* More balanced turning behavior
The SWMA core produces smoother curvature compared to single-pass EMA systems.
2. ATR Volatility Engine
Volatility bands are built using:
Upper Band = Baseline + (Factor × ATR) Lower Band = Baseline − (Factor × ATR)
Classic SuperTrend trailing logic is then applied to maintain:
* Regime continuity
* Non-repainting trailing structure
* Deterministic flip behavior
3. Momentum Gate (Normalized Bias Filter)
This is where the tool becomes distinctly RakoQuant.
Momentum is calculated as:
Baseline slope normalized by ATR
Then passed through a configurable gating system:
* Low gate = aggressive flipping
* High gate = strict confirmation
* 0 = no filter
This prevents:
* Weak volatility spikes from triggering flips
* Flat market oscillations
* Low-energy false transitions
Momentum alignment becomes required before regime change.
4. Mode Presets (Structural Adaptability)
Three operating modes are built in:
* Daily / Swing
* Intraday
* Custom
Each mode adjusts:
* SWMA smoothing
* ATR length
* Multiplier factor
* Momentum lookback
This makes the tool adaptable across timeframes without manual retuning.
Signal Model (RakoQuant Regime Logic)
The system operates using directional state:
* Bullish Regime when SuperTrend flips upward (dir < 0)
* Bearish Regime when SuperTrend flips downward (dir > 0)
Flip events are:
* Non-repainting
* Confirmed on candle close
* Alert-enabled
* Strategy-ready
Optional label markers and signal toggles allow clean backtesting.
Visual System
SWMA Momentum SuperTrend includes modular configuration:
* Multiple palettes (RakoQuant Neon, Classic, Gold/Indigo, Ocean/Coral, Mono)
* Line style options (Line Break default for smooth transitions)
* Glow layer control
* Optional baseline display
* Fill modes (to mid or to price)
* Candle painting toggle
* Flip marker toggle
The visual structure is built for clarity, not decoration.
Practical Use Cases
Trend Continuation Use momentum-gated flips to capture structured volatility expansion.
Intraday Regime Control Apply smoothing filter in lower timeframes to reduce chop.
Swing Trading Use Daily / Swing mode for broader structural alignment.
System Integration Works well alongside:
* Volume confirmation tools
* Higher timeframe bias
* Volatility compression systems
Design Philosophy (RakoQuant)
This tool reflects the RakoQuant principles:
* Structural symmetry over naive smoothing
* Volatility context over static envelopes
* Momentum confirmation over blind flipping
* Adaptive presets over rigid parameters
It is fully open-source, deterministic, and backtest-ready.
Chart Example

Unlike traditional SuperTrend models that rely on raw EMA or simple smoothing, this version introduces:
* SWMA structural baseline
* ATR volatility envelopes
* Momentum gating logic
* Intraday smoothing filters
* Multi-mode parameter presets
The result is a SuperTrend variant designed to reduce noise while preserving structural transitions.
RakoQuant Architecture
1. SWMA Baseline (Symmetric Structure)
The baseline begins with:
SWMA → EMA smoothing layer
This dual-stage structure provides:
* Symmetric weighting (less directional bias than EMA alone)
* Reduced micro-volatility noise
* More balanced turning behavior
The SWMA core produces smoother curvature compared to single-pass EMA systems.
2. ATR Volatility Engine
Volatility bands are built using:
Upper Band = Baseline + (Factor × ATR) Lower Band = Baseline − (Factor × ATR)
Classic SuperTrend trailing logic is then applied to maintain:
* Regime continuity
* Non-repainting trailing structure
* Deterministic flip behavior
3. Momentum Gate (Normalized Bias Filter)
This is where the tool becomes distinctly RakoQuant.
Momentum is calculated as:
Baseline slope normalized by ATR
Then passed through a configurable gating system:
* Low gate = aggressive flipping
* High gate = strict confirmation
* 0 = no filter
This prevents:
* Weak volatility spikes from triggering flips
* Flat market oscillations
* Low-energy false transitions
Momentum alignment becomes required before regime change.
4. Mode Presets (Structural Adaptability)
Three operating modes are built in:
* Daily / Swing
* Intraday
* Custom
Each mode adjusts:
* SWMA smoothing
* ATR length
* Multiplier factor
* Momentum lookback
This makes the tool adaptable across timeframes without manual retuning.
Signal Model (RakoQuant Regime Logic)
The system operates using directional state:
* Bullish Regime when SuperTrend flips upward (dir < 0)
* Bearish Regime when SuperTrend flips downward (dir > 0)
Flip events are:
* Non-repainting
* Confirmed on candle close
* Alert-enabled
* Strategy-ready
Optional label markers and signal toggles allow clean backtesting.
Visual System
SWMA Momentum SuperTrend includes modular configuration:
* Multiple palettes (RakoQuant Neon, Classic, Gold/Indigo, Ocean/Coral, Mono)
* Line style options (Line Break default for smooth transitions)
* Glow layer control
* Optional baseline display
* Fill modes (to mid or to price)
* Candle painting toggle
* Flip marker toggle
The visual structure is built for clarity, not decoration.
Practical Use Cases
Trend Continuation Use momentum-gated flips to capture structured volatility expansion.
Intraday Regime Control Apply smoothing filter in lower timeframes to reduce chop.
Swing Trading Use Daily / Swing mode for broader structural alignment.
System Integration Works well alongside:
* Volume confirmation tools
* Higher timeframe bias
* Volatility compression systems
Design Philosophy (RakoQuant)
This tool reflects the RakoQuant principles:
* Structural symmetry over naive smoothing
* Volatility context over static envelopes
* Momentum confirmation over blind flipping
* Adaptive presets over rigid parameters
It is fully open-source, deterministic, and backtest-ready.
Chart Example
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.