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.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.