OPEN-SOURCE SCRIPT
تم تحديثه

Adaptive Trend Ribbon [Alpha Extract]

3 658
A sophisticated adaptive trend-following framework that combines volatility-responsive moving averages, ribbon stack analysis, ATR-based trend rails, ADX confirmation, pullback continuation signals, and a real-time confidence dashboard into one complete market regime tool. The indicator is designed to identify bullish and bearish trend environments, filter weak conditions, highlight confirmed trend flips, and provide structured stop guidance through an adaptive ATR rail. By adjusting ribbon sensitivity based on current volatility, the system aims to stay responsive during expansion phases while remaining smoother during quieter market conditions.

🔶 Adaptive Volatility-Based Ribbon Engine

Implements a multi-layer adaptive EMA ribbon that automatically modifies its effective moving-average lengths based on current volatility conditions. When volatility expands, the ribbon becomes more responsive by shortening its dynamic length. When volatility contracts, the ribbon lengthens to reduce noise and avoid unnecessary whipsaw.

Pine Script®


This creates a trend ribbon that adapts to the market environment instead of relying on fixed moving-average behaviour across all conditions.

🔶 Six-Layer Trend Structure

Uses six adaptive moving averages ranging from fast to anchor length to define market structure across multiple trend speeds. The ribbon includes fast, mid, slow, and anchor components, allowing traders to see whether short-term momentum is aligned with broader trend direction.

A clean bullish trend forms when the ribbon is stacked from fastest above slowest, while a clean bearish trend forms when the ribbon is stacked from fastest below slowest. Mixed ribbon conditions indicate compression, transition, or weaker directional conviction.

🔶 Bullish & Bearish Stack Detection

Identifies strong directional alignment through full ribbon stack confirmation. Bullish stack conditions require every faster ribbon layer to sit above the slower layer beneath it, while bearish stack conditions require the opposite alignment.

This gives traders a simple way to distinguish clean trend environments from sideways or indecisive price action.

🔶 ATR Trend Rail System

Features a built-in ATR-based trend stop that acts as the main regime rail. The rail flips direction when price breaks through the active stop level, creating a clear bullish or bearish trend state.

Pine Script®


The stop can be based on the ribbon midline, close, or HL2, giving traders flexibility in how the trend rail is anchored.

🔶 Regime Flip Signal Logic

Generates long and short signals when the trend rail flips direction and the confirmation conditions are satisfied. A bullish signal occurs when the regime flips into bullish structure, while a bearish signal occurs when the regime flips into bearish structure.

Signals are filtered through ADX and directional movement confirmation when enabled, helping reduce low-quality flips during weak or choppy market conditions.

🔶 ADX & Directional Movement Confirmation

Integrates ADX confirmation to measure whether the market has enough directional strength to justify a trend signal. The system also checks directional movement by comparing +DI and -DI, allowing bullish regimes to favour positive directional pressure and bearish regimes to favour negative directional pressure.

This confirmation layer helps separate true trend expansion from random price movement.

🔶 Pullback Continuation Alerts

Includes optional pullback continuation logic designed to identify trend resumption after price interacts with the adaptive ribbon. When price pulls into the ribbon area and then closes back in the trend direction, the system can trigger continuation alerts.

This is useful for traders who prefer entering after a trend has already been established rather than only trading the initial regime flip.

🔶 Confidence Scoring Framework

Calculates a real-time trend confidence score by combining multiple components of trend quality, including ribbon stack alignment, price position relative to the ATR rail, ADX strength, directional movement, and spread between fast and anchor ribbon layers.

The score provides a quick snapshot of how strong and confirmed the current trend environment is.

🔶 Dynamic Trend Coloring System

Uses adaptive color logic to visually represent bullish, bearish, and neutral/mixed conditions. Candles, ribbon lines, fills, the ATR stop rail, and the status panel all update according to the current regime.

When ADX confirmation is enabled but the filter has not passed, the system fades the trend color to show that the regime exists but confirmation is weaker.

🔶 Real-Time Status Panel

Features a compact dashboard that displays the most important trend information directly on the chart. The panel includes:

• Current regime
• Confidence percentage
• Confirmation status
• ADX value
• Volatility ratio
• Ribbon stack condition
• Active stop level

This allows traders to quickly assess whether the market is bullish, bearish, filtered, mixed, or entering a stronger trend phase.

🔶 Flexible Risk Rail Basis

Allows the ATR stop rail to be calculated from different price references depending on the trader’s preferred style. Ribbon Mid creates a smoother institutional-style trend rail, Close makes the rail more reactive, and HL2 provides a balanced price reference.

This flexibility makes the indicator suitable for both faster trend-following styles and slower swing-trend systems.

🔶 Clean Overlay Visual Design

Displays the full adaptive ribbon directly on price with optional candle coloring, background regime shading, trend stop plotting, and signal markers. The ribbon uses layered transparency to maintain chart readability while still showing the strength and direction of the trend structure.

The result is a clean visual layout that can be used as a primary trend framework or as a confirmation layer alongside other systems.

🔶 Comprehensive Alert System

Includes alerts for the most important trend events:

• Adaptive Ribbon Long
• Adaptive Ribbon Short
• Bullish Pullback Continuation
• Bearish Pullback Continuation
• Long Trend Exit
• Short Trend Exit

These alerts allow traders to monitor trend flips, pullback continuations, and invalidation events without needing to constantly watch the chart.

🔶 Why Choose Adaptive Trend Ribbon [Alpha Extract]?

This indicator provides a complete adaptive trend-following environment by combining responsive moving-average structure, volatility-adjusted behaviour, ATR-based trend rails, ADX confirmation, continuation logic, and live confidence scoring. Instead of relying on a single moving average or fixed trend signal, it evaluates multiple layers of trend quality before confirming direction.

The adaptive ribbon helps traders understand whether the market is strongly aligned, weakening, transitioning, or mixed. The ATR rail provides a clear trend invalidation reference, while the confidence panel gives immediate context on whether the trend has enough structure and strength behind it. Perfect for trend-following traders, swing traders, momentum traders, and systematic traders who want a cleaner way to identify confirmed bullish and bearish regimes with built-in risk guidance.
ملاحظات الأخبار
Changed a title in the table

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.