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.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน