OPEN-SOURCE SCRIPT

Smart Deviation Trend Bands PRO + MTF Filter

226
📌 Purpose
This indicator combines multi-level Deviation Bands (±1, ±2, ±3 standard deviations from SMA) with a Higher Timeframe (HTF) Trend Filter.
It helps traders identify potential bounce and breakout setups aligned with the dominant market trend.

🧠 How It Works
1. Deviation Bands
SMA(Length) is calculated as the centerline.

Standard deviations (±1, ±2, ±3) define multiple dynamic support and resistance zones.

Outer bands (±3) often mark overextended zones; inner bands (±1, ±2) show active trading areas.

2. HTF Trend Filter
A higher timeframe SMA (HTF SMA) acts as a trend confirmation tool.

Default filter timeframe: 1 Day.

Trend Up: Price > HTF SMA

Trend Down: Price < HTF SMA

3. Entry Signals
Long Signal: Price crosses above lower deviation band (+1) when HTF trend is UP.

Short Signal: Price crosses below upper deviation band (−1) when HTF trend is DOWN.

4. Visuals & Alerts
Bands plotted in red (upper) and green (lower).

Centerline = SMA in blue.

HTF SMA in orange.

Circles on chart mark entry points; alerts trigger automatically.

📈 How to Use
In trending markets: Trade with the HTF direction, using band touches for entries.

In mean-reversion setups: Outer bands can be used to spot potential overbought/oversold zones.

Combine with volume or price action for confirmation.

Recommended Timeframes: 1h, 4h, D.
Markets: Forex, Crypto, Stocks.

⚙️ Inputs
SMA Length

StdDev Multiplier 1 / 2 / 3

HTF Timeframe (default: D1)

⚠️ Disclaimer
This script is for educational purposes only. It does not constitute financial advice.
Always test thoroughly before live trading.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.