OPEN-SOURCE SCRIPT
Multi EMA with Smoothing & BB

Multi EMA with Smoothing & BB
────────────────────────────
This script overlays **four exponential moving averages**—fully adjustable (defaults 20/30/40/50)—to give an instant read on trend direction via “EMA stacking.”
• When the faster lines (short lengths) sit above the slower ones, the market is in up-trend alignment; the opposite stack signals down-trend momentum.
┌─ Optional Smoothing Engine
│ The 4th EMA (slowest) can be run through a second moving-average filter to cut noise:
│ ─ SMA ─ EMA ─ SMMA/RMA ─ WMA ─ VWMA ─ None
│ You choose both the type and length (default 14).
│ This smoothed line often acts as dynamic support/resistance for pull-back entries.
└───────────────────────────
┌─ Built-in Bollinger Bands
│ If you pick **“SMA + Bollinger Bands,”** the script wraps the smoothed EMA with upper/lower bands using a user-set standard-deviation multiplier (default 2.0).
│ • Band expansion ⇒ rising volatility / breakout potential.
│ • Band contraction ⇒ consolidation / squeeze conditions.
└───────────────────────────
Extra Utilities
• **Offset** (±500 bars) lets you shift every plot forward or backward—handy for visual back-testing or screenshot aesthetics.
• Selectable data *source* (close, HLC3, etc.) for compatibility with custom feeds.
• Transparent BB fill improves chart readability without hiding price.
Typical Uses
1. **Trend Confirmation** – Trade only in the direction of a clean EMA stack.
2. **Dynamic Stops/Targets** – Trail stops along the smoothed EMA or take profit at opposite BB.
3. **Volatility Filter** – Enter breakout strategies only when BB width begins to widen.
Parameter Summary
• EMA Lengths: 1–500 (defaults 20 | 30 | 40 | 50)
• Smoothing Type: None / SMA / EMA / SMMA / WMA / VWMA / SMA + BB
• Smoothing Length: 1–500 (default 14)
• BB StdDev: 0.001–50 (default 2.0)
• Offset: -500…+500 bars
No repainting – all values calculated on fully closed candles.
Script written in Pine Script v6. Use at your own discretion; not financial advice.
────────────────────────────
This script overlays **four exponential moving averages**—fully adjustable (defaults 20/30/40/50)—to give an instant read on trend direction via “EMA stacking.”
• When the faster lines (short lengths) sit above the slower ones, the market is in up-trend alignment; the opposite stack signals down-trend momentum.
┌─ Optional Smoothing Engine
│ The 4th EMA (slowest) can be run through a second moving-average filter to cut noise:
│ ─ SMA ─ EMA ─ SMMA/RMA ─ WMA ─ VWMA ─ None
│ You choose both the type and length (default 14).
│ This smoothed line often acts as dynamic support/resistance for pull-back entries.
└───────────────────────────
┌─ Built-in Bollinger Bands
│ If you pick **“SMA + Bollinger Bands,”** the script wraps the smoothed EMA with upper/lower bands using a user-set standard-deviation multiplier (default 2.0).
│ • Band expansion ⇒ rising volatility / breakout potential.
│ • Band contraction ⇒ consolidation / squeeze conditions.
└───────────────────────────
Extra Utilities
• **Offset** (±500 bars) lets you shift every plot forward or backward—handy for visual back-testing or screenshot aesthetics.
• Selectable data *source* (close, HLC3, etc.) for compatibility with custom feeds.
• Transparent BB fill improves chart readability without hiding price.
Typical Uses
1. **Trend Confirmation** – Trade only in the direction of a clean EMA stack.
2. **Dynamic Stops/Targets** – Trail stops along the smoothed EMA or take profit at opposite BB.
3. **Volatility Filter** – Enter breakout strategies only when BB width begins to widen.
Parameter Summary
• EMA Lengths: 1–500 (defaults 20 | 30 | 40 | 50)
• Smoothing Type: None / SMA / EMA / SMMA / WMA / VWMA / SMA + BB
• Smoothing Length: 1–500 (default 14)
• BB StdDev: 0.001–50 (default 2.0)
• Offset: -500…+500 bars
No repainting – all values calculated on fully closed candles.
Script written in Pine Script v6. Use at your own discretion; not financial advice.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.