OPEN-SOURCE SCRIPT
已更新 Volatility Index Percentile Risk STOCK Strategy

Volatility-Index Percentile Risk STOCK Strategy
──────────────────────────────────────────────
PURPOSE
• Go long equities only when implied volatility (from any VIX-style index) is in its quietest percentile band.
• Scale stop-loss distance automatically with live volatility so risk stays proportional across timeframes and market regimes.
HOW IT WORKS
1. Pull the closing price of a user-selected volatility index (default: CBOE VIX, Nasdaq VXN, etc.).
2. Compute its 1-year (252-bar) percentile.
– If percentile < “Enter” threshold → open / maintain long.
– If percentile > “Exit” threshold → flatten.
3. Set the stop-loss every bar at:
SL % = (current VIX value) ÷ Risk Divisor
(e.g., VIX = 20 and divisor = 57 → 0.35 % SL below entry).
This keeps risk tighter when volatility is high and looser when it’s calm.
USER INPUTS
• VIX-style Index — symbol of any volatility index
• Look-back — length for percentile (default 252)
• Enter Long < Percentile — calm-market trigger (default 15 %)
• Exit Long > Percentile — fear trigger (default 60 %)
• Risk Divisor (SL) — higher number = tighter stop; start with 57 on 30-min charts
• Show Debug Plots — optional visibility of percentile & SL%
RECOMMENDED BACK-TEST SETTINGS
• Timeframe: 30 min – Daily on liquid stocks/ETFs highly correlated to the chosen VIX.
• Initial capital: 100 000 | Order size: 10 % of equity
• Commission: 0.03 % | Slippage: 5 ticks
• Enable *Bar Magnifier* and *Fill on bar close* for realistic execution.
ADDITIONAL INFORMATION
• **Self-calibrating risk** – no static ATR or fixed %, adapts instantly to changing volatility.
• **Percentile filter** – regime-aware entry logic that avoids false calm periods signalled by raw VIX levels.
• **Timeframe-agnostic** – works from intraday to weekly; √T-style divisor lets you fine-tune stops quickly ,together with the percentiles and days length.
• Zero look-ahead.
CAVEATS
• Long-only; no built-in profit target. Add one if your plan requires fixed R:R exits.
• Works best on indices/stocks that move with the selected vol index.
• Back-test results are educational; past performance never guarantees future returns.
LICENSE & CREDITS
Released under the Mozilla Public License 2.0.
Inspired by academic research on volatility risk premia and mean-reversion.
DISCLAIMER
This script is for informational and educational purposes only. It is **not** financial advice. Use at your own risk.
──────────────────────────────────────────────
PURPOSE
• Go long equities only when implied volatility (from any VIX-style index) is in its quietest percentile band.
• Scale stop-loss distance automatically with live volatility so risk stays proportional across timeframes and market regimes.
HOW IT WORKS
1. Pull the closing price of a user-selected volatility index (default: CBOE VIX, Nasdaq VXN, etc.).
2. Compute its 1-year (252-bar) percentile.
– If percentile < “Enter” threshold → open / maintain long.
– If percentile > “Exit” threshold → flatten.
3. Set the stop-loss every bar at:
SL % = (current VIX value) ÷ Risk Divisor
(e.g., VIX = 20 and divisor = 57 → 0.35 % SL below entry).
This keeps risk tighter when volatility is high and looser when it’s calm.
USER INPUTS
• VIX-style Index — symbol of any volatility index
• Look-back — length for percentile (default 252)
• Enter Long < Percentile — calm-market trigger (default 15 %)
• Exit Long > Percentile — fear trigger (default 60 %)
• Risk Divisor (SL) — higher number = tighter stop; start with 57 on 30-min charts
• Show Debug Plots — optional visibility of percentile & SL%
RECOMMENDED BACK-TEST SETTINGS
• Timeframe: 30 min – Daily on liquid stocks/ETFs highly correlated to the chosen VIX.
• Initial capital: 100 000 | Order size: 10 % of equity
• Commission: 0.03 % | Slippage: 5 ticks
• Enable *Bar Magnifier* and *Fill on bar close* for realistic execution.
ADDITIONAL INFORMATION
• **Self-calibrating risk** – no static ATR or fixed %, adapts instantly to changing volatility.
• **Percentile filter** – regime-aware entry logic that avoids false calm periods signalled by raw VIX levels.
• **Timeframe-agnostic** – works from intraday to weekly; √T-style divisor lets you fine-tune stops quickly ,together with the percentiles and days length.
• Zero look-ahead.
CAVEATS
• Long-only; no built-in profit target. Add one if your plan requires fixed R:R exits.
• Works best on indices/stocks that move with the selected vol index.
• Back-test results are educational; past performance never guarantees future returns.
LICENSE & CREDITS
Released under the Mozilla Public License 2.0.
Inspired by academic research on volatility risk premia and mean-reversion.
DISCLAIMER
This script is for informational and educational purposes only. It is **not** financial advice. Use at your own risk.
發行說明
updated default settings開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
🔻Website: hercules.money/
🔻Blog: hercules.money/blog/
🔻Telegram : t.me/hercules_trading
🔻Trader Psychology Profile – thelumenism.com/
🔻Blog: hercules.money/blog/
🔻Telegram : t.me/hercules_trading
🔻Trader Psychology Profile – thelumenism.com/
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
🔻Website: hercules.money/
🔻Blog: hercules.money/blog/
🔻Telegram : t.me/hercules_trading
🔻Trader Psychology Profile – thelumenism.com/
🔻Blog: hercules.money/blog/
🔻Telegram : t.me/hercules_trading
🔻Trader Psychology Profile – thelumenism.com/
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。