OPEN-SOURCE SCRIPT

MTF Trend Dashboard [Proozac]

212
# MTF Trend Dashboard

**Pine Script v5 — Overlay Indicator**

---

## What It Does

Displays a compact table showing the trend direction, RSI value, and a trading bias for up to **6 timeframes simultaneously** — all from a single indicator on any chart.

The core idea: before entering a trade, confirm that the higher timeframes agree with your direction. A long setup on the 15m is far stronger when the 1H, 4H, and Daily are all bullish. This dashboard makes that check instant.

---

## Detection Logic

### Trend — EMA Cross

For each timeframe, the indicator fetches two EMAs (fast and slow) using `request.security`. The trend is determined by their relative position:

```
Bullish : Fast EMA > Slow EMA
Bearish : Fast EMA < Slow EMA
```

Default: Fast EMA = 20, Slow EMA = 50. These can be changed to any values (e.g. 50/200 for longer-term bias).

### RSI

The RSI (default length 14) is fetched for each timeframe alongside the EMAs. It provides momentum context within the trend:

- RSI > 70 → overbought (cell turns red)
- RSI < 30 → oversold (cell turns green)
- 30–70 → neutral

### Bias Column

A simple confluence rule combining trend and RSI:

```
Long : Bullish trend AND RSI < 65 (trending up, not yet overbought)
Short : Bearish trend AND RSI > 35 (trending down, not yet oversold)
Wait : Any other combination
```

### Composite Score

The bottom row counts how many of the 6 timeframes are bullish (0–6). When 5 or 6 are bullish, the background flashes green. When 1 or 0 are bullish, it flashes red. Triangles appear on the price chart only when all 6 timeframes align.

---

## Inputs

| Input | Default | Description |
|-------|---------|-------------|
| **TF 1–6** | 5, 15, 60, 240, D, W | The six timeframes to analyse. All are fully customisable |
| **Fast EMA** | 20 | Fast EMA length applied on every timeframe |
| **Slow EMA** | 50 | Slow EMA length applied on every timeframe |
| **RSI Length** | 14 | RSI period applied on every timeframe |
| **Table Position** | Bottom Right | Where the table appears on the chart |
| **Composite Bias Background** | true | Flashes background green/red when 5+ or 1- TFs align |

---

## Table Layout

```
┌──────────┬────────────┬───────┬───────┐
│ TF │ Trend │ RSI │ Bias │
├──────────┼────────────┼───────┼───────┤
│ 5 │ ▲ BULL │ 58.3 │ Long │
│ 15 │ ▲ BULL │ 62.1 │ Long │
│ 60 │ ▼ BEAR │ 44.7 │ Wait │
│ 240 │ ▲ BULL │ 55.0 │ Long │
│ D │ ▲ BULL │ 67.2 │ Wait │
│ W │ ▲ BULL │ 71.4 │ Wait │
├──────────┼────────────┼───────┼───────┤
│ Score │ 5 / 6 Bull│ │ │
└──────────┴────────────┴───────┴───────┘
```

| Column | Color logic |
|--------|-------------|
| **Trend** | Green background = bullish, Red = bearish |
| **RSI** | Red = overbought (>70), Green = oversold (<30), Neutral otherwise |
| **Bias** | Green = Long, Red = Short, Neutral = Wait |
| **Score** | Green = 5–6 bull, Red = 0–1 bull, Neutral otherwise |

---

## Visual Signals on the Chart

| Signal | Condition |
|--------|-----------|
| Green triangle below bar | All 6 timeframes bullish simultaneously |
| Red triangle above bar | All 6 timeframes bearish simultaneously |
| Green background flash | 5 or 6 TFs bullish (composite bias) |
| Red background flash | 1 or 0 TFs bullish (composite bias) |

---

## How to Use

**Trend-following filter:**
Use the dashboard as a go/no-go filter. Only take long trades when 4 or more timeframes show bullish, and short trades when 4 or more are bearish. This eliminates trades taken against the dominant trend.

**Recommended TF combinations by trading style:**

| Style | Suggested TF set |
|-------|-----------------|
| Scalping | 1, 3, 5, 15, 30, 60 |
| Day trading | 5, 15, 30, 60, 240, D |
| Swing trading | 60, 240, D, W, M, 3M |
| Position trading | D, W, M, 3M, 6M, 12M |

**EMA combinations:**

| Goal | Fast / Slow |
|------|-------------|
| Short-term momentum | 9 / 21 |
| Default (balanced) | 20 / 50 |
| Macro trend | 50 / 200 |

---

## Important Notes

- The table only updates on the **last bar** (`barstate.islast`) to avoid performance overhead on large datasets.
- `request.security` uses `lookahead=off` to prevent future data leakage — values shown are confirmed closed-bar data from each higher timeframe.
- On timeframes below the chart's current timeframe, data will not be available — always set TF 1 equal to or higher than the chart timeframe.
- The "All TF" triangle signals (all 6 aligned) are rare but high-conviction. They can be used as standalone alerts without additional filters.

---

## Setting Up Alerts

The indicator fires visual signals but does not include `alertcondition` entries by default (the table updates on the last bar only). To alert on alignment:

1. Add the indicator to the chart.
2. Create an alert using **"Any alert() function call"** if you add custom alert logic, or monitor the background color signal manually.

Alternatively, combine this dashboard with any of the other indicators in this suite (SMC, Divergence Hunter) and only take their signals when the MTF score is 4+.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.