OPEN-SOURCE SCRIPT
تم تحديثه

Volatility Shock Half-Life Monitor

499
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.
ملاحظات الأخبار
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. اقرأ المزيد في شروط الاستخدام.