PROTECTED SOURCE SCRIPT
Precision Stochastic Divergence

This indicator is designed to identify potential market turning points and continuations by detecting Regular and Hidden divergences between closing price action and the Stochastic momentum oscillator. It utilizes specific default parameters (Stochastic: 40,4,3; Pivot Lookback: 5,5 based on close) and incorporates specialized filtering logic for signal qualification.
Core Functionality & Features:
Divergence Detection: Identifies standard Regular (potential reversal) and Hidden (potential continuation) divergence patterns. Logic has been optimized for accurate detection of both types.
Precision Filter Mechanism (Regular Divergences): Employs a unique dual-level validation process:
Requires the initial pivot's Stochastic value (%D) to meet Overbought (>80) or Oversold (<20) criteria.
Requires the subsequent pivot's Stochastic value (%D) to reside within a precisely defined range (Default parameterization: Bullish 19-30, Bearish 70-81). This aims to filter divergences based on specific momentum conditions following an initial extreme reading.
Standard Filter (Hidden Divergences): Filters Hidden Divergence signals by requiring both associated Stochastic pivot values to remain outside the primary Overbought/Oversold zones (i.e., >20 for Bullish, <80 for Bearish).
Signal Plotting: Displays 'R' (Regular) and 'H' (Hidden) markers on the chart upon confirmation of filtered divergence conditions. Relevant Stochastic threshold levels and filter range boundaries are plotted for visual reference.
Configuration & Usage Notes:
Parameterization: The default settings (Stochastic: 40,4,3; Pivots: 5,5; Levels: 80/20; Ranges: 19-30 / 70-81) have been specifically calibrated. For optimal performance according to the intended methodology, modification of these core parameters is strongly discouraged.
EMA Filter: Note that EMA trend filtering functionality has been intentionally removed from this version of the indicator.
Applicable Timeframes: While adaptable, performance consistency has been observed on the Hourly (1H) timeframe. Lower intervals such as 6m and 10m are considered optimal secondary timeframes, with 5m and 15m also demonstrating viability depending on market conditions.
Instrument Applicability & Validation:
!!!WARNING FOR GOLD TRADERS!!!
Low time frame spot gold (xauusd) mysteriously proves to give more incorrect signals than every other asset I have tested although higher timeframes like hourlies still signal as intended. The reason MAY be because of not enough testing.
The underlying principle of Stochastic divergence is applicable to various instruments, including Cryptocurrencies (Bitcoin, Ethereum) and Major Indices (SP500, NASDAQ, etc.).
However, the efficiency of this indicator's specific parameterization is contingent upon the volatility profile and price dynamics of the selected instrument.
Mandatory Validation: Rigorous backtesting and/or simulated trading on the specific instrument and timeframe is imperative prior to live deployment. This validation is crucial to ascertain performance characteristics and confirm alignment with individual trading plans and risk management protocols.
By Matthew James
Disclaimer:
Trading involves substantial risk. This indicator serves as an analytical tool and does not constitute financial advice or a guarantee of future results. Users assume full responsibility for their trading decisions. Always employ robust risk management practices.
Core Functionality & Features:
Divergence Detection: Identifies standard Regular (potential reversal) and Hidden (potential continuation) divergence patterns. Logic has been optimized for accurate detection of both types.
Precision Filter Mechanism (Regular Divergences): Employs a unique dual-level validation process:
Requires the initial pivot's Stochastic value (%D) to meet Overbought (>80) or Oversold (<20) criteria.
Requires the subsequent pivot's Stochastic value (%D) to reside within a precisely defined range (Default parameterization: Bullish 19-30, Bearish 70-81). This aims to filter divergences based on specific momentum conditions following an initial extreme reading.
Standard Filter (Hidden Divergences): Filters Hidden Divergence signals by requiring both associated Stochastic pivot values to remain outside the primary Overbought/Oversold zones (i.e., >20 for Bullish, <80 for Bearish).
Signal Plotting: Displays 'R' (Regular) and 'H' (Hidden) markers on the chart upon confirmation of filtered divergence conditions. Relevant Stochastic threshold levels and filter range boundaries are plotted for visual reference.
Configuration & Usage Notes:
Parameterization: The default settings (Stochastic: 40,4,3; Pivots: 5,5; Levels: 80/20; Ranges: 19-30 / 70-81) have been specifically calibrated. For optimal performance according to the intended methodology, modification of these core parameters is strongly discouraged.
EMA Filter: Note that EMA trend filtering functionality has been intentionally removed from this version of the indicator.
Applicable Timeframes: While adaptable, performance consistency has been observed on the Hourly (1H) timeframe. Lower intervals such as 6m and 10m are considered optimal secondary timeframes, with 5m and 15m also demonstrating viability depending on market conditions.
Instrument Applicability & Validation:
!!!WARNING FOR GOLD TRADERS!!!
Low time frame spot gold (xauusd) mysteriously proves to give more incorrect signals than every other asset I have tested although higher timeframes like hourlies still signal as intended. The reason MAY be because of not enough testing.
The underlying principle of Stochastic divergence is applicable to various instruments, including Cryptocurrencies (Bitcoin, Ethereum) and Major Indices (SP500, NASDAQ, etc.).
However, the efficiency of this indicator's specific parameterization is contingent upon the volatility profile and price dynamics of the selected instrument.
Mandatory Validation: Rigorous backtesting and/or simulated trading on the specific instrument and timeframe is imperative prior to live deployment. This validation is crucial to ascertain performance characteristics and confirm alignment with individual trading plans and risk management protocols.
By Matthew James
Disclaimer:
Trading involves substantial risk. This indicator serves as an analytical tool and does not constitute financial advice or a guarantee of future results. Users assume full responsibility for their trading decisions. Always employ robust risk management practices.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.