OPEN-SOURCE SCRIPT
SuperTrend AI Adaptive

SuperTrend AI detects market regime shifts and adapts the band width automatically, then scores every trend flip with a 5-factor quality engine so you know which signals to trust.
◈ How It Works
Standard SuperTrend has one fixed multiplier. It works great in trending markets but gets chopped apart in ranging conditions. This version solves that by detecting the current market regime and adapting in real time.
The indicator classifies every bar into one of three regimes:
TRENDING: ADX above threshold + normal ATR. Multiplier stays at base. SuperTrend works as intended.
RANGING: ADX below threshold + compressed ATR. Multiplier tightens slightly for faster response. Band draws as a dotted line to warn you.
VOLATILE: ATR expanding well above its historical average. Multiplier widens to absorb the noise and prevent false flips.
The regime is determined by two factors: the ATR ratio (current ATR vs its moving average over the lookback period) and the ADX reading. This gives you a structural view of market conditions, not just price direction.
◈ Adaptive Multiplier
When adaptation is enabled, the multiplier adjusts dynamically:
In volatile regimes, the multiplier increases proportionally to how expanded the ATR is. This widens the band and filters out noise-driven flips.
In ranging regimes, the multiplier drops to 85% of base. Tighter bands let you catch the transition when a real trend starts.
In trending regimes, the multiplier stays at base. No adjustment needed when conditions are ideal.
The multiplier is capped between 0.5x and 2x of your base setting so it never goes extreme. You can see the current adaptive multiplier in the dashboard at all times.
◈ AI Signal Scoring
Every SuperTrend flip gets a quality score from 0 to 100 based on 5 factors:
Volume Surge (0-20 pts): Volume on the flip bar vs 20-period average. Higher volume = more conviction behind the move.
Displacement (0-25 pts): How far price closed beyond the band on the flip. Bigger displacement = stronger breakout.
Trend Alignment (0-20 pts): Does the flip direction match the EMA trend? Aligned signals score higher.
Regime Quality (0-15 pts): Signals in trending regimes score highest. Ranging regime signals get penalized.
Band Distance (0-20 pts): How far price traveled to reach the band before flipping. Wider gap = more conviction.
Bright signals (★) score above 70 and represent high-quality flips with multiple factors confirming. Dim signals (○) score 40-69 and are worth watching but carry more risk. By default only bright signals display.
◈ Visual System
The band uses a neon glow effect (three layered plots) that makes it easy to track on any chart. The band color itself tells you the current regime at a glance:
Green/red glow = trending regime, normal SuperTrend behavior.
Amber glow = volatile regime, multiplier has widened to absorb noise.
Gray dotted line = ranging regime, multiplier tightened, use caution.
A subtle background tint appears during volatile (amber) and ranging (gray) periods so you can see regime context without looking at the dashboard. Both the glow and background tint can be toggled off in settings.
The gradient fill between price and band is available but off by default. Enable it in settings if you prefer that style.
◈ How to Read the Dashboard
ST AI ◈: header
Trend: current SuperTrend direction (▲ BULLISH / ▼ BEARISH) with bias label
Regime: current market classification (TRENDING / VOLATILE / RANGING) with ATR ratio
EMA: whether the trend EMA agrees with SuperTrend direction (✓ ALIGNED / ✗ COUNTER)
Multiplier: current adaptive value vs your base setting
ADX: trend strength reading with visual bar
Signal: last signal state with score in points
◈ Recommended Settings
Forex (EUR/USD, GBP/JPY) 1H to 4H: ATR 10, Multiplier 3.0, Regime Lookback 40, ADX 14
Crypto (BTC, ETH) 1H to 4H: ATR 10, Multiplier 3.0, Regime Lookback 50, ADX 14
Scalping 5min to 15min: ATR 7, Multiplier 2.0, Regime Lookback 30, ADX 10
Swing trading Daily: ATR 14, Multiplier 3.5, Regime Lookback 50, ADX 14
Indices (NAS100, SPX500) 15min to 1H: ATR 10, Multiplier 2.5, Regime Lookback 40, ADX 14
For fewer signals: Raise Min Signal Score to 60+, increase cooldown
For more signals: Lower Min Signal Score to 30, enable dim signals, reduce cooldown
◈ Key Features
✓ Non-repainting: all signals on confirmed bar close
✓ Regime-adaptive: multiplier adjusts to trending, ranging, and volatile conditions automatically
✓ AI signal scoring: 5-factor quality engine, 0-100 per flip
✓ Neon glow band: color shifts with regime state, visible at a glance
✓ Regime background: subtle tint shows volatile and ranging periods on the chart
✓ ADX integration: trend strength directly influences regime detection and scoring
✓ 7 alert conditions: bull/bear signals, AI-confirmed signals, trend flips, regime changes
✓ Clean dashboard: trend, regime, multiplier, ADX, and signal score in one panel
✓ 100% original code: not derived from any existing script
◈ What Makes This Different
Standard SuperTrend uses a fixed multiplier. It works until the market changes character, then gives false flips until you manually adjust. This version detects the change and adjusts for you.
The scoring tells you not just that a flip happened, but whether it is likely to be meaningful. A flip during a trending regime with high volume and strong displacement scores 85+. The same flip during a ranging regime with weak volume might score 45. Both are flips, but only one is worth trading.
◈ Disclaimer
No indicator predicts the future. Regime detection is probabilistic, not certain. Use proper risk management and combine with your own analysis. Past performance does not guarantee future results.
Happy trading.
◈ How It Works
Standard SuperTrend has one fixed multiplier. It works great in trending markets but gets chopped apart in ranging conditions. This version solves that by detecting the current market regime and adapting in real time.
The indicator classifies every bar into one of three regimes:
TRENDING: ADX above threshold + normal ATR. Multiplier stays at base. SuperTrend works as intended.
RANGING: ADX below threshold + compressed ATR. Multiplier tightens slightly for faster response. Band draws as a dotted line to warn you.
VOLATILE: ATR expanding well above its historical average. Multiplier widens to absorb the noise and prevent false flips.
The regime is determined by two factors: the ATR ratio (current ATR vs its moving average over the lookback period) and the ADX reading. This gives you a structural view of market conditions, not just price direction.
◈ Adaptive Multiplier
When adaptation is enabled, the multiplier adjusts dynamically:
In volatile regimes, the multiplier increases proportionally to how expanded the ATR is. This widens the band and filters out noise-driven flips.
In ranging regimes, the multiplier drops to 85% of base. Tighter bands let you catch the transition when a real trend starts.
In trending regimes, the multiplier stays at base. No adjustment needed when conditions are ideal.
The multiplier is capped between 0.5x and 2x of your base setting so it never goes extreme. You can see the current adaptive multiplier in the dashboard at all times.
◈ AI Signal Scoring
Every SuperTrend flip gets a quality score from 0 to 100 based on 5 factors:
Volume Surge (0-20 pts): Volume on the flip bar vs 20-period average. Higher volume = more conviction behind the move.
Displacement (0-25 pts): How far price closed beyond the band on the flip. Bigger displacement = stronger breakout.
Trend Alignment (0-20 pts): Does the flip direction match the EMA trend? Aligned signals score higher.
Regime Quality (0-15 pts): Signals in trending regimes score highest. Ranging regime signals get penalized.
Band Distance (0-20 pts): How far price traveled to reach the band before flipping. Wider gap = more conviction.
Bright signals (★) score above 70 and represent high-quality flips with multiple factors confirming. Dim signals (○) score 40-69 and are worth watching but carry more risk. By default only bright signals display.
◈ Visual System
The band uses a neon glow effect (three layered plots) that makes it easy to track on any chart. The band color itself tells you the current regime at a glance:
Green/red glow = trending regime, normal SuperTrend behavior.
Amber glow = volatile regime, multiplier has widened to absorb noise.
Gray dotted line = ranging regime, multiplier tightened, use caution.
A subtle background tint appears during volatile (amber) and ranging (gray) periods so you can see regime context without looking at the dashboard. Both the glow and background tint can be toggled off in settings.
The gradient fill between price and band is available but off by default. Enable it in settings if you prefer that style.
◈ How to Read the Dashboard
ST AI ◈: header
Trend: current SuperTrend direction (▲ BULLISH / ▼ BEARISH) with bias label
Regime: current market classification (TRENDING / VOLATILE / RANGING) with ATR ratio
EMA: whether the trend EMA agrees with SuperTrend direction (✓ ALIGNED / ✗ COUNTER)
Multiplier: current adaptive value vs your base setting
ADX: trend strength reading with visual bar
Signal: last signal state with score in points
◈ Recommended Settings
Forex (EUR/USD, GBP/JPY) 1H to 4H: ATR 10, Multiplier 3.0, Regime Lookback 40, ADX 14
Crypto (BTC, ETH) 1H to 4H: ATR 10, Multiplier 3.0, Regime Lookback 50, ADX 14
Scalping 5min to 15min: ATR 7, Multiplier 2.0, Regime Lookback 30, ADX 10
Swing trading Daily: ATR 14, Multiplier 3.5, Regime Lookback 50, ADX 14
Indices (NAS100, SPX500) 15min to 1H: ATR 10, Multiplier 2.5, Regime Lookback 40, ADX 14
For fewer signals: Raise Min Signal Score to 60+, increase cooldown
For more signals: Lower Min Signal Score to 30, enable dim signals, reduce cooldown
◈ Key Features
✓ Non-repainting: all signals on confirmed bar close
✓ Regime-adaptive: multiplier adjusts to trending, ranging, and volatile conditions automatically
✓ AI signal scoring: 5-factor quality engine, 0-100 per flip
✓ Neon glow band: color shifts with regime state, visible at a glance
✓ Regime background: subtle tint shows volatile and ranging periods on the chart
✓ ADX integration: trend strength directly influences regime detection and scoring
✓ 7 alert conditions: bull/bear signals, AI-confirmed signals, trend flips, regime changes
✓ Clean dashboard: trend, regime, multiplier, ADX, and signal score in one panel
✓ 100% original code: not derived from any existing script
◈ What Makes This Different
Standard SuperTrend uses a fixed multiplier. It works until the market changes character, then gives false flips until you manually adjust. This version detects the change and adjusts for you.
The scoring tells you not just that a flip happened, but whether it is likely to be meaningful. A flip during a trending regime with high volume and strong displacement scores 85+. The same flip during a ranging regime with weak volume might score 45. Both are flips, but only one is worth trading.
◈ Disclaimer
No indicator predicts the future. Regime detection is probabilistic, not certain. Use proper risk management and combine with your own analysis. Past performance does not guarantee future results.
Happy trading.
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 cualquier republicación del código está sujeta a nuestras Normas internas.
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 u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga 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 cualquier republicación del código está sujeta a nuestras Normas internas.
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 u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.