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.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。