OPEN-SOURCE SCRIPT
Adaptive Kinetic Ribbon [QuantAlgo]

๐ข Overview
The Adaptive Kinetic Ribbon indicator synthesizes price velocity and volatility dynamics to identify trend direction, momentum strength, and acceleration phases across varying market conditions. It combines velocity-based momentum measurement, adaptive volatility weighting, dual-speed ribbon analysis, and acceleration-deceleration detection into a unified visual system that quantifies periods of sustained directional movement and momentum shifts, helping traders and investors identify trend continuation and reversal signals across various timeframes and asset classes.

๐ข How It Works
The indicator's core methodology lies in its adaptive kinetic approach, where velocity and volatility components are calculated dynamically and then smoothed through an adaptive alpha mechanism.
First, Velocity is measured to capture raw directional momentum by calculating the net price change over the lookback period:
Pine Scriptยฎ
This creates a momentum vector that quantifies how far and in which direction price has moved, providing the foundation for understanding trend strength and establishing whether the market is in a sustained directional phase.
Then, Volatility is computed to evaluate price variability and market noise by analyzing the standard deviation of bar-to-bar price changes:
Pine Scriptยฎ
The volatility sensitivity multiplier allows traders to adjust how responsive the indicator is to market noise, with higher values creating faster adaptation during volatile periods and lower values maintaining stability during choppy conditions.
Next, Adaptive Alpha is calculated to create a dynamic smoothing coefficient that automatically adjusts based on the relationship between velocity and volatility:
Pine Scriptยฎ
This alpha value ranges from 0 to 1, where values closer to 1 indicate strong, clear directional movement (high velocity relative to volatility), causing the indicator to respond quickly, while values closer to 0 indicate noisy, range-bound conditions (high volatility relative to velocity), causing the indicator to smooth more heavily and filter out false signals.
Following this, the Kinetic Line is constructed using exponential smoothing with the adaptive alpha coefficient:
Pine Scriptยฎ
This creates an adaptive moving average that automatically adjusts its responsiveness: during strong trends with clear velocity, it tracks price closely like a fast EMA; during choppy, volatile periods, it smooths heavily like a slow SMA, providing optimal trend identification across varying market regimes without manual parameter adjustment.
Then, Ribbon Lines are generated by applying additional moving average smoothing to the kinetic line at two different speeds:
Pine Scriptยฎ
The dual-ribbon structure creates a visual envelope around the kinetic line, where the fast ribbon responds quickly to kinetic changes while the slow ribbon provides trend confirmation, with crossovers between these ribbons generating primary trend reversal signals.
Finally, Trend State and Acceleration are determined by analyzing the relative positioning and directional movement of the ribbon lines:
Pine Scriptยฎ
This creates a four-state classification system that distinguishes between bullish acceleration (uptrend strengthening), bullish deceleration (uptrend weakening), bearish acceleration (downtrend strengthening), and bearish deceleration (downtrend weakening), providing traders with nuanced momentum insights beyond simple bullish/bearish binary signals.

๐ข Signal Interpretation
โถ Bullish Acceleration (Bright Green): Fast ribbon above slow ribbon AND fast ribbon rising, indicating confirmed uptrend with building momentum = Strongest bullish condition, ideal for new long entries, adding to positions, or holding existing longs with confidence
โถ Bullish Deceleration (Dark Green): Fast ribbon above slow ribbon BUT fast ribbon falling, indicating uptrend intact but momentum weakening = Caution signal for longs, potential trend exhaustion developing, consider tightening stops or taking partial profits
โถ Bearish Acceleration (Bright Red): Fast ribbon below slow ribbon AND fast ribbon falling, indicating confirmed downtrend with building momentum = Strongest bearish condition, ideal for new short entries, exiting longs, or maintaining defensive positioning
โถ Bearish Deceleration (Dark Red): Fast ribbon below slow ribbon BUT fast ribbon rising, indicating downtrend intact but momentum weakening = Caution signal for shorts, potential trend exhaustion developing, prepare for possible reversal or consolidation

โถ Bullish Crossover: Fast ribbon crosses above slow ribbon, signaling trend reversal from bearish to bullish and initiation of new upward momentum phase = Primary buy signal, entry opportunity for trend-following strategies, exit signal for short positions
โถ Bearish Crossover: Fast ribbon crosses below slow ribbon, signaling trend reversal from bullish to bearish and initiation of new downward momentum phase = Primary sell signal, entry opportunity for short strategies, exit signal for long positions
โถ Ribbon Spread Width: Distance between fast and slow ribbons indicates trend strength and conviction, where wider spreads suggest strong, sustained directional movement with low reversal probability, while tight or converging ribbons indicate weak trends, consolidation, or impending reversal conditions
โถ Bar Color Alignment: When bar coloring is enabled, candlestick colors mirror the ribbon state providing immediate visual confirmation of momentum conditions directly on price action, eliminating the need to reference the indicator separately and enabling faster decision-making during active trading
๐ข Features
โถ Preconfigured Presets: Three optimized parameter configurations accommodate different trading styles, timeframes, and market analysis approaches: "Default" provides balanced trend identification suitable for swing trading on 4-hour and daily charts, "Fast Response" delivers heightened sensitivity optimized for intraday trading and scalping on 5-minute to 1-hour charts, and "Smooth Trend" offers conservative trend identification ideal for position trading and long-term analysis on daily to weekly charts.

