Volatility Shock Memory Curve [Pineify]

409
Volatility Shock Memory Curve [Pineify]

Overview
This indicator follows a confirmed true-range shock through cooling, persistence or normalization. Its pane shows remaining excess relative to the event's fixed starting size and age-based decay references.

Problem Definition
An ATR level can look similar just after a large bar and several bars into a prolonged high-range episode. A rolling percentile also changes its comparison set as the shock enters history. Neither reading alone explains how much of the initial excess remains. The required invariant is a fixed event yardstick: later volatility must not enlarge its denominator and make an unresolved shock appear to heal.

Design Rationale
A prior median and median absolute deviation reduce sensitivity to historical spikes; excluding the current bar prevents self-dilution. Freezing center and initial excess preserves comparisons. Smoothing adds lag, so persistence also requires a recent raw-residual mean. Exponential half-life scenarios replace an assumed cooling deadline; they are not fitted forecasts. Keeping later spikes in one event preserves age but combines overlapping disturbances.

Key Features
  • Frozen shock center, scale and initial excess.
  • Memory curve, raw residual and half-life reference corridor.
  • Separate cooling, persistent, normalized and expired outcomes.
  • Close-confirmed alerts, coverage handling and optional visual layers.


How It Works
True range is the largest of high-low and the distances from high or low to the preceding close. The previous B valid ranges define median C and scale S: the largest of 1.4826 times MAD, a fraction of C and one tick. A shock starts when (range-C)/S reaches the threshold while armed. C, S and initial excess E=range-C are frozen. Entry memory is 100%.
At each later close, raw residual R=max(range-C,0)/E updates memory M by M+(2/(L+1))*(R-M). R and M can exceed 100%. Realized one-bar decay is 1-new M/old M; negative means renewed elevation. Fast, central and slow references are 2^(-age/H) using H equal to half, one and twice the selected half-life.
Persistence needs a full K-sample post-entry raw mean above recovery level plus margin, and M above the slow reference. Holding persistence uses half the margin and the central reference. Changes need consecutive closes. Both R and M below the recovery gate for that many closes confirm normalization. Otherwise the age limit ends observation as unresolved. Missing coverage aborts the event. Rearming outside an event requires a rolling robust score at or below 1.

How Multiple Indicators Work Together
Robust detection establishes the pre-shock yardstick; frozen normalization makes later ranges comparable; smoothing describes retained excess; recent raw evidence prevents old smoothing alone from qualifying persistence. Age references supply the comparison path. Without that chain, the display becomes a volatility level or an arbitrary timer.

Trading Ideas and Insights
Compare episodes with similar starting surprise but different ages and residuals. A raw spike above memory shows fresh range pressure without restarting the clock. Persistence can prompt a review of volatility assumptions; it gives no trade direction. Expiry leaves recovery unresolved and supplies no entry or exit instruction.

Unique Aspects
Relative to ATR or rolling volatility rank, the contribution is a fixed-denominator event trajectory with independent age, recent-evidence gating and explicit unresolved termination. Recovery cannot result merely from a rolling baseline catching up. Median, MAD and exponential decay are standard tools; their names alone do not establish novelty, and the corridor is not a probability band.

How to Use
Use standard OHLC on a liquid symbol, initially on 5-minute to daily charts. Wait for baseline coverage and an S diamond. Read the thick memory curve against its reference corridor; P squares mark persistence, N circles normalization and X marks expiry. The amber gap means raw residual exceeds memory; cyan means it is lower. Inspect age and decay in the table or Data Window before comparing events.

Customization
Defaults use B=60, a 0.15 median scale floor, shock threshold 4, smoothing L=5, half-life 8 and age limit 120 bars. Recent evidence uses K=5, recovery 0.12, persistence margin 0.25 and three confirmation closes. These are starting choices, not optimal settings. Longer smoothing delays recovery; a shorter reference half-life makes persistence easier. Toggle the corridor, residual gap, background, markers and summary independently.

Assumptions and Limitations
Strict contiguous OHLC, a preceding close and a positive prior median are required; zero scale is guarded by the floor and tick. Warm-up and missing samples hide measurements and clear event memory. Internal candidates vary intrabar, but displayed measurements, states and alerts update at closes. No future path is drawn. Gaps count as range; synthetic candles and bad feeds weaken interpretation. Frozen baselines age, parameters alter classifications, and bar age is not elapsed clock time. Data revisions can change history. The script measures neither future risk probabilities nor profitability. Use alerts once per bar close.

Conclusion
The curve separates initial surprise, residual and age. Its fixed reference distinguishes cooling, persistence and unresolved expiry without predicting price or a recovery date.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.