OPEN-SOURCE SCRIPT

Dual SuperTrend w VIX Filter - Strategy [presentTrading]

794
Hey everyone! Haven't been here for a long time. Been so busy again in the past 2 months. I recently started working on analyzing the combination of trend strategy and VIX, but didn't get outstanding results after a few tries. Sharing this tool with all of you in case you have better insights.

█ Introduction and How it is Different

The Dual SuperTrend with VIX Filter Strategy combines traditional trend following with market volatility analysis. Unlike conventional SuperTrend strategies that focus solely on price action, this experimental system incorporates VIX (Volatility Index) as an adaptive filter to create a more context-aware trading approach. By analyzing where current volatility stands relative to historical norms, the strategy adjusts to different market environments rather than applying uniform logic across all conditions.

BTCUSD 6hr Long Short Performance
快照

█ Strategy, How it Works: Detailed Explanation

🔶 Dual SuperTrend Core

The strategy uses two SuperTrend indicators with different sensitivity settings:
- SuperTrend 1: Length = 13, Multiplier = 3.5
- SuperTrend 2: Length = 8, Multiplier = 5.0

The SuperTrend calculation follows this process:
1. ATR = Average of max(High-Low, |High-PreviousClose|, |Low-PreviousClose|) over 'length' periods
2. UpperBand = (High+Low)/2 - (Multiplier * ATR)
3. LowerBand = (High+Low)/2 + (Multiplier * ATR)

Trend direction is determined by:
- If Close > previous LowerBand, Trend = Bullish (1)
- If Close < previous UpperBand, Trend = Bearish (-1)
- Otherwise, Trend = previous Trend

🔶 VIX Analysis Framework

The core innovation lies in the VIX analysis system:

1. Statistical Analysis:
- VIX Mean = SMA(VIX, 252)
- VIX Standard Deviation = StdDev(VIX, 252)
- VIX Z-Score = (Current VIX - VIX Mean) / VIX StdDev

2. **Volatility Bands:
- Upper Band 1 = VIX Mean + (2 * VIX StdDev)
- Upper Band 2 = VIX Mean + (3 * VIX StdDev)
- Lower Band 1 = VIX Mean - (2 * VIX StdDev)
- Lower Band 2 = VIX Mean - (3 * VIX StdDev)

3. Volatility Regimes:
- "Very Low Volatility": VIX < Lower Band 1
- "Low Volatility": Lower Band 1 ≤ VIX < Mean
- "Normal Volatility": Mean ≤ VIX < Upper Band 1
- "High Volatility": Upper Band 1 ≤ VIX < Upper Band 2
- "Extreme Volatility": VIX ≥ Upper Band 2

4. VIX Trend Detection:
- VIX EMA = EMA(VIX, 10)
- VIX Rising = VIX > VIX EMA
- VIX Falling = VIX < VIX EMA

Local performance:
快照


🔶 Entry Logic Integration

The strategy combines trend signals with volatility filtering:

Long Entry Condition:
- Both SuperTrend 1 AND SuperTrend 2 must be bullish (trend = 1)
- AND selected VIX filter condition must be satisfied

Short Entry Condition:
- Both SuperTrend 1 AND SuperTrend 2 must be bearish (trend = -1)
- AND selected VIX filter condition must be satisfied

Available VIX filter rules include:
- "Below Mean + SD": VIX < Lower Band 1
- "Below Mean": VIX < VIX Mean
- "Above Mean": VIX > VIX Mean
- "Above Mean + SD": VIX > Upper Band 1
- "Falling VIX": VIX < VIX EMA
- "Rising VIX": VIX > VIX EMA
- "Any": No VIX filtering

█ Trade Direction

The strategy allows testing in three modes:
1. **Long Only:** Test volatility effects on uptrends only
2. **Short Only:** Examine volatility's impact on downtrends only
3. **Both (Default):** Compare how volatility affects both trend directions

This enables comparative analysis of how volatility regimes impact bullish versus bearish markets differently.

█ Usage

Use this strategy as an experimental framework:

1. Form a hypothesis about how volatility affects trend reliability
2. Configure VIX filters to test your specific hypothesis
3. Analyze performance across different volatility regimes
4. Compare results between uptrends and downtrends
5. Refine your volatility filtering approach based on results
6. Share your findings with the trading community

This framework allows you to investigate questions like:
- Are uptrends more reliable during rising or falling volatility?
- Do downtrends perform better when volatility is above or below its historical average?
- Should different volatility filters be applied to long vs. short positions?

█ Default Settings

The default settings serve as a starting point for exploration:

SuperTrend Parameters:
- SuperTrend 1 (Length=13, Multiplier=3.5): More responsive to trend changes
- SuperTrend 2 (Length=8, Multiplier=5.0): More selective filter requiring stronger trends

VIX Analysis Settings:
- Lookback Period = 252: Establishes a full market cycle for volatility context
- Standard Deviation Bands = 2 and 3 SD: Creates statistically significant regime boundaries
- VIX Trend Period = 10: Balances responsiveness with noise reduction

Default VIX Filter Selection:
- Long Entry: "Above Mean" - Tests if uptrends perform better during above-average volatility
- Short Entry: "Rising VIX" - Tests if downtrends accelerate when volatility is increasing



Feel Free to share your insight below!!!

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。