OPEN-SOURCE SCRIPT
Context MTF [Th16rry]

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.
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.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。