TTM (Trade The Matrix) Squeeze EMA Cloud

Another way to simply visualize the TTM squeeze but this time with a simpe 2 EMA cloud representation. Fully customizable - change EMA, color, & squeeze to your liking
The **"TTM Squeeze EMA Cloud"** is a **custom TradingView Pine Script (v6)** indicator that **combines the classic TTM Squeeze volatility logic** with a **colored EMA cloud** to visually represent **market state**:
- **Consolidation (Squeeze ON)**
- **Bullish Breakout (Squeeze OFF + Uptrend)**
- **Bearish Breakout (Squeeze OFF + Downtrend)**
It overlays directly on the price chart (`overlay=true`) and uses **color-coded cloud shading** between two EMAs to make the current regime **immediately visible**.
---
## CORE COMPONENTS
| Component | Purpose |
|--------|--------|
| **TTM Squeeze** | Detects low-volatility consolidation (Squeeze ON) vs. volatility expansion (Squeeze OFF) |
| **EMA Cloud** | Fast EMA (8) vs. Slow EMA (21) → determines trend direction |
| **Cloud Fill** | Colors the area between EMAs based on **Squeeze + Trend** |
| **Visual Cues** | Tiny yellow dots below bars when Squeeze is ON |
---
## USER INPUTS (Customizable)
| Input | Default | Description |
|------|--------|-----------|
| `length` | 20 | Period for Bollinger Bands & SMA basis |
| `mult` | 2.0 | Bollinger Band multiplier |
| `lengthKC` | 20 | Period for ATR in Keltner Channels |
| `multKC` | 1.5 | Keltner Channel multiplier |
| `fastLength` | 8 | Fast EMA length |
| `slowLength` | 21 | Slow EMA length |
> These are standard settings — tweak for sensitivity.
---
## CALCULATIONS (Step-by-Step)
### 1. **Bollinger Bands (BB)**
```pinescript
ma = ta.sma(close, length)
stdDev = ta.stdev(close, length)
upperBB = ma + stdDev * mult
lowerBB = ma - stdDev * mult
```
- Measures **statistical volatility**
### 2. **Keltner Channels (KC) – ATR-based**
```pinescript
atrValue = ta.atr(lengthKC)
upperKC = ma + atrValue * multKC
lowerKC = ma - atrValue * multKC
```
- Measures **true range volatility** (more adaptive than stdev)
### 3. **TTM Squeeze Condition**
```pinescript
squeezeOn = (lowerBB > lowerKC) and (upperBB < upperKC)
```
- **True** when **BB is completely inside KC** → **Low volatility = Consolidation**
- **False** → **Volatility expanding = Breakout phase**
---
### 4. **EMA Cloud (Trend Filter)**
```pinescript
fastEma = ta.ema(close, fastLength) // 8-period
slowEma = ta.ema(close, slowLength) // 21-period
```
- Fast EMA reacts quickly, Slow EMA is smoother
- **Trend = fastEma > slowEma → Bullish**, otherwise Bearish
---
### 5. **Cloud Coloring Logic**
| Condition | Cloud Color | Meaning |
|--------|------------|--------|
| `squeezeOn == true` | **Bright Green-Yellow** (`#00ff59`) | **Squeeze ON** → Consolidation |
| `squeezeOn == false` AND `fastEma > slowEma` | **Cyan** (`#00fff7`) | **Squeeze OFF + Bullish** |
| `squeezeOn == false` AND `fastEma < slowEma` | **Red** (`#ff0000`) | **Squeeze OFF + Bearish** |
> The **cloud fills the space between fast and slow EMA** with the appropriate color.
---
## PLOTS & VISUALS
| Element | Description |
|-------|-----------|
| `fill(p1, p2, color=cloudColor)` | **Main EMA Cloud** – colored by regime |
| `plot(fastEma)` | Thin **blue line** (Fast EMA) |
| `plot(slowEma)` | Thin **orange line** (Slow EMA) |
| `plotshape(squeezeOn)` | **Tiny yellow circles below bar** when Squeeze is ON |
> Clean, minimal overlay — no histogram or candles
---
## HOW TO READ THE INDICATOR
| Visual | Market State | Interpretation |
|-------|-------------|----------------|
| **Yellow-Green Cloud** + **Yellow Dots** | **Squeeze ON** | Price is consolidating. **Prepare for breakout** |
| **Cyan Cloud** | **Squeeze OFF + Uptrend** | **Bullish momentum building** → Potential long entry |
| **Red Cloud** | **Squeeze OFF + Downtrend** | **Bearish momentum building** → Potential short entry |
| **Cloud narrowing** | EMAs converging | Trend weakening or reversal possible |
| **Cloud widening** | EMAs diverging | Trend strengthening |
---
## TRADING STRATEGY (Example)
### **Long Setup**
1. Wait for **Yellow-Green Cloud + Yellow Dots** → Squeeze ON
2. Watch for **cloud to turn Cyan**
3. Enter **long** when:
- Price breaks above recent high
- Volume increases (optional)
4. **Stop Loss**: Below slow EMA or recent swing low
5. **Take Profit**: Next resistance or trailing stop
### **Short Setup**
1. Wait for **Yellow-Green Cloud**
2. Enter **short** when cloud turns **Red**
3. Confirm with price breaking lower
> **Best used as a regime filter** — combine with price action, support/resistance, or volume.
---
## KEY ADVANTAGES
| Feature | Benefit |
|-------|--------|
| **One-glance regime detection** | No need to interpret multiple indicators |
| **Cloud = Trend + Volatility** | Combines momentum and consolidation |
| **Clean visuals** | Doesn’t clutter the chart |
| **Adaptive to volatility** | KC uses ATR → better in trending markets |
| **Early breakout signal** | Squeeze OFF often precedes big moves |
---
## LIMITATIONS
| Issue | Note |
|------|------|
| **Lagging EMAs** | 8/21 are reactive, not predictive |
| **No momentum strength** | Unlike histogram versions, no intensity measure |
| **False breakouts** | Squeeze OFF doesn’t guarantee follow-through |
| **Repainting?** | No — all calculations are bar-close based |
| **No alerts built-in** | You’d need to add `alertcondition()` manually |
---
## BEST USE CASES
| Market | Timeframe | Pair With |
|-------|----------|----------|
| Stocks, Crypto, Forex | 1H, 4H, Daily | Volume, RSI, Support/Resistance |
| Swing Trading | Yes | Breakout strategies |
| Scalping | No | Too slow |
---
## COMPARISON TO OTHER TTM VERSIONS
| Feature | This Version | Typical TTM Squeeze |
|-------|-------------|-------------------|
| Visual Output | EMA Cloud | Histogram + Dots |
| Trend Filter | EMA Crossover | Momentum Oscillator |
| Colors | 3-state cloud | 4–5 candle colors |
| Clutter | Low | Medium–High |
| Focus | Regime + Trend | Momentum + Squeeze |
> This version is **cleaner and more trend-focused**.
---
## SUMMARY: What This Indicator Does
> **"TTM Squeeze EMA Cloud"** is a **visual market regime detector** that:
> 1. **Identifies low-volatility consolidation** (Squeeze ON → Yellow-Green cloud)
> 2. **Signals volatility expansion** (Squeeze OFF)
> 3. **Colors the EMA cloud** to show **bullish or bearish breakout direction**
> 4. **Overlays clean trend lines** (8 & 21 EMA) for context
---
**Perfect for traders who want a simple, colorful way to:**
- Spot **consolidations before breakouts**
- Confirm **trend direction** during volatility expansion
- Avoid trading **choppy, low-momentum ranges**
---
**Pro Tip**: Add this to your chart and **watch for cloud color changes** — they often precede **high-probability breakout trades**.
招待専用スクリプト
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact Morpheus835 directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.
作者の指示
免責事項
招待専用スクリプト
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact Morpheus835 directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.