OPEN-SOURCE SCRIPT
Stochastic Trend Signal with MTF Filter

Multi-Timeframe Stochastic Trend Filter – Real Signals with Confirmation Candles
This script is a multi-timeframe Stochastic trend filter designed to help traders identify reliable BUY/SELL signals based on both momentum and higher-timeframe trend context.
It combines three key components:
Entry Signal Logic:
Entry is based on the Stochastic Oscillator (%K, 14,3), where overbought/oversold conditions are detected in the current chart's timeframe.
A green (bullish) candle following a red candle with %K below 20 can trigger a BUY signal.
A red (bearish) candle following a green candle with %K above 80 can trigger a SELL signal.
Trend Confirmation – Daily Filter:
The script uses Stochastic on the 1D (Daily) timeframe to determine whether short-term momentum aligns with a broader daily trend.
BUY signals are only allowed if the Daily %K is above 50.
SELL signals are only allowed if the Daily %K is below 50.
Long-Term Trend Filter – Weekly Stochastic:
A second filter uses Weekly %K:
BUY signals are suppressed if the Weekly trend is bearish (Weekly %K < 50) while Daily %K is bullish (> 50).
SELL signals are suppressed if the Weekly trend is bullish (Weekly %K > 50) while Daily %K is bearish (< 50).
🖼️ The chart background changes color to visually assist users:
Green background: bullish alignment on Daily and Weekly Stochastic.
Red background: bearish alignment.
Gray background: trend conflict (Daily and Weekly disagree).
✅ This script is ideal for swing traders or position traders who want to enter with confirmation while avoiding false signals during trend conflict zones.
🔔 Alerts are provided for BUY and SELL signals once all conditions are met.
How to use:
Apply on timeframe (4H recommended).
Add alerts for "BUY Alert" and "SELL Alert".
Use background color and plotted labels as entry filters.
Disclaimer: This is not financial advice. Always use proper risk management and test on demo accounts first.
This script is a multi-timeframe Stochastic trend filter designed to help traders identify reliable BUY/SELL signals based on both momentum and higher-timeframe trend context.
It combines three key components:
Entry Signal Logic:
Entry is based on the Stochastic Oscillator (%K, 14,3), where overbought/oversold conditions are detected in the current chart's timeframe.
A green (bullish) candle following a red candle with %K below 20 can trigger a BUY signal.
A red (bearish) candle following a green candle with %K above 80 can trigger a SELL signal.
Trend Confirmation – Daily Filter:
The script uses Stochastic on the 1D (Daily) timeframe to determine whether short-term momentum aligns with a broader daily trend.
BUY signals are only allowed if the Daily %K is above 50.
SELL signals are only allowed if the Daily %K is below 50.
Long-Term Trend Filter – Weekly Stochastic:
A second filter uses Weekly %K:
BUY signals are suppressed if the Weekly trend is bearish (Weekly %K < 50) while Daily %K is bullish (> 50).
SELL signals are suppressed if the Weekly trend is bullish (Weekly %K > 50) while Daily %K is bearish (< 50).
🖼️ The chart background changes color to visually assist users:
Green background: bullish alignment on Daily and Weekly Stochastic.
Red background: bearish alignment.
Gray background: trend conflict (Daily and Weekly disagree).
✅ This script is ideal for swing traders or position traders who want to enter with confirmation while avoiding false signals during trend conflict zones.
🔔 Alerts are provided for BUY and SELL signals once all conditions are met.
How to use:
Apply on timeframe (4H recommended).
Add alerts for "BUY Alert" and "SELL Alert".
Use background color and plotted labels as entry filters.
Disclaimer: This is not financial advice. Always use proper risk management and test on demo accounts first.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。