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.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.