OPEN-SOURCE SCRIPT
ATR Trailing + Alerts + Price Labels

ATR Trend is a clean and intelligent trend-following overlay built for traders who want clarity during both trending and ranging markets.
This indicator dynamically detects bullish and bearish market trends using the Average True Range (ATR), applying a confirmation-based approach to filter out false signals and minor pullbacks.
The trend line is:
Blue 🔵 during uptrends.
Black ⚫ during downtrends.
Continuous, recalculating only when the market truly shifts — not just when price temporarily crosses the line.
When a confirmed trend reversal occurs:
A 🔼 or 🔽 label shows the exact price of the flip.
An alert can be triggered to notify the user immediately.
💡 Features:
✅ Single-line trend direction
✅ Filters out short-term noise
✅ Exact price labeling on trend change
✅ Built-in alerts for up/down trend shifts
⚙️ Inputs:
ATR Period – Length of ATR calculation (default: 14)
ATR Multiplier – Offset for trend line placement (default: 2.0)
Flip Sensitivity – Number of bars required to confirm a trend reversal (default: 3)
This tool is suitable for:
Swing traders avoid false breakouts
Scalpers looking for high-probability trend entries
Algorithmic setups requiring structured trend logic
This indicator dynamically detects bullish and bearish market trends using the Average True Range (ATR), applying a confirmation-based approach to filter out false signals and minor pullbacks.
The trend line is:
Blue 🔵 during uptrends.
Black ⚫ during downtrends.
Continuous, recalculating only when the market truly shifts — not just when price temporarily crosses the line.
When a confirmed trend reversal occurs:
A 🔼 or 🔽 label shows the exact price of the flip.
An alert can be triggered to notify the user immediately.
💡 Features:
✅ Single-line trend direction
✅ Filters out short-term noise
✅ Exact price labeling on trend change
✅ Built-in alerts for up/down trend shifts
⚙️ Inputs:
ATR Period – Length of ATR calculation (default: 14)
ATR Multiplier – Offset for trend line placement (default: 2.0)
Flip Sensitivity – Number of bars required to confirm a trend reversal (default: 3)
This tool is suitable for:
Swing traders avoid false breakouts
Scalpers looking for high-probability trend entries
Algorithmic setups requiring structured trend logic
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.