OPEN-SOURCE SCRIPT

DEMA Volatility SuperTrend | RakoQuant

188
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.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。