OPEN-SOURCE SCRIPT
Atualizado Williams %R Jaggedness fix

[I. THE PROBLEM OF RETAIL JAGGEDNESS]
The standard Williams %R is extremely jagged. Relying on a naive (Highest - Close) / (Highest - Lowest) look-back formula makes it a victim of spatial illusion. It is highly vulnerable to "salt-and-pepper" noise, intraday microstructure stop-hunts, and high-frequency volatility spikes. It generates an erratic, jagged signal that triggers false regime shifts, trapping retail liquidity.
[II. THE MULTI-STAGE SOLUTION] Solving the jaggedness problem is not about applying a single, lagging moving average. It requires a continuous-time signal processing pipeline. I developed 4, sovereign hypotheses to isolate the true kinematic intent of the market.
► HYPOTHESIS I: The Robust Nonlinear Butterworth %R (RNB-R)
The Mechanism: Amplitude and Noise Filtering.
The Execution: We cleanse the raw data using a 3-period Median Filter to instantly reject 1-bar liquidity sweeps without introducing lag. The resulting %R is then dynamically smoothed via a Volatility-Adaptive SuperSmoother. The lookback adapts kinematically—tightening during explosive volatility to capture breakouts, and expanding during consolidation to ignore chop.
► HYPOTHESIS II: The Decycled Zero-Lag Cycle Oscillator (DZL-R)
The Mechanism: Frequency Cancellation.
The Execution: We abandon the concept of "averaging" entirely. Using a 48-bar High-Pass filter, we isolate and subtract the high-frequency spectral noise directly from the price (Decycling). By mapping the Williams %R onto this Decycled Price, we produce a zero-lag, wave-like signal that perfectly reflects pure trend movement while ignoring micro-structural noise.
► HYPOTHESIS III: The IMF-Extracted Persistent Shape Wave (IMF-W)
The Mechanism: Spectral Shape Fitting & Empirical Mode Decomposition (EMD).
The Execution: We deconstruct the continuous price manifold into its intrinsic cyclical modes. We discard IMF 1 (high-frequency noise) and the residual (ultra-slow drift). By reconstructing the asset using only IMF 2 and IMF 3, we force the Williams %R to measure purely persistent, rhythmic structural cycles.
► HYPOTHESIS IV: The Bipolar Inverse Fisher Williams %R (BIF-R)
The Mechanism: Probability Distribution Transformation.
The Execution: To maximize state persistence, we smooth the standard oscillator with a 2-pole Gaussian filter, normalize it, and compress it through an Inverse Fisher Transform. This mathematical thermodynamic shift forces the oscillator into a bimodal, polarized state. It snaps quickly between extremes and stays there, eliminating nervous jaggedness in favor of pure regime tokenization.
The standard Williams %R is extremely jagged. Relying on a naive (Highest - Close) / (Highest - Lowest) look-back formula makes it a victim of spatial illusion. It is highly vulnerable to "salt-and-pepper" noise, intraday microstructure stop-hunts, and high-frequency volatility spikes. It generates an erratic, jagged signal that triggers false regime shifts, trapping retail liquidity.
[II. THE MULTI-STAGE SOLUTION] Solving the jaggedness problem is not about applying a single, lagging moving average. It requires a continuous-time signal processing pipeline. I developed 4, sovereign hypotheses to isolate the true kinematic intent of the market.
► HYPOTHESIS I: The Robust Nonlinear Butterworth %R (RNB-R)
The Mechanism: Amplitude and Noise Filtering.
The Execution: We cleanse the raw data using a 3-period Median Filter to instantly reject 1-bar liquidity sweeps without introducing lag. The resulting %R is then dynamically smoothed via a Volatility-Adaptive SuperSmoother. The lookback adapts kinematically—tightening during explosive volatility to capture breakouts, and expanding during consolidation to ignore chop.
► HYPOTHESIS II: The Decycled Zero-Lag Cycle Oscillator (DZL-R)
The Mechanism: Frequency Cancellation.
The Execution: We abandon the concept of "averaging" entirely. Using a 48-bar High-Pass filter, we isolate and subtract the high-frequency spectral noise directly from the price (Decycling). By mapping the Williams %R onto this Decycled Price, we produce a zero-lag, wave-like signal that perfectly reflects pure trend movement while ignoring micro-structural noise.
► HYPOTHESIS III: The IMF-Extracted Persistent Shape Wave (IMF-W)
The Mechanism: Spectral Shape Fitting & Empirical Mode Decomposition (EMD).
The Execution: We deconstruct the continuous price manifold into its intrinsic cyclical modes. We discard IMF 1 (high-frequency noise) and the residual (ultra-slow drift). By reconstructing the asset using only IMF 2 and IMF 3, we force the Williams %R to measure purely persistent, rhythmic structural cycles.
► HYPOTHESIS IV: The Bipolar Inverse Fisher Williams %R (BIF-R)
The Mechanism: Probability Distribution Transformation.
The Execution: To maximize state persistence, we smooth the standard oscillator with a 2-pole Gaussian filter, normalize it, and compress it through an Inverse Fisher Transform. This mathematical thermodynamic shift forces the oscillator into a bimodal, polarized state. It snaps quickly between extremes and stays there, eliminating nervous jaggedness in favor of pure regime tokenization.
Notas de Lançamento
new featuresNotas de Lançamento
2 newScript de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.