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 sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.