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.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
"Better to take a step back, than to stand stuck forever."
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
"Better to take a step back, than to stand stuck forever."
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.