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.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.