PROTECTED SOURCE SCRIPT
Shock!

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.
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.
保護スクリプト
このスクリプトのソースコードは非公開で投稿されています。 無料かつ制限なしでご利用いただけます ― 詳細についてはこちらをご覧ください。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
保護スクリプト
このスクリプトのソースコードは非公開で投稿されています。 無料かつ制限なしでご利用いただけます ― 詳細についてはこちらをご覧ください。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。