OPEN-SOURCE SCRIPT
Volatility Surge Strategy

█ OVERVIEW
Volatility Surge Strategy (VSS) is an original indicator inspired by the concept of the Williams VIX Fix — a method of measuring the depth of price decline from a recent high to replicate VIX-like behavior on any instrument.
This script is a fully independent implementation built from scratch. The core calculation concept (drop depth from highest close) is a publicly known mathematical formula with no copyright. All Pine Script code is original.
█ HOW IT WORKS
• Volatility Index (VI): Measures how far the current low has dropped from the highest close over a lookback period, expressed as a percentage.
• BB Filter: Applies a Bollinger Band to the VI. When VI exceeds the upper band, a volatility spike is detected.
• Switch Signal: Triggers an entry when the candle direction flips (bearish → bullish or vice versa) while a spike is still active — catching the moment momentum begins to shift.
█ ENTRY LOGIC
• Bullish Switch: Spike active on two consecutive bars + previous bar bearish + current bar bullish → Long entry
• Bearish Switch: Spike active on two consecutive bars + previous bar bullish + current bar bearish → Short entry
• All entries fire only on confirmed bars (barstate.isconfirmed)
█ RISK MANAGEMENT
• Stop Loss: ATR × SL Multiplier below/above entry close
• Take Profit: SL distance × Risk/Reward Ratio
• Fixed lot size (1 unit default)
• Commission: 0.05% per side | Slippage: 2 ticks
█ SETTINGS
Volatility Index
• Lookback Period (default 22) — reference window for highest close; increase to reduce sensitivity
BB Filter
• BB Period (default 20) — smoothing window for VI
• BB Multiplier (default 2.0) — spike detection threshold; increase to require stronger moves
Risk Management
• ATR Period (default 14)
• SL ATR Multiplier (default 1.5)
• Risk/Reward Ratio (default 1.5)
█ ALERTS
• High Volatility — VI crosses above the upper band (either candle direction)
• Bullish Switch — spike active, candle flips bearish → bullish
• Bearish Switch — spike active, candle flips bullish → bearish
Set alerts to "Once Per Bar Close" for best accuracy.
█ NOTES
• This indicator works best as a filter or confirmation tool combined with trend direction, key levels, or divergence signals.
• Short timeframes tend to produce noise; higher timeframes (daily and above) show more stable results in testing.
• Past performance does not guarantee future results.
Volatility Surge Strategy (VSS) is an original indicator inspired by the concept of the Williams VIX Fix — a method of measuring the depth of price decline from a recent high to replicate VIX-like behavior on any instrument.
This script is a fully independent implementation built from scratch. The core calculation concept (drop depth from highest close) is a publicly known mathematical formula with no copyright. All Pine Script code is original.
█ HOW IT WORKS
• Volatility Index (VI): Measures how far the current low has dropped from the highest close over a lookback period, expressed as a percentage.
• BB Filter: Applies a Bollinger Band to the VI. When VI exceeds the upper band, a volatility spike is detected.
• Switch Signal: Triggers an entry when the candle direction flips (bearish → bullish or vice versa) while a spike is still active — catching the moment momentum begins to shift.
█ ENTRY LOGIC
• Bullish Switch: Spike active on two consecutive bars + previous bar bearish + current bar bullish → Long entry
• Bearish Switch: Spike active on two consecutive bars + previous bar bullish + current bar bearish → Short entry
• All entries fire only on confirmed bars (barstate.isconfirmed)
█ RISK MANAGEMENT
• Stop Loss: ATR × SL Multiplier below/above entry close
• Take Profit: SL distance × Risk/Reward Ratio
• Fixed lot size (1 unit default)
• Commission: 0.05% per side | Slippage: 2 ticks
█ SETTINGS
Volatility Index
• Lookback Period (default 22) — reference window for highest close; increase to reduce sensitivity
BB Filter
• BB Period (default 20) — smoothing window for VI
• BB Multiplier (default 2.0) — spike detection threshold; increase to require stronger moves
Risk Management
• ATR Period (default 14)
• SL ATR Multiplier (default 1.5)
• Risk/Reward Ratio (default 1.5)
█ ALERTS
• High Volatility — VI crosses above the upper band (either candle direction)
• Bullish Switch — spike active, candle flips bearish → bullish
• Bearish Switch — spike active, candle flips bullish → bearish
Set alerts to "Once Per Bar Close" for best accuracy.
█ NOTES
• This indicator works best as a filter or confirmation tool combined with trend direction, key levels, or divergence signals.
• Short timeframes tend to produce noise; higher timeframes (daily and above) show more stable results in testing.
• Past performance does not guarantee future results.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.