OPEN-SOURCE SCRIPT
Smart Deviation Trend Bands PRO + MTF Filter

Smart Deviation Trend Bands PRO + MTF Filter
This advanced version of Smart Deviation Bands gives you everything you need to catch cleaner trend bounces and avoid fake signals.
🔹 Classic deviation bands with 1, 2 and 3 standard deviations
🔹 Dynamic SMA line with clear trend coloring
🔹 Built-in multi-timeframe trend filter (MTF)
🔹 Signals only appear when they align with the higher timeframe trend
🔹 Ready-to-use alerts for bullish and bearish bounces
How it works
The script plots classic standard deviation bands around a dynamic Simple Moving Average (SMA). The three bands (1, 2 and 3 standard deviations) help you spot different levels of pullbacks or extensions relative to the trend.
A built-in multi-timeframe filter checks the trend on a higher timeframe (HTF). A signal appears only when a bounce aligns with the bigger trend:
Bullish bounce: Price crosses up from the lower deviation band while the HTF trend is up.
Bearish bounce: Price crosses down from the upper deviation band while the HTF trend is down.
Signal markers
🟢 Green circle: Bullish bounce — price crossing up from lower band with HTF uptrend
🔴 Red circle: Bearish bounce — price crossing down from upper band with HTF downtrend
How to use
Works on any market (crypto, stocks, forex).
Works on any timeframe — the filter can use any higher timeframe you choose (for example, H4, 1D, 1W).
Fully adjustable settings: SMA length, standard deviation multipliers, and filter timeframe.
Combine this with your strategy to filter out fake breakouts and trade in line with the bigger trend.
⚠️ Disclaimer: This script is for educational purposes only and does not constitute financial advice. Always test any strategy thoroughly and trade at your own risk.
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.