OPEN-SOURCE SCRIPT
Viprasol Multi-Timeframe Trend Signal Engine

Overview
The Multi-Timeframe Trend Signal Engine is a comprehensive overlay indicator that combines SuperTrend signals, a 5-EMA trend ribbon, EMA cloud, chaos trend line, order blocks, and an RSI-based take profit system with a 6-timeframe ADX trend dashboard. The core system — originally developed by Zakaria Safri — is a mature, feature-rich trading toolkit. This version adds a confluence quantification layer that transforms the dashboard's six independent timeframe readings into a single scored consensus metric, turning passive multi-timeframe observation into an actionable alignment signal.
How It Works
SuperTrend Signal Engine:
A custom SuperTrend calculation generates buy and sell signals using ATR-based dynamic bands. All signals require bar-close confirmation to prevent repainting on confirmed bars. Two modes are available: "All Signals" shows every crossover, while "Filtered Signals" adds an EMA gate requiring price to be above (for buys) or below (for sells) the main EMA before a signal qualifies.
Multi-Timeframe ADX Dashboard:
The indicator fetches ADX trend quality from six timeframes (5m, 15m, 1H, 4H, 12H, Daily) using an anti-repaint security pattern (previous bar value with lookahead — confirmed bars only). Each timeframe is classified as Bullish, Bearish, or Neutral based on an adaptive threshold derived from the median ADX value multiplied by a configurable factor. This means trend classification adjusts to the instrument's own volatility regime rather than relying on fixed levels.
MTF Confluence Score (Viprasol Addition):
The six individual timeframe trend readings are aggregated into a Confluence Score ranging from 0 to 6. The score counts how many timeframes currently show a bullish ADX trend. A separate bear confluence count tracks bearish alignment independently. The score is color-coded in the dashboard: green at 5-6 (strong bullish consensus), yellow at 3-4 (mixed), red at 0-2 (weak or bearish-dominant). This transforms what would otherwise be six separate readings requiring manual interpretation into a single quantified alignment metric. Two dedicated alert conditions fire when 5 or more timeframes agree on direction, providing automated detection of high-confluence setups.
Trend Ribbon:
Five EMAs (20, 25, 35, 45, 55) form a color-coded ribbon. The ribbon is bullish when the fastest EMA leads and bearish when it trails, shifting state on crossover. It provides a visual trend context layer independent of the SuperTrend signal system.
EMA Cloud:
A 150/250 EMA cloud identifies longer-term structural trend direction. Green fill indicates bullish structure, red fill indicates bearish structure. This serves as a backdrop for assessing whether shorter-term signals align with the broader trend.
Chaos Trend Line:
An adaptive trend line using pivot-based detection with ATR channels. It tracks the prevailing trend using highest and lowest pivot levels and changes color on confirmed reversals, providing another independent trend perspective.
Order Blocks:
Structural order blocks based on pivot break-of-structure logic. Bullish order blocks form at swing lows when higher highs break structure; bearish order blocks form at swing highs when lower lows break structure. Boxes fade when price tests them and are removed when fully invalidated.
RSI Take Profit System:
A sequential TP system using RSI crossovers at configurable levels (default 70/85/100 for bullish, 30/15/5 for bearish). Each TP level only fires after the previous one has triggered within the current signal cycle, creating a staged exit framework. TP1 must trigger before TP2 becomes active, and TP2 before TP3.
Reversal Signals:
A 25-period RSI-based reversal detector that fires when RSI crosses above the oversold level or below the overbought level, using bar-close confirmation.
Risk Management Lines:
Visual-only TP and SL lines plotted relative to entry price. These are for reference only and do not execute trades.
Key Features
- SuperTrend buy/sell signals with bar-close confirmation (no repainting on confirmed bars)
- Two signal modes: All Signals and EMA-Filtered Signals
- 6-timeframe ADX trend dashboard (5m, 15m, 1H, 4H, 12H, Daily)
- MTF Confluence Score (0-6) quantifying multi-timeframe bullish/bearish alignment
- 5-EMA trend ribbon with directional color coding
- EMA 150/250 cloud for structural trend context
- Adaptive chaos trend line with pivot-based detection
- Structural order blocks with fade-on-test and auto-invalidation
- RSI-based sequential take profit system (TP1, TP2, TP3)
- Visual TP/SL risk management lines
- RSI reversal signals at extreme levels
- Channel breakout levels from pivot highs and lows
- Three candle coloring modes (Scalper RSI, Trend Ribbon, EMA Direction)
- RSI background zones for overbought/oversold visualization
- Configurable dashboard position and font size
- All visual elements individually toggleable
- 10 alert conditions with dynamic messages
How to Use
Reading the Dashboard:
Start with the MTF Confluence Score. A score of 5-6 out of 6 indicates strong multi-timeframe bullish alignment — the majority of timeframes from 5-minute through Daily are trending in the same direction. A score of 0-1 indicates strong bearish alignment. Scores of 3-4 represent mixed conditions where caution is warranted. The individual timeframe rows below the score show exactly where agreement and disagreement exist, letting you identify which timeframes are diverging.
Signal Workflow:
Use "Filtered Signals" mode for higher-quality entries that align with the main EMA direction. Use "All Signals" mode when you want to capture more frequent opportunities in ranging or transitional markets. Reversal signals (purple labels) flag potential exhaustion at RSI extremes. The sequential TP markers (TP1, TP2, TP3) provide staged exit targets based on RSI momentum progression.
Combining Confluence with Signals:
The confluence score is most valuable as a directional filter. A buy signal firing when the confluence score is 5 or 6 carries more weight than one firing at a score of 2. Similarly, a sell signal at confluence 0 or 1 has stronger multi-timeframe backing. This is the core analytical addition — rather than visually scanning six rows, you get a single number that quantifies alignment strength.
Suggested Starting Points:
- Scalping (1m-5m): Sensitivity 2.0, ATR Factor 8, Filtered mode
- Intraday (15m-1H): Sensitivity 2.5, ATR Factor 11, All Signals mode
- Swing (4H-1D): Sensitivity 3.0, ATR Factor 14, Filtered mode
Settings
Main Settings — Sensitivity (controls signal frequency), Signal Mode (All or Filtered), ATR Factor (band width)
Trend Settings — Toggle trend ribbon, EMA cloud, chaos trend line, order blocks; configurable main EMA period
Signal Settings — Show/hide buy-sell signals, candle coloring mode selection, RSI background zones, channel breakouts
Dashboard Settings — Show/hide dashboard, position selection, font size
Risk Management — Visual-only TP/SL lines, TP strength multiplier, individual TP level toggles
Alerts
1. Buy Signal — SuperTrend crossover buy confirmed at bar close
2. Sell Signal — SuperTrend crossover sell confirmed at bar close
3. Filtered Buy — Buy signal with price above main EMA
4. Filtered Sell — Sell signal with price below main EMA
5. Reversal Up — RSI crosses above oversold level
6. Reversal Down — RSI crosses below overbought level
7. Ribbon Turned Bullish — EMA ribbon state change to bullish (edge-detected, fires once on crossover bar)
8. Ribbon Turned Bearish — EMA ribbon state change to bearish (edge-detected, fires once on crossover bar)
9. Strong Bullish MTF Alignment — 5+ of 6 timeframes showing bullish ADX trend
10. Strong Bearish MTF Alignment — 5+ of 6 timeframes showing bearish ADX trend
All alerts include dynamic message variables: {{ticker}}, {{close}}, and {{interval}}.
Limitations & Disclaimer
- MTF data uses the anti-repaint pattern (previous bar value with lookahead) to avoid repainting on confirmed bars. The current bar's data updates in real-time until that bar closes.
- ADX trend classification uses an adaptive threshold (median ADX multiplied by a configurable factor). "Neutral" readings are relative to the instrument's recent volatility, not fixed levels. This means the same ADX value may be classified differently across instruments or time periods.
- The RSI TP system is sequential — TP2 only becomes active after TP1 fires, and TP3 after TP2. If TP1 never triggers during a signal cycle, later levels will not fire.
- Order blocks use a simplified break-of-structure method based on 3-bar pivots. They are structural levels, not institutional order flow data.
- The Risk Management TP/SL lines are visual references only — they do not place or manage trades.
- This indicator is for educational and analytical purposes only. It is not financial advice. Always use proper risk management and validate signals with your own analysis. Test on a demo account before live trading.
Credits & Attribution
This script is derived from "Multi-Timeframe Trend Indicator with Signals" v4.4 by Zakaria Safri. The original is a substantial, feature-rich indicator that provides the SuperTrend signal engine, 5-EMA trend ribbon, EMA cloud, chaos trend line, 6-timeframe ADX dashboard, order block detection, RSI sequential take profit system, TP/SL risk management lines, reversal signals, channel breakout levels, three candle coloring modes, volatility measurement, and 8 alert conditions. The vast majority of the analytical logic in this script is Zakaria Safri's work.
Viprasol's additions: MTF Confluence Score (aggregating 6 timeframe readings into a 0-6 quantified alignment metric with color coding), separate bear confluence tracking, MTF alignment alerts (firing at 5+ timeframe agreement), and ribbon trend change alerts using edge detection for single-bar precision. These additions layer a confluence quantification system on top of the original's multi-timeframe dashboard.
Published open-source per TradingView House Rules governing derivative works of open-source scripts.
The Multi-Timeframe Trend Signal Engine is a comprehensive overlay indicator that combines SuperTrend signals, a 5-EMA trend ribbon, EMA cloud, chaos trend line, order blocks, and an RSI-based take profit system with a 6-timeframe ADX trend dashboard. The core system — originally developed by Zakaria Safri — is a mature, feature-rich trading toolkit. This version adds a confluence quantification layer that transforms the dashboard's six independent timeframe readings into a single scored consensus metric, turning passive multi-timeframe observation into an actionable alignment signal.
How It Works
SuperTrend Signal Engine:
A custom SuperTrend calculation generates buy and sell signals using ATR-based dynamic bands. All signals require bar-close confirmation to prevent repainting on confirmed bars. Two modes are available: "All Signals" shows every crossover, while "Filtered Signals" adds an EMA gate requiring price to be above (for buys) or below (for sells) the main EMA before a signal qualifies.
Multi-Timeframe ADX Dashboard:
The indicator fetches ADX trend quality from six timeframes (5m, 15m, 1H, 4H, 12H, Daily) using an anti-repaint security pattern (previous bar value with lookahead — confirmed bars only). Each timeframe is classified as Bullish, Bearish, or Neutral based on an adaptive threshold derived from the median ADX value multiplied by a configurable factor. This means trend classification adjusts to the instrument's own volatility regime rather than relying on fixed levels.
MTF Confluence Score (Viprasol Addition):
The six individual timeframe trend readings are aggregated into a Confluence Score ranging from 0 to 6. The score counts how many timeframes currently show a bullish ADX trend. A separate bear confluence count tracks bearish alignment independently. The score is color-coded in the dashboard: green at 5-6 (strong bullish consensus), yellow at 3-4 (mixed), red at 0-2 (weak or bearish-dominant). This transforms what would otherwise be six separate readings requiring manual interpretation into a single quantified alignment metric. Two dedicated alert conditions fire when 5 or more timeframes agree on direction, providing automated detection of high-confluence setups.
Trend Ribbon:
Five EMAs (20, 25, 35, 45, 55) form a color-coded ribbon. The ribbon is bullish when the fastest EMA leads and bearish when it trails, shifting state on crossover. It provides a visual trend context layer independent of the SuperTrend signal system.
EMA Cloud:
A 150/250 EMA cloud identifies longer-term structural trend direction. Green fill indicates bullish structure, red fill indicates bearish structure. This serves as a backdrop for assessing whether shorter-term signals align with the broader trend.
Chaos Trend Line:
An adaptive trend line using pivot-based detection with ATR channels. It tracks the prevailing trend using highest and lowest pivot levels and changes color on confirmed reversals, providing another independent trend perspective.
Order Blocks:
Structural order blocks based on pivot break-of-structure logic. Bullish order blocks form at swing lows when higher highs break structure; bearish order blocks form at swing highs when lower lows break structure. Boxes fade when price tests them and are removed when fully invalidated.
RSI Take Profit System:
A sequential TP system using RSI crossovers at configurable levels (default 70/85/100 for bullish, 30/15/5 for bearish). Each TP level only fires after the previous one has triggered within the current signal cycle, creating a staged exit framework. TP1 must trigger before TP2 becomes active, and TP2 before TP3.
Reversal Signals:
A 25-period RSI-based reversal detector that fires when RSI crosses above the oversold level or below the overbought level, using bar-close confirmation.
Risk Management Lines:
Visual-only TP and SL lines plotted relative to entry price. These are for reference only and do not execute trades.
Key Features
- SuperTrend buy/sell signals with bar-close confirmation (no repainting on confirmed bars)
- Two signal modes: All Signals and EMA-Filtered Signals
- 6-timeframe ADX trend dashboard (5m, 15m, 1H, 4H, 12H, Daily)
- MTF Confluence Score (0-6) quantifying multi-timeframe bullish/bearish alignment
- 5-EMA trend ribbon with directional color coding
- EMA 150/250 cloud for structural trend context
- Adaptive chaos trend line with pivot-based detection
- Structural order blocks with fade-on-test and auto-invalidation
- RSI-based sequential take profit system (TP1, TP2, TP3)
- Visual TP/SL risk management lines
- RSI reversal signals at extreme levels
- Channel breakout levels from pivot highs and lows
- Three candle coloring modes (Scalper RSI, Trend Ribbon, EMA Direction)
- RSI background zones for overbought/oversold visualization
- Configurable dashboard position and font size
- All visual elements individually toggleable
- 10 alert conditions with dynamic messages
How to Use
Reading the Dashboard:
Start with the MTF Confluence Score. A score of 5-6 out of 6 indicates strong multi-timeframe bullish alignment — the majority of timeframes from 5-minute through Daily are trending in the same direction. A score of 0-1 indicates strong bearish alignment. Scores of 3-4 represent mixed conditions where caution is warranted. The individual timeframe rows below the score show exactly where agreement and disagreement exist, letting you identify which timeframes are diverging.
Signal Workflow:
Use "Filtered Signals" mode for higher-quality entries that align with the main EMA direction. Use "All Signals" mode when you want to capture more frequent opportunities in ranging or transitional markets. Reversal signals (purple labels) flag potential exhaustion at RSI extremes. The sequential TP markers (TP1, TP2, TP3) provide staged exit targets based on RSI momentum progression.
Combining Confluence with Signals:
The confluence score is most valuable as a directional filter. A buy signal firing when the confluence score is 5 or 6 carries more weight than one firing at a score of 2. Similarly, a sell signal at confluence 0 or 1 has stronger multi-timeframe backing. This is the core analytical addition — rather than visually scanning six rows, you get a single number that quantifies alignment strength.
Suggested Starting Points:
- Scalping (1m-5m): Sensitivity 2.0, ATR Factor 8, Filtered mode
- Intraday (15m-1H): Sensitivity 2.5, ATR Factor 11, All Signals mode
- Swing (4H-1D): Sensitivity 3.0, ATR Factor 14, Filtered mode
Settings
Main Settings — Sensitivity (controls signal frequency), Signal Mode (All or Filtered), ATR Factor (band width)
Trend Settings — Toggle trend ribbon, EMA cloud, chaos trend line, order blocks; configurable main EMA period
Signal Settings — Show/hide buy-sell signals, candle coloring mode selection, RSI background zones, channel breakouts
Dashboard Settings — Show/hide dashboard, position selection, font size
Risk Management — Visual-only TP/SL lines, TP strength multiplier, individual TP level toggles
Alerts
1. Buy Signal — SuperTrend crossover buy confirmed at bar close
2. Sell Signal — SuperTrend crossover sell confirmed at bar close
3. Filtered Buy — Buy signal with price above main EMA
4. Filtered Sell — Sell signal with price below main EMA
5. Reversal Up — RSI crosses above oversold level
6. Reversal Down — RSI crosses below overbought level
7. Ribbon Turned Bullish — EMA ribbon state change to bullish (edge-detected, fires once on crossover bar)
8. Ribbon Turned Bearish — EMA ribbon state change to bearish (edge-detected, fires once on crossover bar)
9. Strong Bullish MTF Alignment — 5+ of 6 timeframes showing bullish ADX trend
10. Strong Bearish MTF Alignment — 5+ of 6 timeframes showing bearish ADX trend
All alerts include dynamic message variables: {{ticker}}, {{close}}, and {{interval}}.
Limitations & Disclaimer
- MTF data uses the anti-repaint pattern (previous bar value with lookahead) to avoid repainting on confirmed bars. The current bar's data updates in real-time until that bar closes.
- ADX trend classification uses an adaptive threshold (median ADX multiplied by a configurable factor). "Neutral" readings are relative to the instrument's recent volatility, not fixed levels. This means the same ADX value may be classified differently across instruments or time periods.
- The RSI TP system is sequential — TP2 only becomes active after TP1 fires, and TP3 after TP2. If TP1 never triggers during a signal cycle, later levels will not fire.
- Order blocks use a simplified break-of-structure method based on 3-bar pivots. They are structural levels, not institutional order flow data.
- The Risk Management TP/SL lines are visual references only — they do not place or manage trades.
- This indicator is for educational and analytical purposes only. It is not financial advice. Always use proper risk management and validate signals with your own analysis. Test on a demo account before live trading.
Credits & Attribution
This script is derived from "Multi-Timeframe Trend Indicator with Signals" v4.4 by Zakaria Safri. The original is a substantial, feature-rich indicator that provides the SuperTrend signal engine, 5-EMA trend ribbon, EMA cloud, chaos trend line, 6-timeframe ADX dashboard, order block detection, RSI sequential take profit system, TP/SL risk management lines, reversal signals, channel breakout levels, three candle coloring modes, volatility measurement, and 8 alert conditions. The vast majority of the analytical logic in this script is Zakaria Safri's work.
Viprasol's additions: MTF Confluence Score (aggregating 6 timeframe readings into a 0-6 quantified alignment metric with color coding), separate bear confluence tracking, MTF alignment alerts (firing at 5+ timeframe agreement), and ribbon trend change alerts using edge detection for single-bar precision. These additions layer a confluence quantification system on top of the original's multi-timeframe dashboard.
Published open-source per TradingView House Rules governing derivative works of open-source scripts.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
Viprasol We solve Infinity
Whatsapp +919633652112
Lets do it Together All Automation Solutions Available
Whatsapp +919633652112
Lets do it Together All Automation Solutions Available
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
Viprasol We solve Infinity
Whatsapp +919633652112
Lets do it Together All Automation Solutions Available
Whatsapp +919633652112
Lets do it Together All Automation Solutions Available
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。