PROTECTED SOURCE SCRIPT

Shock!

46
The Shock Indicator is a volatility-banding model that forecasts price ranges with a dynamically widening/shrinking system. Fundamentally, it uses an exponentially weighted moving average of returns, adjusting for time-of-day patterns, to estimate a baseline volatility (i.e. The ‘prior’ in Bayesian theory). It detects jumps by comparing realized variance with “bipower variation”, temporarily widening the bands when shocks occur, and decaying the width of the bands as the shock subsides. In order to keep the coverage as calibrated and honest as possible, it continuously checks how often each bar’s closing prices stay inside the predicted bands, and adapts tail multipliers using a “scoring” system, avoiding the “cheat” of inflating bands everywhere to include as many candles as possible. It also uses a simple decaying mechanism to shrink bands exponentially faster when realized ranges are calm, preventing long periods of unjustified overshooting. In practice, this design keeps the empirical coverage probability close to a user-selected target. By default, the target is set to 95%. Across various 5 minute, 10 minute, 15 minute, and 30 minute timeframes on assets such as USDJPY, ES and NQ Futures, QQQ, NVDA, TSLA, BTCUSD, the empirical coverage consistently stays within -10%/+4% of the default 95% target coverage, while staying extremely responsive to shocks.

At the open of each candle, the range is drawn. The range is “frozen” the moment it is drawn, meaning it cannot utilize “cheating” methods such as repainting or future-looking to artificially inflate the accuracy and calibration. The indicator then tracks how accurate and well-calibrated it was for that given candle, optimizing the bands for future bars.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.