PROTECTED SOURCE SCRIPT
已更新 MTF Traffic Lights (EMA 9 & 20 + MACD) — realtime

MTF Traffic Lights (4H / 1H / 15m / 5m / 3m / 1m)
What it does
This indicator paints a compact “traffic-light” panel in the top-right of your chart showing the trend state on six timeframes: 4H, 1H, 15m, 5m, 3m, 1m.
For each timeframe it evaluates:
Color logic
Realtime behavior
Why it’s useful
How it works (under the hood)
Suggested ways to use it
Inputs
EMA Fast / Slow (default 9 / 20)
Use MACD for color (on/off)
MACD Fast / Slow / Signal (default 12 / 26 / 9)
Notes & best practices
Bottom line: MTF Traffic Lights gives you a fast, reliable read on trend + momentum alignment across key timeframes so you can trade with the flow, reduce noise, and time entries with greater confidence.
What it does
This indicator paints a compact “traffic-light” panel in the top-right of your chart showing the trend state on six timeframes: 4H, 1H, 15m, 5m, 3m, 1m.
For each timeframe it evaluates:
- EMA Trend: EMA(9) vs EMA(20)
- (Optional) Momentum Check: MACD histogram (≥0 or ≤0)
Color logic
- Green = EMA(9) > EMA(20) (and MACD hist ≥ 0 if enabled)
- Red = EMA(9) < EMA(20) (and MACD hist ≤ 0 if enabled)
- Yellow = Mixed / disagreement between EMA and MACD (or EMAs roughly equal)
Realtime behavior
- The 1-minute row uses live chart calculations so it can flip intra-bar as price evolves.
- Higher timeframes (3m/5m/15m/1H/4H) are computed on confirmed closes (no lookahead), so they update only when their candle closes—preventing repaint on those rows.
Why it’s useful
- Top-down alignment at a glance: Quickly see if your entry timeframe (1m/3m) is flowing with the “big current” (15m/1H/4H).
- Noise filter: Avoid counter-trend traps by waiting for green-on-green (or red-on-red) alignment before pulling the trigger.
- Momentum confirmation: Enabling the MACD check requires trend and momentum to agree (fewer but higher-quality signals).
- Trade management: Use shifts to yellow as an early heads-up that momentum is diverging from the EMA trend—tighten stops, scale down, or wait for re-alignment.
How it works (under the hood)
- EMAs: Fast = 9, Slow = 20 (fully adjustable).
- MACD: (12, 26, 9) by default; we use the histogram to judge momentum sign.
- Security calls: All higher-TF rows use request.security(..., lookahead_off) to avoid repainting; the 1m row uses the live chart stream for responsiveness.
Suggested ways to use it
- Entry filter: Only take 1m setups when minimum 3 timeframes align ( example 1m + 3m +15min are green; mirror for shorts in red.)
- Regime detection: Treat 4H/1H as the regime "bigger current"; if they’re both red, favor short setups even if lower TFs flicker green.
- Momentum mode: Turn Use MACD ON for stricter confirmation; OFF for a pure EMA view that’s more responsive.
Inputs
EMA Fast / Slow (default 9 / 20)
Use MACD for color (on/off)
MACD Fast / Slow / Signal (default 12 / 26 / 9)
Notes & best practices
- No alerts included: This is a visual dashboard. Pair it with your entry/exit indicator or strategy for alerts and execution.
- Repainting: HTF rows do not repaint (confirmed closes). The 1m row updates intra-bar by design; if you prefer it to wait for close, switch it to a confirmed calculation in code.
- Markets: Works on futures, stocks, FX, and crypto—any symbol supported by TradingView.
Bottom line: MTF Traffic Lights gives you a fast, reliable read on trend + momentum alignment across key timeframes so you can trade with the flow, reduce noise, and time entries with greater confidence.
版本注释
MTF Traffic Lights (4H / 1H / 15m / 5m / 3m / 1m)What it does
This indicator paints a compact “traffic-light” panel in the top-right of your chart showing the trend state on six timeframes: 4H, 1H, 15m, 5m, 3m, 1m.
For each timeframe it evaluates:
EMA Trend: EMA(9) vs EMA(20)
(Optional) Momentum Check: MACD histogram (≥0 or ≤0)
Color logic
Green = EMA(9) > EMA(20) (and MACD hist ≥ 0 if enabled)
Red = EMA(9) < EMA(20) (and MACD hist ≤ 0 if enabled)
Yellow = Mixed / disagreement between EMA and MACD (or EMAs roughly equal)
Realtime behavior
Uses live chart calculations so it can flip intra-bar as price evolves.
Why it’s useful
Top-down alignment at a glance: Quickly see if your entry timeframe (1m/3m) is flowing with the “big current” (15m/1H/4H).
Noise filter: Avoid counter-trend traps by waiting for green-on-green (or red-on-red) alignment before pulling the trigger.
Momentum confirmation: Enabling the MACD check requires trend and momentum to agree (fewer but higher-quality signals).
Trade management: Use shifts to yellow as an early heads-up that momentum is diverging from the EMA trend—tighten stops, scale down, or wait for re-alignment.
How it works (under the hood)
EMAs: Fast = 9, Slow = 20 (fully adjustable).
MACD: (12, 26, 9) by default; we use the histogram to judge momentum sign.
Security calls: All higher-TF rows use request.security(..., lookahead_off) to avoid repainting; the 1m row uses the live chart stream for responsiveness.
Suggested ways to use it
Entry filter: Only take 1m setups when minimum 3 timeframes align ( example 1m + 3m +15min are green; mirror for shorts in red.)
Regime detection: Treat 4H/1H as the regime "bigger current"; if they’re both red, favor short setups even if lower TFs flicker green.
Momentum mode: Turn Use MACD ON for stricter confirmation; OFF for a pure EMA view that’s more responsive.
Inputs
EMA Fast / Slow (default 9 / 20)
Use MACD for color (on/off)
MACD Fast / Slow / Signal (default 12 / 26 / 9)
Notes & best practices
No alerts included: This is a visual dashboard. Pair it with your entry/exit indicator or strategy for alerts and execution.
Repainting: HTF rows do not repaint (confirmed closes). The 1m row updates intra-bar by design; if you prefer it to wait for close, switch it to a confirmed calculation in code.
Markets: Works on futures, stocks, FX, and crypto—any symbol supported by TradingView.
Bottom line: MTF Traffic Lights gives you a fast, reliable read on trend + momentum alignment across key timeframes so you can trade with the flow, reduce noise, and time entries with greater confidence.
版本注释
removed 4 hour chart.60min, 15min, 5min, 3min & 1min
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用它,没有任何限制 — 在此处了解更多信息。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用它,没有任何限制 — 在此处了解更多信息。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。