INVITE-ONLY SCRIPT

Trend MTF

46
The Trend MTF indicator provides multi-timeframe trend detection by comparing Smoothed Moving Average (SMMA) values of close and open on five simultaneous timeframes. Rather than using fixed higher-timeframe requests, it introduces a Resolution Multiplier system that dynamically scales each timeframe relative to the chart period — producing trend signals that adapt to the chart's granularity. The indicator also integrates two independent anomaly detection systems: Keltner Channel pressure zones using a 2.618x ATR multiplier, and extreme volume classification at 500%+ of the rolling average.


WHAT MAKES THIS ORIGINAL

This indicator's originality comes from three specific design decisions that differentiate it from standard multi-timeframe trend indicators:

1. Resolution Multiplier System (Not Standard MTF)
Standard multi-timeframe indicators use request.security() with fixed timeframes (e.g., always show the 1H trend on a 5m chart). This indicator instead uses a configurable Resolution Multiplier (default: 6x) that scales relative to the current chart period. On a 1-minute chart with 6x, the "Current TF" SMMA calculates on a 6-minute resolution. On a 5-second chart, the same multiplier produces a 30-second resolution. This means the five trend layers maintain proportional spacing regardless of what chart timeframe is active, including seconds charts where the indicator automatically adapts its MTF targets (Current → 1m → 5m → 15m → 1H instead of the standard minute-chart targets).

2. Directional Gradient Fill with Conditional Anchoring
The trend visualization uses a gradient fill system where each timeframe's fill extends from the SMMA line toward a dynamically selected price anchor. The anchor switches between EMA(low) during bullish trends and EMA(high) during bearish trends. The fill is only rendered when the SMMA line falls outside the current price range (i.e., when price is firmly beyond the trend line), which prevents visual clutter during weak or transitional trends. This conditional rendering is not available in standard Pine fill() usage.

3. Dual Anomaly Detection Layers
Beyond trend direction, two independent anomaly systems overlay on the same chart. Keltner Channel pressure detection uses a 2.618x ATR multiplier (the golden ratio extension, chosen for its alignment with Fibonacci-based volatility expansion) to identify overextended price conditions. Separately, a volume classification system flags bars where volume exceeds 500% of the rolling average as extreme activity events. A priority-based candle coloring system layers these: extreme volume overrides pressure, pressure overrides trend, providing hierarchical visual information on a single candlestick.


USAGE

Reading Multi-Timeframe Trends
Each enabled timeframe displays an SMMA line. When the SMMA(close) is above the SMMA(open) for a given timeframe, that timeframe is bullish. When below, it is bearish. Gradient fills extend from the SMMA line toward price, creating a visual cloud that grows as the trend strengthens. When all enabled timeframes show the same color, the market is in strong directional agreement. Mixed colors indicate conflicting trends across timeframes.

Pressure Zone Detection
When price closes beyond the 2.618x ATR Keltner bands, candles are colored in a distinct pressure color (default: orange). This highlights overextended conditions where price has moved significantly beyond its normal volatility range.

Extreme Volume Detection
Candles with volume exceeding 500% of the recent rolling average are flagged with a distinct color (default: yellow) and triangle markers above or below the bar.

Candle Coloring Priority
Three candle coloring modes layer by priority:
1 — Extreme volume candles (highest priority)
2 — Pressure zone candles
3 — Trend-direction candles
4 — Default neutral color


DETAILS

SMMA Calculation
The Smoothed Moving Average is calculated recursively: SMMA = (Previous_SMMA × (Length − 1) + Current_Source) / Length. Unlike SMA, SMMA gives more weight to recent data while maintaining a longer memory. For each timeframe, both SMMA(close) and SMMA(open) are calculated on the resolution-multiplied timeframe, then compared to determine trend direction. A final EMA(10) pass is applied for smooth visual output.

Resolution Multiplier
The effective resolution for each timeframe is computed as: current_chart_period × Resolution_Multiplier. For the fixed timeframes (5m, 15m, 1H, 4H), the multiplier scales each proportionally. On seconds charts (timeframe < 1 minute), the MTF targets automatically shift to 1m, 5m, 15m, and 1H to maintain meaningful trend separation.

Gradient Fill Logic
For each timeframe, a price anchor is computed: EMA(low, 10) when bullish, EMA(high, 10) when bearish. The gradient fill extends from the SMMA line toward this anchor. A visibility condition ensures the fill only appears when the SMMA line is beyond the current bar's price range (high/low), preventing fills during choppy conditions where the trend line weaves through price.

Keltner Pressure
The Keltner Channel uses a 20-period EMA center with bands at ±2.618 × ATR(10). The 2.618 multiplier (golden ratio extension) places the bands at a wider-than-standard distance, so breaches represent genuinely overextended conditions rather than normal volatility.


SETTINGS

Candles
Enable Candle Coloring: Master toggle for all candle coloring.
Show Pressure Candles: Highlight candles in the Keltner pressure zone.
Show Market Maker Candles: Flag extreme volume (500%+) events.
Color Trend Candles: Color candles by trend direction instead of default.
MM Volume Lookback: Period for calculating average volume for extreme volume detection.

SMMA
Resolution Multiplier: Scales the timeframe for SMMA calculations. Higher values produce smoother, slower trends.
SMMA MA Period: The smoothing period for the SMMA. Higher values reduce noise.

Timeframes
Show Current TF / 5m / 15m / 1H / 4H: Toggle individual timeframe displays.
MTF Fill Transparency: Controls the opacity of higher-timeframe fills.


METHODOLOGY

The source code is protected because it contains the specific implementation of: (1) The resolution multiplier system that dynamically computes effective timeframes for each of five SMMA layers with automatic seconds-chart adaptation. (2) The conditional gradient fill algorithm that switches price anchors between EMA(low) and EMA(high) based on trend state and only renders when the SMMA line exceeds the current price range. (3) The priority-based candle coloring system that integrates Keltner pressure detection (2.618x ATR) and 500%+ volume classification into a hierarchical visual overlay.


This indicator is a trend-detection tool and does not constitute financial advice. Multi-timeframe alignment does not guarantee future price direction. Past performance does not guarantee future results.

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.