Context MTF [Th16rry]

A multi-timeframe trend context indicator that overlays an Exponential Moving Average (EMA) and a Weighted Moving Average (WMA) whose look-back periods adapt automatically to your chart’s timeframe. Inspired by Mike Bellafore and Brian Shannon (Multi timeframe analysis)
🔍 Overview
Context MTF helps you quickly gauge the prevailing trend and its strength by plotting two complementary moving averages in a single view:
* EMA (solid line) for smooth, responsive trend direction
* WMA (dotted line) for emphasis on recent price action
By automatically selecting period lengths that reflect meaningful market cycles, Context MTF provides intuitive context at a glance:
| Timeframe | Period | Market Cycle Represented |
| :--------: | :----: | :----------------------: |
| Daily (D) | 63 | Quarterly trend |
| Weekly (W) | 52 | Yearly trend |
| 1H (60) | 126 | Monthly trend |
| 15m (15) | 130 | Weekly trend |
| 5m (5) | 78 | Last 24 hours |
⚙️ How It Works
1. Automatic Period Selection
The script detects your chart’s timeframe and applies the appropriate look-back for both EMA and WMA.
2. Solid vs. Dotted
* EMA is drawn as a continuous solid line.
* WMA is rendered as a dotted line of the same color, highlighting short-term momentum within the broader trend.
3. Visual Trend Context
* Widening Gap: Indicates strengthening trend momentum.
* Convergence/Overlap: Suggests a market in consolidation or range.
🎯 Benefits
* Multi-Timeframe Context in a single pane—no need to switch charts.
* Instant trend strength assessment by comparing EMA vs. WMA divergence.
* Clear identification of range conditions when averages align.
* Fully automated period adjustment—set and forget.
⚙️ Settings
* Color: Shared color for both lines (default blue).
* Line Width: Adjustable via script inputs (default 2).
* Dotted WMA: Simulated using built-in dotted line styling for precise rendering.
Use Context MTF [Th16rry] to enhance trend-based strategies, confirm breakout momentum, or filter ranging markets. Ideal for swing traders, day traders, and anyone who values clear, time-aligned trend information on every timeframe.
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.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.
Penafian
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.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.