OPEN-SOURCE SCRIPT
Aggiornato Dual Stochastic with Trend Filter

The "Dual Stochastic with Trend Filter" is an oscillator indicator designed to provide clearer, trend-aligned trading signals. It uses two distinct stochastic oscillators to identify potential entry points and incorporates an optional EMA-based trend filter to ensure that you are trading in the direction of the broader market momentum.
How It Works and How to Use It
This indicator combines two key technical analysis concepts: momentum (via stochastics) and trend (via moving averages).
Core Components:
Dual Stochastic Oscillators:
Trend Filter (Optional):
How to Use:
With Trend Filter Enabled (Recommended):
Long (Buy) Entry: Look for a green triangle buy signal (▲). This signal only appears when:
Short (Sell) Entry: Look for a red triangle sell signal (▼). This signal only appears when:
Exit Signal:
A yellow circle (●) appears to suggest closing an open trade. This signal is triggered for a long position if either the stochastics have a bearish cross or the trend flips to a downtrend. Conversely, for a short position, it's triggered by a bullish stochastic cross or a trend flip to an uptrend.
With Trend Filter Disabled:
If you turn off the "Use Trend Filter" option, the indicator will function as a simple dual stochastic crossover system.
Key Visuals:
By filtering stochastic signals with the dominant trend, this indicator helps traders avoid common pitfalls like entering short positions during a strong uptrend or buying into a bearish market. This alignment of momentum and trend is key to improving signal quality.
Disclaimer
This indicator is provided for educational and informational purposes only and should not be considered as financial advice or a recommendation to buy or sell any asset. All trading and investment decisions are your own sole responsibility.
Trading financial markets involves a high level of risk, and you may lose more than your initial investment. Past performance is not indicative of future results. The signals generated by this indicator are not guaranteed to be accurate, and you should always use this tool in conjunction with other forms of analysis and sound risk management practices.
Before using this indicator in a live trading environment, it is strongly recommended that you backtest it thoroughly and practice with it on a demo account. The author is not responsible for any financial losses you may incur from using this script.
How It Works and How to Use It
This indicator combines two key technical analysis concepts: momentum (via stochastics) and trend (via moving averages).
Core Components:
Dual Stochastic Oscillators:
- Signal Line 1 (Blue): A standard stochastic oscillator.
- Signal Line 2 (Red): A second stochastic oscillator, often using a different source (like hlcc4) to provide a smoother, more reliable signal.
- A buy signal is generated when the Blue Line (d1) crosses above the Red Line (d2).
- A sell signal is generated when the Blue Line (d1) crosses below the Red Line (d2).
Trend Filter (Optional):
- This feature uses a fast and a slow Exponential Moving Average (EMA) to determine the overall market trend.
- When the fast EMA is above the slow EMA, the background will turn green, indicating an uptrend.
- When the fast EMA is below the slow EMA, the background will turn red, indicating a downtrend.
- This filter can be toggled on or off in the indicator settings.
How to Use:
With Trend Filter Enabled (Recommended):
Long (Buy) Entry: Look for a green triangle buy signal (▲). This signal only appears when:
- The Blue Signal Line crosses above the Red Signal Line.
- The market is in a confirmed uptrend (green background).
Short (Sell) Entry: Look for a red triangle sell signal (▼). This signal only appears when:
- The Blue Signal Line crosses below the Red Signal Line.
- The market is in a confirmed downtrend (red background).
Exit Signal:
A yellow circle (●) appears to suggest closing an open trade. This signal is triggered for a long position if either the stochastics have a bearish cross or the trend flips to a downtrend. Conversely, for a short position, it's triggered by a bullish stochastic cross or a trend flip to an uptrend.
With Trend Filter Disabled:
If you turn off the "Use Trend Filter" option, the indicator will function as a simple dual stochastic crossover system.
- A green triangle (▲) will appear every time the Blue Line crosses above the Red Line.
- A red triangle (▼) will appear every time the Blue Line crosses below the Red Line.
- The background coloring and exit signals based on trend flips will be deactivated. This mode is more sensitive but may produce more false signals in choppy markets.
Key Visuals:
- Blue Line: The primary signal line.
- Red Line: The secondary, often smoother, signal line.
- Green Triangle (▲): Bullish entry signal.
- Red Triangle (▼): Bearish entry signal.
- Yellow Circle (●): Suggested trade exit/stop.
- Green/Red Background: Visual confirmation of the current uptrend or downtrend.
By filtering stochastic signals with the dominant trend, this indicator helps traders avoid common pitfalls like entering short positions during a strong uptrend or buying into a bearish market. This alignment of momentum and trend is key to improving signal quality.
Disclaimer
This indicator is provided for educational and informational purposes only and should not be considered as financial advice or a recommendation to buy or sell any asset. All trading and investment decisions are your own sole responsibility.
Trading financial markets involves a high level of risk, and you may lose more than your initial investment. Past performance is not indicative of future results. The signals generated by this indicator are not guaranteed to be accurate, and you should always use this tool in conjunction with other forms of analysis and sound risk management practices.
Before using this indicator in a live trading environment, it is strongly recommended that you backtest it thoroughly and practice with it on a demo account. The author is not responsible for any financial losses you may incur from using this script.
Note di rilascio
The "Dual Stochastic with Enhanced Sensitivity" is a sophisticated momentum indicator designed to provide clearer, trend-aligned trading signals. It improves upon standard stochastic indicators by using two separate oscillators for confirmation, incorporating an optional trend filter, and employing more responsive calculation methods (EMAs) to enhance sensitivity to recent price action.How It Works and How to Use It
This indicator combines two key technical analysis concepts: momentum (via stochastics) and trend (via moving averages).
Core Components:
1. Enhanced Dual Stochastic Oscillators:
Signal Line 1 (Blue): The primary stochastic oscillator.
Signal Line 2 (Red): A second stochastic oscillator that, by default, uses a different price source (hlcc4) and EMA-based smoothing. This creates a faster, more responsive signal pair compared to traditional SMA-based stochastics.
A base buy signal (stochBuy) is generated when the Blue Line (d1) crosses above the Red Line (d2).
A base sell signal (stochSell) is generated when the Blue Line (d1) crosses below the Red Line (d2).
2. EMA Trend Filter (Optional):
This feature uses a fast (10-period) and a slow (21-period) Exponential Moving Average (EMA) to determine the short-term market trend.
When the fast EMA is above the slow EMA, the background turns green, indicating an uptrend.
When the fast EMA is below the slow EMA, the background turns red, indicating a downtrend.
This filter can be toggled on or off in the indicator settings via the "Use Trend Filter" checkbox.
How to Use:
With Trend Filter Enabled (Recommended):
This is the intended use of the indicator. It filters out counter-trend signals to improve accuracy.
Long (Buy) Entry: Look for a green triangle buy signal (▲). This signal only appears when:
The Blue Signal Line crosses above the Red Signal Line.
The market is in a confirmed uptrend (green background).
Short (Sell) Entry: Look for a red triangle sell signal (▼). This signal only appears when:
The Blue Signal Line crosses below the Red Signal Line.
The market is in a confirmed downtrend (red background).
Exit Signal:
A yellow circle (●) appears to suggest closing an open trade. The exit logic is robust:
For a long position, the exit signal is triggered if EITHER the stochastics have a bearish cross (Blue crosses below Red) OR the trend itself flips to a downtrend (background turns red).
For a short position, the exit is triggered if EITHER the stochastics have a bullish cross (Blue crosses above Red) OR the trend flips to an uptrend (background turns green).
With Trend Filter Disabled:
If you turn off the "Use Trend Filter" option, the indicator functions as a simple, highly sensitive dual stochastic crossover system.
A green triangle (▲) will appear on every bullish crossover.
A red triangle (▼) will appear on every bearish crossunder.
The background coloring and trend-based exits are deactivated. This mode is more aggressive but may produce more false signals in choppy or sideways markets.
Key Visuals:
Blue Line: The primary, faster stochastic signal line (d1).
Red Line: The secondary, smoother stochastic signal line (d2).
Green Triangle (▲): A valid, trend-confirmed bullish entry signal.
Red Triangle (▼): A valid, trend-confirmed bearish entry signal.
Yellow Circle (●): Suggested trade exit/stop signal.
Green/Red Background: Visual confirmation of the current uptrend or downtrend.
By filtering sensitive stochastic signals with the dominant trend, this indicator helps traders avoid common pitfalls like shorting a strong uptrend or buying into a bearish market. This alignment of momentum and trend is key to improving signal quality.
Disclaimer
This indicator is provided for educational and informational purposes only and should not be considered as financial advice or a recommendation to buy or sell any asset. All trading and investment decisions are your own sole responsibility.
Trading financial markets involves a high level of risk, and you may lose more than your initial investment. Past performance is not indicative of future results. The signals generated by this indicator are not guaranteed to be accurate, and you should always use this tool in conjunction with other forms of analysis and sound risk management practices.
Before using this indicator in a live trading environment, it is strongly recommended that you backtest it thoroughly and practice with it on a demo account. The author is not responsible for any financial losses you may incur from using this script.
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.