OPEN-SOURCE SCRIPT
Telah dikemas kini Voss Predictive Filter

█ OVERVIEW
The Voss Predictive Filter (VPF) is a negative group delay (NGD) filter that anticipates cyclical price movement through phase compensation. The VPF isolates band-limited cyclical components via a bandpass filter, then applies negative group delay to shift the signal's phase forward, causing the output to lead the input by a fraction of the cycle period.
Based on Dr. John F. Ehlers' "Voss Predictive Filter" article in Technical Analysis of Stocks & Commodities (TASC) magazine, the VPF displays a predictive oscillator with optional dynamic threshold bands for identifying significant cycle behavior. The indicator is timeframe-agnostic - the mathematics work identically from tick charts to monthly bars, though shorter timeframes require more careful parameter selection due to noise.
█ CONCEPTS
Bandpass Filtering
A bandpass filter isolates price activity within a specific frequency range, removing both high-frequency noise and low-frequency trend drift. The VPF uses a second-order IIR (Infinite Impulse Response) bandpass filter characterized by the center frequency (the Bandpass Period input) and bandwidth. The center frequency determines which cycle period the filter emphasizes, while bandwidth controls the damping coefficient - how tightly the filter focuses around that frequency. Before filtering, the source is debiased via 2-bar momentum to remove DC offset, ensuring the filter operates around a true zero centerline.
Negative Group Delay Filtering
The predictive capability stems from negative group delay (NGD) - a filter characteristic where output appears to "lead" the input. Most causal filters introduce lag (positive group delay), but by combining the bandpass filter output with appropriately weighted past values, the VPF achieves negative group delay characteristics.
This is a universal NGD filter application for band-limited signals: the bandpass filter isolates the cyclical component of interest, then the NGD stage advances the phase within this limited frequency range to create an anticipatory output. This isn't statistical forecasting; it's phase compensation that shifts the signal's timing forward, causing peaks and troughs to appear before they occur in the bandpass output.
Negative Group Delay Stage
The NGD stage combines the current bandpass output with weighted historical values to produce an output that leads the input. By subtracting a weighted average of past deviations from a scaled version of the current filter value, the algorithm advances the signal's phase: peaks and zero-crossings in the voss output appear before the corresponding events in the bandpass filter.
The prediction order (`3 * Prediction Multiplier`) controls how many past values contribute to the phase advance. Higher orders provide smoother output but reduce the leading effect; lower orders maximize anticipation at the cost of stability.
█ INTERPRETATION
Zero-Line Crossovers
Crossings above zero suggest bullish momentum in the filtered cycle; below zero suggests bearish momentum. Crossings from near-zero regions are most reliable, as extreme excursions need time to return to equilibrium.
Threshold Bands
Threshold bands define "significant" deviation. Breaches indicate unusually strong behavior and can serve as:
• Trend confirmation when aligned with price direction
• Overbought/oversold warnings at extremes
• Trade entry filters (requiring threshold breach in the intended direction)
Threshold Mode affects sensitivity: MAD (outlier-resistant), Standard Deviation (volatility-sensitive), Percentile Rank (fixed probability bands).
Alert Conditions
Four built-in alerts trigger on bar close (no repainting): Above +Threshold (strong bullish cycle), Below -Threshold (strong bearish cycle), Above Zero (bullish phase shift), Below Zero (bearish phase shift).
█ SETTINGS & PARAMETER TUNING
Voss Predictive Filter
• Source: Price series to filter.
• Bandpass Period (1-100): Primary tuning parameter determining which cycle length the filter emphasizes. Short periods (8-15) are more responsive but noisier; medium periods (16-30) balance responsiveness and smoothness; long periods (31-100) focus on longer cycles with more smoothing.
• Bandwidth (0.01-0.45): Controls filter selectivity. Narrow bandwidths (0.01-0.15) isolate specific cycle periods precisely; medium (0.16-0.30) tolerate cycle irregularity; wide (0.31-0.45) capture broader cycle ranges. Shorter periods pair well with narrower bandwidths.
• Prediction Multiplier (2-10): Controls how many past values contribute to the phase advance. Higher values provide smoother output but reduce the leading effect; lower values maximize anticipation at the cost of stability.
Display Settings
Control visibility and colors of the Voss output, bandpass filter, and zero reference lines.
Diagnostics - Dynamic Thresholds
Three methods identify significant signal deviation:
• MAD (Median Absolute Deviation): Robust, outlier-resistant measure using `k * MAD` where `MAD ≈ 0.6745 * stdev`.
• Standard Deviation: Volatility-sensitive, calculated as `k * stdev` of Voss over the lookback period.
• Percentile Rank: Fixed probability bands using the percentile of |Voss| (e.g., 90% means only 10% of values exceed threshold).
Settings:
• Dynamic Threshold: Toggle threshold bands and set colors.
• Threshold Mode: Select MAD, Standard Deviation, or Percentile Rank.
• Period (2-200): Lookback for threshold calculations. Default 50.
• Multiplier (k): Scaling for MAD/Standard Deviation modes. Default 1.5.
• Percentile (%) (0-100): For Percentile Rank mode only. Default 90%.
█ LIMITATIONS
Inherent Characteristics
• Residual lag: Despite negative group delay design, some lag remains relative to price action.
• Cyclical markets required: Performs best on instruments with clear cyclical components. Strongly trending markets with little cyclicality produce less useful signals.
• Signal interpretation: Absolute Voss values are instrument-specific. Always interpret relative to adaptive threshold bands, not fixed levels.
Market Conditions to Avoid
• Sudden news events/gaps: Major discontinuities disrupt cycle continuity, causing erratic signals. Requires 1-2 full cycle periods to re-stabilize.
• Low volume/illiquid markets: Sporadic trading produces false cycles from liquidity artifacts. Use only on actively traded instruments during liquid hours.
• Regime changes: During cyclical ↔ trending transitions, watch for persistent extremes without mean reversion, increasing price/indicator divergence, or unresolved threshold breaches.
Parameter Selection Pitfalls
• Mismatched period: If Bandpass Period doesn't match actual market cycles, the filter produces weak signals. Use cycle measurement tools (FFT, autocorrelation, Dominant Cycle) to identify appropriate periods first.
• Overoptimization: Perfect historical fits typically fail forward. Choose robust parameters that work across multiple instruments and timeframes.
█ NOTES
Credits
This indicator is based on concepts from Dr. John F. Ehlers' work on predictive filters and bandpass techniques for technical analysis. Dr. Ehlers has published extensively on applying digital signal processing methods to financial markets in Technical Analysis of Stocks & Commodities (TASC) magazine. His articles on bandpass filters and predictive techniques, particularly the Voss Predictive Filter concept, provided the theoretical foundation for this implementation.
For those interested in the underlying mathematics and DSP concepts:
• Ehlers, J.F. (2001). Rocket Science for Traders: Digital Signal Processing Applications. John Wiley & Sons.
• Various TASC articles by John Ehlers on bandpass filters, cycle analysis, and predictive filtering techniques.
• Ehlers, J.F. "Voss Predictive Filter" - Technical Analysis of Stocks & Commodities magazine.
by ♚e2e4
The Voss Predictive Filter (VPF) is a negative group delay (NGD) filter that anticipates cyclical price movement through phase compensation. The VPF isolates band-limited cyclical components via a bandpass filter, then applies negative group delay to shift the signal's phase forward, causing the output to lead the input by a fraction of the cycle period.
Based on Dr. John F. Ehlers' "Voss Predictive Filter" article in Technical Analysis of Stocks & Commodities (TASC) magazine, the VPF displays a predictive oscillator with optional dynamic threshold bands for identifying significant cycle behavior. The indicator is timeframe-agnostic - the mathematics work identically from tick charts to monthly bars, though shorter timeframes require more careful parameter selection due to noise.
█ CONCEPTS
Bandpass Filtering
A bandpass filter isolates price activity within a specific frequency range, removing both high-frequency noise and low-frequency trend drift. The VPF uses a second-order IIR (Infinite Impulse Response) bandpass filter characterized by the center frequency (the Bandpass Period input) and bandwidth. The center frequency determines which cycle period the filter emphasizes, while bandwidth controls the damping coefficient - how tightly the filter focuses around that frequency. Before filtering, the source is debiased via 2-bar momentum to remove DC offset, ensuring the filter operates around a true zero centerline.
Negative Group Delay Filtering
The predictive capability stems from negative group delay (NGD) - a filter characteristic where output appears to "lead" the input. Most causal filters introduce lag (positive group delay), but by combining the bandpass filter output with appropriately weighted past values, the VPF achieves negative group delay characteristics.
This is a universal NGD filter application for band-limited signals: the bandpass filter isolates the cyclical component of interest, then the NGD stage advances the phase within this limited frequency range to create an anticipatory output. This isn't statistical forecasting; it's phase compensation that shifts the signal's timing forward, causing peaks and troughs to appear before they occur in the bandpass output.
Negative Group Delay Stage
The NGD stage combines the current bandpass output with weighted historical values to produce an output that leads the input. By subtracting a weighted average of past deviations from a scaled version of the current filter value, the algorithm advances the signal's phase: peaks and zero-crossings in the voss output appear before the corresponding events in the bandpass filter.
The prediction order (`3 * Prediction Multiplier`) controls how many past values contribute to the phase advance. Higher orders provide smoother output but reduce the leading effect; lower orders maximize anticipation at the cost of stability.
█ INTERPRETATION
Zero-Line Crossovers
Crossings above zero suggest bullish momentum in the filtered cycle; below zero suggests bearish momentum. Crossings from near-zero regions are most reliable, as extreme excursions need time to return to equilibrium.
Threshold Bands
Threshold bands define "significant" deviation. Breaches indicate unusually strong behavior and can serve as:
• Trend confirmation when aligned with price direction
• Overbought/oversold warnings at extremes
• Trade entry filters (requiring threshold breach in the intended direction)
Threshold Mode affects sensitivity: MAD (outlier-resistant), Standard Deviation (volatility-sensitive), Percentile Rank (fixed probability bands).
Alert Conditions
Four built-in alerts trigger on bar close (no repainting): Above +Threshold (strong bullish cycle), Below -Threshold (strong bearish cycle), Above Zero (bullish phase shift), Below Zero (bearish phase shift).
█ SETTINGS & PARAMETER TUNING
Voss Predictive Filter
• Source: Price series to filter.
• Bandpass Period (1-100): Primary tuning parameter determining which cycle length the filter emphasizes. Short periods (8-15) are more responsive but noisier; medium periods (16-30) balance responsiveness and smoothness; long periods (31-100) focus on longer cycles with more smoothing.
• Bandwidth (0.01-0.45): Controls filter selectivity. Narrow bandwidths (0.01-0.15) isolate specific cycle periods precisely; medium (0.16-0.30) tolerate cycle irregularity; wide (0.31-0.45) capture broader cycle ranges. Shorter periods pair well with narrower bandwidths.
• Prediction Multiplier (2-10): Controls how many past values contribute to the phase advance. Higher values provide smoother output but reduce the leading effect; lower values maximize anticipation at the cost of stability.
Display Settings
Control visibility and colors of the Voss output, bandpass filter, and zero reference lines.
Diagnostics - Dynamic Thresholds
Three methods identify significant signal deviation:
• MAD (Median Absolute Deviation): Robust, outlier-resistant measure using `k * MAD` where `MAD ≈ 0.6745 * stdev`.
• Standard Deviation: Volatility-sensitive, calculated as `k * stdev` of Voss over the lookback period.
• Percentile Rank: Fixed probability bands using the percentile of |Voss| (e.g., 90% means only 10% of values exceed threshold).
Settings:
• Dynamic Threshold: Toggle threshold bands and set colors.
• Threshold Mode: Select MAD, Standard Deviation, or Percentile Rank.
• Period (2-200): Lookback for threshold calculations. Default 50.
• Multiplier (k): Scaling for MAD/Standard Deviation modes. Default 1.5.
• Percentile (%) (0-100): For Percentile Rank mode only. Default 90%.
█ LIMITATIONS
Inherent Characteristics
• Residual lag: Despite negative group delay design, some lag remains relative to price action.
• Cyclical markets required: Performs best on instruments with clear cyclical components. Strongly trending markets with little cyclicality produce less useful signals.
• Signal interpretation: Absolute Voss values are instrument-specific. Always interpret relative to adaptive threshold bands, not fixed levels.
Market Conditions to Avoid
• Sudden news events/gaps: Major discontinuities disrupt cycle continuity, causing erratic signals. Requires 1-2 full cycle periods to re-stabilize.
• Low volume/illiquid markets: Sporadic trading produces false cycles from liquidity artifacts. Use only on actively traded instruments during liquid hours.
• Regime changes: During cyclical ↔ trending transitions, watch for persistent extremes without mean reversion, increasing price/indicator divergence, or unresolved threshold breaches.
Parameter Selection Pitfalls
• Mismatched period: If Bandpass Period doesn't match actual market cycles, the filter produces weak signals. Use cycle measurement tools (FFT, autocorrelation, Dominant Cycle) to identify appropriate periods first.
• Overoptimization: Perfect historical fits typically fail forward. Choose robust parameters that work across multiple instruments and timeframes.
█ NOTES
Credits
This indicator is based on concepts from Dr. John F. Ehlers' work on predictive filters and bandpass techniques for technical analysis. Dr. Ehlers has published extensively on applying digital signal processing methods to financial markets in Technical Analysis of Stocks & Commodities (TASC) magazine. His articles on bandpass filters and predictive techniques, particularly the Voss Predictive Filter concept, provided the theoretical foundation for this implementation.
For those interested in the underlying mathematics and DSP concepts:
• Ehlers, J.F. (2001). Rocket Science for Traders: Digital Signal Processing Applications. John Wiley & Sons.
• Various TASC articles by John Ehlers on bandpass filters, cycle analysis, and predictive filtering techniques.
• Ehlers, J.F. "Voss Predictive Filter" - Technical Analysis of Stocks & Commodities magazine.
by ♚e2e4
Nota Keluaran
Refactor to v6: optimize loops, add threshold bands and alertsSkrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Pisces swimming through the river
All their life against the stream
Searching for a hook to catch on
And see their sun beam
Then suffocate in painful tortures
On cutting tables of callous men
Under a knife of handsome butchers
Emeralds are ripped away
All their life against the stream
Searching for a hook to catch on
And see their sun beam
Then suffocate in painful tortures
On cutting tables of callous men
Under a knife of handsome butchers
Emeralds are ripped away
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.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Pisces swimming through the river
All their life against the stream
Searching for a hook to catch on
And see their sun beam
Then suffocate in painful tortures
On cutting tables of callous men
Under a knife of handsome butchers
Emeralds are ripped away
All their life against the stream
Searching for a hook to catch on
And see their sun beam
Then suffocate in painful tortures
On cutting tables of callous men
Under a knife of handsome butchers
Emeralds are ripped away
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.