OPEN-SOURCE SCRIPT
Supertrend by JKR

Supertrend by JKR is a trend-following overlay that plots dynamic support/resistance bands around price and flips when the trend changes.
It builds a smoothed baseline using your selected moving average type (SMA, TMA, WMA, VWMA, TEMA, HMA, EMA, or VMA). Around this baseline, it computes a volatility/range offset (classic ATR mode or Dual-Thrust range mode) and creates two trailing bands:
When price closes beyond the active band, the indicator flips trend direction and switches to the opposite band. While the trend remains active, the band “trails” price and updates in a way that avoids stepping backwards, which helps keep the trend structure clean and stable.
Options
Tip: Increase the Multiplier to reduce flips and widen bands; reduce Period to make the trend more responsive.
It builds a smoothed baseline using your selected moving average type (SMA, TMA, WMA, VWMA, TEMA, HMA, EMA, or VMA). Around this baseline, it computes a volatility/range offset (classic ATR mode or Dual-Thrust range mode) and creates two trailing bands:
UpTrend band (active during bullish conditions)
DownTrend band (active during bearish conditions)
When price closes beyond the active band, the indicator flips trend direction and switches to the opposite band. While the trend remains active, the band “trails” price and updates in a way that avoids stepping backwards, which helps keep the trend structure clean and stable.
Options
Trend-change arrows (optional)
Bar coloring or candle overlay (optional)
Designed to evaluate on bar close for stable signals
Tip: Increase the Multiplier to reduce flips and widen bands; reduce Period to make the trend more responsive.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.