OPEN-SOURCE SCRIPT
Обновлено Volatility Shock Half-Life Monitor

How long does a volatility shock actually stay elevated?
The Volatility Shock Half-Life Monitor turns that question into an event-based measurement. Instead of only labeling volatility as “high” or “low,” it detects a fresh shock, freezes the pre-shock baseline, follows subsequent volatility peaks, and counts the bars until the excess volatility has decayed to a chosen fraction.
WHAT THE INDICATOR SHOWS
🟠 Shock detected — Fast realized volatility crosses above the selected multiple of baseline volatility.
🟣 Reheat — Volatility makes a meaningfully higher peak. The decay target is recalculated and the half-life clock restarts from that peak.
🟢 Half-life reached — Excess volatility falls to the selected remaining fraction. With the default 50% setting, half of the excess above the frozen baseline has dissipated.
⬜ Window ended — The episode did not reach its decay target within the maximum observation window.
The aqua curve is fast volatility as a percentage of baseline volatility. The yellow segment is the active decay target. A compact dashboard reports the current state, excess volatility remaining, bars since the latest peak, the most recently observed half-life, and completed versus timed-out episodes.
EXAMPLE
Suppose baseline volatility is 1.0 and a shock peaks at 2.0. With “excess volatility remaining” set to 50%, the target is 1.5:
1.0 + 50% × (2.0 − 1.0) = 1.5
If volatility later reheats to 2.4, the new target becomes 1.7 and the clock restarts from that new peak. This prevents an early measurement from understating a renewed shock.
SUGGESTED USES
• Compare how quickly different assets absorb volatility shocks.
• Delay mean-reversion entries until excess volatility has materially cooled.
• Identify persistent stress when an episode repeatedly reheats or times out.
• Build confirmed-bar alerts for shock, reheat, recovery, timeout, and data-gap events.
METHOD AND LIMITATIONS
Volatility is the rolling standard deviation of logarithmic returns by default. The baseline is frozen on the initial shock bar. “Half-life” here means the observed number of chart bars from the latest volatility peak to the first target crossing; it is not an estimated exponential-decay parameter. Results depend on timeframe, symbol, lookback lengths, and threshold settings. The indicator is a research and risk-context tool, not a forecast or trading strategy.
AI-assisted disclosure: The concept, Pine implementation, validation model, and documentation were developed with AI assistance and reviewed by BotTradeLab.
The Volatility Shock Half-Life Monitor turns that question into an event-based measurement. Instead of only labeling volatility as “high” or “low,” it detects a fresh shock, freezes the pre-shock baseline, follows subsequent volatility peaks, and counts the bars until the excess volatility has decayed to a chosen fraction.
WHAT THE INDICATOR SHOWS
🟠 Shock detected — Fast realized volatility crosses above the selected multiple of baseline volatility.
🟣 Reheat — Volatility makes a meaningfully higher peak. The decay target is recalculated and the half-life clock restarts from that peak.
🟢 Half-life reached — Excess volatility falls to the selected remaining fraction. With the default 50% setting, half of the excess above the frozen baseline has dissipated.
⬜ Window ended — The episode did not reach its decay target within the maximum observation window.
The aqua curve is fast volatility as a percentage of baseline volatility. The yellow segment is the active decay target. A compact dashboard reports the current state, excess volatility remaining, bars since the latest peak, the most recently observed half-life, and completed versus timed-out episodes.
EXAMPLE
Suppose baseline volatility is 1.0 and a shock peaks at 2.0. With “excess volatility remaining” set to 50%, the target is 1.5:
1.0 + 50% × (2.0 − 1.0) = 1.5
If volatility later reheats to 2.4, the new target becomes 1.7 and the clock restarts from that new peak. This prevents an early measurement from understating a renewed shock.
SUGGESTED USES
• Compare how quickly different assets absorb volatility shocks.
• Delay mean-reversion entries until excess volatility has materially cooled.
• Identify persistent stress when an episode repeatedly reheats or times out.
• Build confirmed-bar alerts for shock, reheat, recovery, timeout, and data-gap events.
METHOD AND LIMITATIONS
Volatility is the rolling standard deviation of logarithmic returns by default. The baseline is frozen on the initial shock bar. “Half-life” here means the observed number of chart bars from the latest volatility peak to the first target crossing; it is not an estimated exponential-decay parameter. Results depend on timeframe, symbol, lookback lengths, and threshold settings. The indicator is a research and risk-context tool, not a forecast or trading strategy.
AI-assisted disclosure: The concept, Pine implementation, validation model, and documentation were developed with AI assistance and reviewed by BotTradeLab.
Информация о релизе
Improved the default presentation: the compact dashboard is now hidden by default so it does not cover the volatility plot. The public chart was also cleaned to show only this indicator. Users can re-enable the dashboard from the Display settings at any time. No calculation or alert logic changed.Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.