OPEN-SOURCE SCRIPT
Kernel Regression Trend Line

KTrend – Non-Repainting Kernel Regression Trend (2025 Clean Version)
Ultra-clean, powerful, and completely non-repainting trend-following tool based on advanced Kernel regression (Rational Quadratic + Gaussian blend).
How it works:
• Uses two different kernel estimates with smart lag to detect genuine trend reversals
• Plots a thick, beautifully colored trend line (teal when rising, deep red when falling)
• Places precise, locked-in Bullish Flip (green triangle below bar) and Bearish Flip (red triangle above bar) signals only on confirmed bar close – zero repaint, ever
• Optional smoothing mode for even cleaner visuals
Features
✓ 100% non-repainting signals and line
✓ Minimal lag while staying extremely responsive
✓ Clean aesthetic – perfect for BTC, ETH, stocks, forex, any timeframe
✓ Built-in alerts for Bullish & Bearish flips
✓ Fully open source (MPL 2.0)
Default settings are already battle-tested and loved by thousands:
- Lookback Window: 11
- Relative Weighting: 8.0
- Regression Level: 25
- Lag: 2
Great on 1H–Daily charts, especially crypto and indices.
Credits: Original kernel library by jdehorty, cleaned & enhanced flip logic by HighlanderOne.
Enjoy the smoothest, most reliable kernel trend tool on TradingView – completely free!
Ultra-clean, powerful, and completely non-repainting trend-following tool based on advanced Kernel regression (Rational Quadratic + Gaussian blend).
How it works:
• Uses two different kernel estimates with smart lag to detect genuine trend reversals
• Plots a thick, beautifully colored trend line (teal when rising, deep red when falling)
• Places precise, locked-in Bullish Flip (green triangle below bar) and Bearish Flip (red triangle above bar) signals only on confirmed bar close – zero repaint, ever
• Optional smoothing mode for even cleaner visuals
Features
✓ 100% non-repainting signals and line
✓ Minimal lag while staying extremely responsive
✓ Clean aesthetic – perfect for BTC, ETH, stocks, forex, any timeframe
✓ Built-in alerts for Bullish & Bearish flips
✓ Fully open source (MPL 2.0)
Default settings are already battle-tested and loved by thousands:
- Lookback Window: 11
- Relative Weighting: 8.0
- Regression Level: 25
- Lag: 2
Great on 1H–Daily charts, especially crypto and indices.
Credits: Original kernel library by jdehorty, cleaned & enhanced flip logic by HighlanderOne.
Enjoy the smoothest, most reliable kernel trend tool on TradingView – completely free!
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.