OPEN-SOURCE SCRIPT
Aggiornato Stochastic with Z-Score

📊 Stochastic with Z-Score
This custom indicator enhances the classic Stochastic Oscillator by applying Z-Score normalization to both %K and %D lines, helping traders identify statistically significant overbought and oversold conditions based on historical behavior.
🔍 Key Features:
Z-Score Normalization of %K and %D:
Detects deviations from the mean using standard deviation, offering a more dynamic and statistically grounded way to interpret momentum.
Signal Confirmation Filters:
✅ Trend Filter using 200 EMA: Only trade in the direction of the prevailing trend.
✅ Volume Filter: Confirms signals only when volume exceeds the moving average, reducing noise.
Buy & Sell Signals:
📈 Buy: Triggered when the Z-score of %K crosses above a negative threshold, %D is still below that threshold, and the candle is bullish.
📉 Sell: Triggered when the Z-score of %K crosses below a positive threshold, %D is still above that threshold, and the candle is bearish.
Signals are further filtered by trend and volume if enabled.
Customizable Thresholds & Settings:
Control Z-score length, thresholds, Stochastic lengths, and filter settings.
Visual Enhancements:
Colored histogram based on Z-score levels.
Shaded background in overbought/oversold zones.
Clear “Buy” and “Sell” labels plotted directly on the chart.
Alerts Included:
Set alerts on confirmed buy and sell signals for real-time notifications.
📘 How to Use:
Use this indicator on any timeframe or asset.
Enable or disable trend and volume filters depending on your strategy.
Use signals in confluence with price action or other indicators.
Adjust Z-score thresholds for more or fewer signals based on your risk profile.
⚠️ Note: This is an indicator, not a strategy. Always test signals on historical data and in simulation before live trading.
This custom indicator enhances the classic Stochastic Oscillator by applying Z-Score normalization to both %K and %D lines, helping traders identify statistically significant overbought and oversold conditions based on historical behavior.
🔍 Key Features:
Z-Score Normalization of %K and %D:
Detects deviations from the mean using standard deviation, offering a more dynamic and statistically grounded way to interpret momentum.
Signal Confirmation Filters:
✅ Trend Filter using 200 EMA: Only trade in the direction of the prevailing trend.
✅ Volume Filter: Confirms signals only when volume exceeds the moving average, reducing noise.
Buy & Sell Signals:
📈 Buy: Triggered when the Z-score of %K crosses above a negative threshold, %D is still below that threshold, and the candle is bullish.
📉 Sell: Triggered when the Z-score of %K crosses below a positive threshold, %D is still above that threshold, and the candle is bearish.
Signals are further filtered by trend and volume if enabled.
Customizable Thresholds & Settings:
Control Z-score length, thresholds, Stochastic lengths, and filter settings.
Visual Enhancements:
Colored histogram based on Z-score levels.
Shaded background in overbought/oversold zones.
Clear “Buy” and “Sell” labels plotted directly on the chart.
Alerts Included:
Set alerts on confirmed buy and sell signals for real-time notifications.
📘 How to Use:
Use this indicator on any timeframe or asset.
Enable or disable trend and volume filters depending on your strategy.
Use signals in confluence with price action or other indicators.
Adjust Z-score thresholds for more or fewer signals based on your risk profile.
⚠️ Note: This is an indicator, not a strategy. Always test signals on historical data and in simulation before live trading.
Note di rilascio
v1.0 -26/07/26 : Updated histogram color and buy sell logic correction.Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
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 open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
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.