OPEN-SOURCE SCRIPT
Length Adaptive MA SuperTrend

Length Adaptive MA SuperTrend
Length Adaptive MA SuperTrend is a third-generation evolution of the SuperTrend concept, designed to improve signal accuracy while maintaining high responsiveness across different market conditions. The indicator dynamically adjusts its moving-average length to better match current market activity, allowing it to react quickly in fast markets while remaining stable during slower phases.
This adaptive behavior helps traders and investors visualize trend direction more clearly while reducing unnecessary noise, making the tool suitable for both beginners and advanced users seeking a responsive trend overlay.
🔍 How It Works
The indicator uses a moving average as the foundation for a SuperTrend-style structure, but instead of keeping the moving-average length fixed, it continuously adapts to changing market environments.
The script compares average activity levels across three horizons:
• Long-term period
• Medium-term period (half length)
• Short-term period (square-root length)
Activity is measured using one of three selectable drivers:
• ATR (volatility)
• Volume
• Standard deviation
Whichever period shows the strongest average activity becomes the active length used for calculating the moving-average base. This allows the indicator to automatically shift between faster and slower behavior depending on market conditions.
After selecting the active length, the result is slightly smoothed using the chosen moving-average type to produce a cleaner and more stable trend structure.
ATR-based bands are then applied around the adaptive base, and trend direction changes when price crosses these bands.
⚙️ Key Features
• Adaptive moving-average length selection
• Automatic adjustment between short, medium, and long market conditions
• Multiple smoothing types (SMA, EMA, WMA, HMA, VWMA, DEMA, TEMA, EWMA)
• ATR-based SuperTrend structure
• Trend transition markers
• Optional candle coloring based on active trend
🧩 Inputs Overview
• Moving-average smoothing type
• Base length and price source
• ATR length and multiplier
• Adaptive driver selection (ATR, Volume, or Standard Deviation)
📌 Usage Notes
• Helps visualize prevailing market trends across changing environments.
• Automatically adapts speed for trending and consolidating markets.
• Signals may change intrabar on lower timeframes.
• Best used with confirmation tools and proper risk management.
• Intended as an analytical tool, not financial advice.
Length Adaptive MA SuperTrend is a third-generation evolution of the SuperTrend concept, designed to improve signal accuracy while maintaining high responsiveness across different market conditions. The indicator dynamically adjusts its moving-average length to better match current market activity, allowing it to react quickly in fast markets while remaining stable during slower phases.
This adaptive behavior helps traders and investors visualize trend direction more clearly while reducing unnecessary noise, making the tool suitable for both beginners and advanced users seeking a responsive trend overlay.
🔍 How It Works
The indicator uses a moving average as the foundation for a SuperTrend-style structure, but instead of keeping the moving-average length fixed, it continuously adapts to changing market environments.
The script compares average activity levels across three horizons:
• Long-term period
• Medium-term period (half length)
• Short-term period (square-root length)
Activity is measured using one of three selectable drivers:
• ATR (volatility)
• Volume
• Standard deviation
Whichever period shows the strongest average activity becomes the active length used for calculating the moving-average base. This allows the indicator to automatically shift between faster and slower behavior depending on market conditions.
After selecting the active length, the result is slightly smoothed using the chosen moving-average type to produce a cleaner and more stable trend structure.
ATR-based bands are then applied around the adaptive base, and trend direction changes when price crosses these bands.
⚙️ Key Features
• Adaptive moving-average length selection
• Automatic adjustment between short, medium, and long market conditions
• Multiple smoothing types (SMA, EMA, WMA, HMA, VWMA, DEMA, TEMA, EWMA)
• ATR-based SuperTrend structure
• Trend transition markers
• Optional candle coloring based on active trend
🧩 Inputs Overview
• Moving-average smoothing type
• Base length and price source
• ATR length and multiplier
• Adaptive driver selection (ATR, Volume, or Standard Deviation)
📌 Usage Notes
• Helps visualize prevailing market trends across changing environments.
• Automatically adapts speed for trending and consolidating markets.
• Signals may change intrabar on lower timeframes.
• Best used with confirmation tools and proper risk management.
• Intended as an analytical tool, not financial advice.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
"Better to take a step back, than to stand stuck forever."
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
"Better to take a step back, than to stand stuck forever."
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.