OPEN-SOURCE SCRIPT
DEMA Volatility SuperTrend | RakoQuant

DEMA Volatility SuperTrend is a clean trend-regime indicator built for volatile markets such as crypto.
It combines a Double Exponential Moving Average (DEMA) baseline with a standard deviation volatility envelope, then applies classic SuperTrend trailing logic to produce persistent bullish and bearish regimes.
This tool is designed for traders who want a smooth but responsive trend structure without relying on ATR alone.
Core Concept
This indicator answers one simple question:
Are we currently in a bullish trend regime or a bearish trend regime?
It does this by building a dynamic volatility corridor around a DEMA baseline and flipping only when price breaks beyond the active band.
How It Works
1. DEMA Baseline (fast + low lag)
A DEMA is used instead of a normal EMA to reduce lag while maintaining smooth trend behavior.
2. Volatility Engine (Standard Deviation)
Volatility bands are created using:
Raw Source Volatility
Classic standard deviation behavior
Residual vs Baseline Volatility
Measures deviations from the DEMA baseline for cleaner regime detection
Band formula:
Upper Band = baseline + multiplier × stdev
Lower Band = baseline − multiplier × stdev
3. SuperTrend Trailing Regime Logic
Instead of flipping every touch, the bands trail using SuperTrend persistence rules:
Bull regime → active lower band acts as support
Bear regime → active upper band acts as resistance
Flips occur only when price breaks beyond the trailing band.
Visual System
Bull regime: Ice-Blue active band
Bear regime: Violet active band
Optional faint inactive bands provide structure
Optional fill highlights the active regime corridor
Optional candle painting matches the regime state instantly
Alerts Included
Bull Flip Alert → regime turns bullish
Bear Flip Alert → regime turns bearish
Perfect for automation or regime-based filtering.
How to Use
✅ Trend filter for swing trading
✅ Regime confirmation layer for systems
✅ Works best on higher timeframes (4H / 1D)
✅ Combine with momentum or breakout triggers for entries
Inputs Summary
DEMA Length → baseline responsiveness
Volatility Length + Multiplier → band width + sensitivity
Volatility Mode → raw vs residual volatility
Flip Source → Close or HL2 for regime switching
Visual toggles → fill, candles, inactive rails
Screenshot Placement
📸 Example chart / screenshot:
Tip: show one bullish flip + one bearish flip with candle painting enabled.
It combines a Double Exponential Moving Average (DEMA) baseline with a standard deviation volatility envelope, then applies classic SuperTrend trailing logic to produce persistent bullish and bearish regimes.
This tool is designed for traders who want a smooth but responsive trend structure without relying on ATR alone.
Core Concept
This indicator answers one simple question:
Are we currently in a bullish trend regime or a bearish trend regime?
It does this by building a dynamic volatility corridor around a DEMA baseline and flipping only when price breaks beyond the active band.
How It Works
1. DEMA Baseline (fast + low lag)
A DEMA is used instead of a normal EMA to reduce lag while maintaining smooth trend behavior.
2. Volatility Engine (Standard Deviation)
Volatility bands are created using:
Raw Source Volatility
Classic standard deviation behavior
Residual vs Baseline Volatility
Measures deviations from the DEMA baseline for cleaner regime detection
Band formula:
Upper Band = baseline + multiplier × stdev
Lower Band = baseline − multiplier × stdev
3. SuperTrend Trailing Regime Logic
Instead of flipping every touch, the bands trail using SuperTrend persistence rules:
Bull regime → active lower band acts as support
Bear regime → active upper band acts as resistance
Flips occur only when price breaks beyond the trailing band.
Visual System
Bull regime: Ice-Blue active band
Bear regime: Violet active band
Optional faint inactive bands provide structure
Optional fill highlights the active regime corridor
Optional candle painting matches the regime state instantly
Alerts Included
Bull Flip Alert → regime turns bullish
Bear Flip Alert → regime turns bearish
Perfect for automation or regime-based filtering.
How to Use
✅ Trend filter for swing trading
✅ Regime confirmation layer for systems
✅ Works best on higher timeframes (4H / 1D)
✅ Combine with momentum or breakout triggers for entries
Inputs Summary
DEMA Length → baseline responsiveness
Volatility Length + Multiplier → band width + sensitivity
Volatility Mode → raw vs residual volatility
Flip Source → Close or HL2 for regime switching
Visual toggles → fill, candles, inactive rails
Screenshot Placement
📸 Example chart / screenshot:
Tip: show one bullish flip + one bearish flip with candle painting enabled.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.