OPEN-SOURCE SCRIPT
volatilty 369

1. Multi-Asset & Custom Timeframe Selection
The script allows you to select a specific asset (NIFTY, BANKNIFTY, etc.) and a fixed timeframe (e.g., 15m, 1H, Daily) from the settings. It fetches data for that specific selection regardless of what chart you currently have open.
2. Volatility-Adaptive Bands
Instead of using fixed standard deviations, the script creates dynamic bands around a 25-period EMA.
It calculates an ATR (Average True Range).
It adjusts the width of the bands based on the India VIX.
If VIX is high relative to its 25-EMA, the bands widen to account for market noise. If VIX is low, the bands tighten.
3. Trend Filtering with VWAP & VIX
The code uses two primary filters to ensure high-quality entries:
VWAP Filter: For a Long signal, the price must be above the VWAP. For a Short signal, it must be below.
VIX Spike Protection: It prevents "Long" entries if the VIX is spiking (rising more than 0.8% above its EMA), as a rising VIX usually indicates a falling market or high risk.
4. Entry & Exit Logic
BUY Signal: Triggered when the price closes above the Upper Adaptive Band AND VWAP, provided the VIX is stable.
SELL Signal: Triggered when the price closes below the Lower Adaptive Band AND VWAP, provided the VIX is trending up.
Exit/Neutral: The trend turns "Sideways" if the price crosses back over the 25-EMA, acting as a trailing stop or trend-weakness indicator.
The script allows you to select a specific asset (NIFTY, BANKNIFTY, etc.) and a fixed timeframe (e.g., 15m, 1H, Daily) from the settings. It fetches data for that specific selection regardless of what chart you currently have open.
2. Volatility-Adaptive Bands
Instead of using fixed standard deviations, the script creates dynamic bands around a 25-period EMA.
It calculates an ATR (Average True Range).
It adjusts the width of the bands based on the India VIX.
If VIX is high relative to its 25-EMA, the bands widen to account for market noise. If VIX is low, the bands tighten.
3. Trend Filtering with VWAP & VIX
The code uses two primary filters to ensure high-quality entries:
VWAP Filter: For a Long signal, the price must be above the VWAP. For a Short signal, it must be below.
VIX Spike Protection: It prevents "Long" entries if the VIX is spiking (rising more than 0.8% above its EMA), as a rising VIX usually indicates a falling market or high risk.
4. Entry & Exit Logic
BUY Signal: Triggered when the price closes above the Upper Adaptive Band AND VWAP, provided the VIX is stable.
SELL Signal: Triggered when the price closes below the Lower Adaptive Band AND VWAP, provided the VIX is trending up.
Exit/Neutral: The trend turns "Sideways" if the price crosses back over the 25-EMA, acting as a trailing stop or trend-weakness indicator.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.