OPEN-SOURCE SCRIPT
Multi-Timeframe Trend & Alignment

Comprehensive Technical Overview: Multi-Timeframe Trend & Alignment Pro
This custom script is an institutional-grade technical analysis dashboard designed for professional traders who demand multi-timeframe confirmation, structural alignment, and real-time performance tracking directly on their chart canvas. By unifying multiple Exponential Moving Averages (EMAs), Simple Moving Averages (SMAs), HTF (Higher Timeframe) momentum oscillators, and performance metrics into a single dynamic interface, the script eliminates chart clutter and provides an immediate read on market structure.
Key Architectural Features
Dual Moving Average Suite: Supports up to 10 customizable EMAs and 10 customizable SMAs, allowing traders to track short-term scalping triggers alongside long-term structural baselines simultaneously.
Dynamic Table Matrix: Automatically aggregates active moving averages, sorts them by price value in real time, calculates distance metrics (points and percentage from current price), and dynamically adjusts background coloring based on structural alignment.
Multi-Timeframe (MTF) Intelligence: Incorporates robust higher-timeframe metrics via request.security, evaluating trend health across EMAs, MACD, ADX trend strength, SuperTrend direction, and RSI without repainting issues.
Performance Percentage Tracking: Automatically computes and displays Day-to-Day (DTD), Week-to-Week (WTD), Month-to-Month (MTD), Year-to-Date (YTD), and 1-Year rolling performance benchmarks.
Clean Visual Management: Features native price scale label projections and conditional toggle controls to ensure a distraction-free trading workspace.
Input Customization Guide
Global Settings
Source: The price source used for all moving average calculations (default is close).
HTF Trend Timeframe: Selects the reference timeframe for higher-timeframe trend context (e.g., Daily, 4-Hour, Weekly).
EMA / SMA Settings
Show / Length / Width / Color: Inline controls to toggle individual averages on/off, adjust lookback lengths, set line thickness (1–4), and assign distinct color profiles.
Display Controls
Show Alignment Table: Toggles the real-time on-screen data matrix.
Show Performance %: Appends DTD, WTD, MTD, YTD, and 1-Yr return metrics to the summary table.
Show HTF Trend Metrics: Appends higher-timeframe technical indicators (MACD, ADX, SuperTrend, RSI) to the dashboard.
Trading Strategies & Practical Applications
Trend Stack Confluence: When shorter-length moving averages cleanly stack above longer-length averages while price holds above key HTF baselines, the table shifts to a bullish-aligned background, signaling institutional accumulation.
Mean Reversion & Distance Tracking: Use the Dist (Pts / %) column in the real-time table to gauge overextension. Extreme percentage deviations from core moving averages (like the 50 or 200 period lines) often highlight prime mean-reversion entries or profit-taking zones.
Multi-Timeframe Filter: Pair the primary chart execution with the embedded HTF metrics. Taking long setups only when the HTF EMA stack and SuperTrend register as bullish ensures alignment with dominant macro order flow.
This custom script is an institutional-grade technical analysis dashboard designed for professional traders who demand multi-timeframe confirmation, structural alignment, and real-time performance tracking directly on their chart canvas. By unifying multiple Exponential Moving Averages (EMAs), Simple Moving Averages (SMAs), HTF (Higher Timeframe) momentum oscillators, and performance metrics into a single dynamic interface, the script eliminates chart clutter and provides an immediate read on market structure.
Key Architectural Features
Dual Moving Average Suite: Supports up to 10 customizable EMAs and 10 customizable SMAs, allowing traders to track short-term scalping triggers alongside long-term structural baselines simultaneously.
Dynamic Table Matrix: Automatically aggregates active moving averages, sorts them by price value in real time, calculates distance metrics (points and percentage from current price), and dynamically adjusts background coloring based on structural alignment.
Multi-Timeframe (MTF) Intelligence: Incorporates robust higher-timeframe metrics via request.security, evaluating trend health across EMAs, MACD, ADX trend strength, SuperTrend direction, and RSI without repainting issues.
Performance Percentage Tracking: Automatically computes and displays Day-to-Day (DTD), Week-to-Week (WTD), Month-to-Month (MTD), Year-to-Date (YTD), and 1-Year rolling performance benchmarks.
Clean Visual Management: Features native price scale label projections and conditional toggle controls to ensure a distraction-free trading workspace.
Input Customization Guide
Global Settings
Source: The price source used for all moving average calculations (default is close).
HTF Trend Timeframe: Selects the reference timeframe for higher-timeframe trend context (e.g., Daily, 4-Hour, Weekly).
EMA / SMA Settings
Show / Length / Width / Color: Inline controls to toggle individual averages on/off, adjust lookback lengths, set line thickness (1–4), and assign distinct color profiles.
Display Controls
Show Alignment Table: Toggles the real-time on-screen data matrix.
Show Performance %: Appends DTD, WTD, MTD, YTD, and 1-Yr return metrics to the summary table.
Show HTF Trend Metrics: Appends higher-timeframe technical indicators (MACD, ADX, SuperTrend, RSI) to the dashboard.
Trading Strategies & Practical Applications
Trend Stack Confluence: When shorter-length moving averages cleanly stack above longer-length averages while price holds above key HTF baselines, the table shifts to a bullish-aligned background, signaling institutional accumulation.
Mean Reversion & Distance Tracking: Use the Dist (Pts / %) column in the real-time table to gauge overextension. Extreme percentage deviations from core moving averages (like the 50 or 200 period lines) often highlight prime mean-reversion entries or profit-taking zones.
Multi-Timeframe Filter: Pair the primary chart execution with the embedded HTF metrics. Taking long setups only when the HTF EMA stack and SuperTrend register as bullish ensures alignment with dominant macro order flow.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.