โถ Built-in Alerts: Three alert conditions enable comprehensive automated monitoring of trend reversals and momentum transitions. "Bullish Crossover" triggers when the fast ribbon crosses above the slow ribbon, signaling the shift from downtrend to uptrend and the beginning of bullish momentum building. "Bearish Crossover" activates when the fast ribbon crosses below the slow ribbon, signaling the shift from uptrend to downtrend and the beginning of bearish momentum building. "Any Ribbon Crossover" provides a combined notification for either bullish or bearish crossover regardless of direction, useful for general trend reversal monitoring and ensuring no momentum shift goes unnoticed.

โถ Color Customization: Six visual themes (Classic, Aqua, Cosmic, Cyber, Neon, plus Custom) accommodate different chart backgrounds and visual preferences, ensuring optimal contrast and immediate identification of acceleration versus deceleration states across various devices and screen sizes. Each preset uses distinct colors for the four momentum states (bullish acceleration, bullish deceleration, bearish acceleration, bearish deceleration) with proper visual hierarchy. Optional bar coloring with adjustable transparency provides instant visual context of current momentum state and trend direction without switching between the price pane and indicator pane, enabling traders and investors to immediately assess trend positioning and acceleration dynamics while analyzing price action patterns and support/resistance levels.

The Adaptive Kinetic Ribbon indicator synthesizes price velocity and volatility dynamics to identify trend direction, momentum strength, and acceleration phases across varying market conditions. It combines velocity-based momentum measurement, adaptive volatility weighting, dual-speed ribbon analysis, and acceleration-deceleration detection into a unified visual system that quantifies periods of sustained directional movement and momentum shifts, helping traders and investors identify trend continuation and reversal signals across various timeframes and asset classes.
๐ข How It Works
The indicator's core methodology lies in its adaptive kinetic approach, where velocity and volatility components are calculated dynamically and then smoothed through an adaptive alpha mechanism.
First, Velocity is measured to capture raw directional momentum by calculating the net price change over the lookback period:
velocity = source - source[length]
This creates a momentum vector that quantifies how far and in which direction price has moved, providing the foundation for understanding trend strength and establishing whether the market is in a sustained directional phase.
Then, Volatility is computed to evaluate price variability and market noise by analyzing the standard deviation of bar-to-bar price changes:
volatility = ta.stdev(source - source[1], length) * mult
The volatility sensitivity multiplier allows traders to adjust how responsive the indicator is to market noise, with higher values creating faster adaptation during volatile periods and lower values maintaining stability during choppy conditions.
Next, Adaptive Alpha is calculated to create a dynamic smoothing coefficient that automatically adjusts based on the relationship between velocity and volatility:
adaptive_alpha = math.abs(velocity) / (math.abs(velocity) + volatility)
This alpha value ranges from 0 to 1, where values closer to 1 indicate strong, clear directional movement (high velocity relative to volatility), causing the indicator to respond quickly, while values closer to 0 indicate noisy, range-bound conditions (high volatility relative to velocity), causing the indicator to smooth more heavily and filter out false signals.
Following this, the Kinetic Line is constructed using exponential smoothing with the adaptive alpha coefficient:
var float kinetic_line = na
kinetic_line := na(kinetic_line[1]) ? source : kinetic_line[1] + adaptive_alpha * (source - kinetic_line[1])
This creates an adaptive moving average that automatically adjusts its responsiveness: during strong trends with clear velocity, it tracks price closely like a fast EMA; during choppy, volatile periods, it smooths heavily like a slow SMA, providing optimal trend identification across varying market regimes without manual parameter adjustment.
Then, Ribbon Lines are generated by applying additional moving average smoothing to the kinetic line at two different speeds:
ribbon_fast = ma(kinetic_line, ribbon_fast_length, ma_type)
ribbon_slow = ma(kinetic_line, ribbon_slow_length, ma_type)
The dual-ribbon structure creates a visual envelope around the kinetic line, where the fast ribbon responds quickly to kinetic changes while the slow ribbon provides trend confirmation, with crossovers between these ribbons generating primary trend reversal signals.
Finally, Trend State and Acceleration are determined by analyzing the relative positioning and directional movement of the ribbon lines:
trend_up = ribbon_fast > ribbon_slow
acceleration = ribbon_fast > ribbon_fast[1]
ribbonColor = trend_up ?
acceleration ? bullAccel : bullDecel :
not acceleration ? bearAccel : bearDecel
This creates a four-state classification system that distinguishes between bullish acceleration (uptrend strengthening), bullish deceleration (uptrend weakening), bearish acceleration (downtrend strengthening), and bearish deceleration (downtrend weakening), providing traders with nuanced momentum insights beyond simple bullish/bearish binary signals.
๐ข Signal Interpretation
โถ Bullish Acceleration (Bright Green): Fast ribbon above slow ribbon AND fast ribbon rising, indicating confirmed uptrend with building momentum = Strongest bullish condition, ideal for new long entries, adding to positions, or holding existing longs with confidence
โถ Bullish Deceleration (Dark Green): Fast ribbon above slow ribbon BUT fast ribbon falling, indicating uptrend intact but momentum weakening = Caution signal for longs, potential trend exhaustion developing, consider tightening stops or taking partial profits
โถ Bearish Acceleration (Bright Red): Fast ribbon below slow ribbon AND fast ribbon falling, indicating confirmed downtrend with building momentum = Strongest bearish condition, ideal for new short entries, exiting longs, or maintaining defensive positioning
โถ Bearish Deceleration (Dark Red): Fast ribbon below slow ribbon BUT fast ribbon rising, indicating downtrend intact but momentum weakening = Caution signal for shorts, potential trend exhaustion developing, prepare for possible reversal or consolidation
โถ Bullish Crossover: Fast ribbon crosses above slow ribbon, signaling trend reversal from bearish to bullish and initiation of new upward momentum phase = Primary buy signal, entry opportunity for trend-following strategies, exit signal for short positions
โถ Bearish Crossover: Fast ribbon crosses below slow ribbon, signaling trend reversal from bullish to bearish and initiation of new downward momentum phase = Primary sell signal, entry opportunity for short strategies, exit signal for long positions
โถ Ribbon Spread Width: Distance between fast and slow ribbons indicates trend strength and conviction, where wider spreads suggest strong, sustained directional movement with low reversal probability, while tight or converging ribbons indicate weak trends, consolidation, or impending reversal conditions
โถ Bar Color Alignment: When bar coloring is enabled, candlestick colors mirror the ribbon state providing immediate visual confirmation of momentum conditions directly on price action, eliminating the need to reference the indicator separately and enabling faster decision-making during active trading
๐ข Features
โถ Preconfigured Presets: Three optimized parameter configurations accommodate different trading styles, timeframes, and market analysis approaches: "Default" provides balanced trend identification suitable for swing trading on 4-hour and daily charts, "Fast Response" delivers heightened sensitivity optimized for intraday trading and scalping on 5-minute to 1-hour charts, and "Smooth Trend" offers conservative trend identification ideal for position trading and long-term analysis on daily to weekly charts.
โถ Built-in Alerts: Three alert conditions enable comprehensive automated monitoring of trend reversals and momentum transitions. "Bullish Crossover" triggers when the fast ribbon crosses above the slow ribbon, signaling the shift from downtrend to uptrend and the beginning of bullish momentum building. "Bearish Crossover" activates when the fast ribbon crosses below the slow ribbon, signaling the shift from uptrend to downtrend and the beginning of bearish momentum building. "Any Ribbon Crossover" provides a combined notification for either bullish or bearish crossover regardless of direction, useful for general trend reversal monitoring and ensuring no momentum shift goes unnoticed.
โถ Color Customization: Six visual themes (Classic, Aqua, Cosmic, Cyber, Neon, plus Custom) accommodate different chart backgrounds and visual preferences, ensuring optimal contrast and immediate identification of acceleration versus deceleration states across various devices and screen sizes. Each preset uses distinct colors for the four momentum states (bullish acceleration, bullish deceleration, bearish acceleration, bearish deceleration) with proper visual hierarchy. Optional bar coloring with adjustable transparency provides instant visual context of current momentum state and trend direction without switching between the price pane and indicator pane, enabling traders and investors to immediately assess trend positioning and acceleration dynamics while analyzing price action patterns and support/resistance levels.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source verรถffentlicht. Auf diese Weise kรถnnen nun auch andere Trader das Script rezensieren und die Funktionalitรคt รผberprรผfen. Vielen Dank an den Autor! Sie kรถnnen das Script kostenlos verwenden, aber eine Wiederverรถffentlichung des Codes unterliegt unseren Hausregeln.
๐ Access our best trading & investing tools here (3-day FREE trial): whop.com/quantalgo/
Haftungsausschluss
Die Informationen und Verรถffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlรคgen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source verรถffentlicht. Auf diese Weise kรถnnen nun auch andere Trader das Script rezensieren und die Funktionalitรคt รผberprรผfen. Vielen Dank an den Autor! Sie kรถnnen das Script kostenlos verwenden, aber eine Wiederverรถffentlichung des Codes unterliegt unseren Hausregeln.
๐ Access our best trading & investing tools here (3-day FREE trial): whop.com/quantalgo/
Haftungsausschluss
Die Informationen und Verรถffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlรคgen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.