PTI 2025: ATR TREND TRACKER

This indicator helps traders follow trends while managing risk using a dynamic trailing stop based on volatility (ATR). It also adds a higher timeframe trend filter to avoid trading against the major trend.
How It Works
1. ATR Trailing Stop (Main Mechanism)
Calculates the Average True Range (ATR) over a long period (default: 250 bars).
Sets a trailing stop level at a multiple (default: 3x) of the ATR.
If price rises, the stop moves up, locking in profits.
If price falls, the stop stays fixed until broken.
The stop flips direction when price crosses it.
2. Higher Timeframe Trend Filter (Extra Confirmation)
Checks if the Daily (or selected HTF) close is above/below a 200-period EMA.
Green background = Uptrend (favor long trades).
Red background = Downtrend (favor short trades).
Optional: Can disable this filter if you want pure ATR signals.
3. Buy & Sell Signals
Buy Signal → Price crosses above the ATR stop + HTF trend is up (if filter is on).
Sell Signal → Price crosses below the ATR stop + HTF trend is down (if filter is on).
4. Visuals & Alerts
Trailing Stop Line (changes color based on trend direction).
Buy/Sell Labels (appear below/above candles).
Alerts (can notify you when signals trigger).
UPDATE RELEASE
What has been updated?
- BAR COLOR: When the signal is activated, the candlestick becomes white (or a selectable color from style settings)
- SIGNAL BAR STYLING: When the background is green, it means that the higher timeframe trend is uptrend, then the sell signals decrease in color intensity, and vice versa when the background is red it means that the higher timeframe trend is downtrend, then the buy signals decrease in color intensity.
(color and intensity selectable from input settings).
- SIGNAL ACTIVATION FIXED: now the signals are activated and do not disappear after the next signal is activated.
PERSONAL CONSIDERATION: you must always analyze the chart and the price where it is, always consider pullback, trendlines, support and resistance.
ADVANTAGE:
- When background is green try to take only buy signals
- When background is red try to take only sell signals.
UPDATE RELEASED
WHAT HAS CHANGED WITH THE NEW UPDATE?
- SIGNALS:
1 - WHEN THE BACKGROUND IS RED (DOWNTREND) YOU WILL ONLY RECEIVE SELL SIGNALS
2 - WHEN THE BACKGROUND IS GREEN (UPTREND) YOU WILL ONLY RECEIVE BUY SIGNALS
FROM INPUT YOU CAN STILL DISABLE THE POSSIBILITY OF MASKING THE SIGNALS AND RECEIVE ALL OF THEM.
- ALERTS:
1 - WHEN THE BACKGROUND IS RED YOU WILL ONLY RECEIVE ALERTS FOR SELL SIGNALS
2 - WHEN THE BACKGROUND IS GREEN YOU WILL ONLY RECEIVE ALERTS FOR BUY SIGNALS.
IF MASK CONDITION IS DISABLED, YOU WILL RECEIVE ALERTS FOR ALL SIGNALS.
UPDATE RELEASED
WHAT'S UPDATED?
Added a SIDEWAYS condition for signal noise reduction. Now the output signals will be less and more specific to the chart.
background calulation changed to have a better upload on the chart.
possibility to change the settings from inputs
INDICATOR MORE STABLE WITH SIGNALS CONFIRMATION
- ADDED SIDEWAYS DETECTION SYSTEM TO AVOIND SIGNALS DURING SIDEWAY TREND.
INDICATOR CODE HAS BEEN UPDATED WITH SOME CHNAGES REGARDING THE INDICATOR CONFIGURATION AND VISUAL CONFIGURATION TO MAKE MORE EASY UNDERSTAND
- ADDED ALSO POSSIBILITY TO HAVE PLOTTED AN EMA TO THE CHART, TO UNDERSTAND BETTER THE HIGHER TIMEFRAME POSITION
- ABOVE EMA = UPTREND = BUY
- BELOW EMA = DOWNTREND = SELL
UPDATE RELASED
- ADDED EMA LINE: EMA HELPING TRADER TO FOUND THE TREND AT HIGHER TIMEFRAME EASLY.
Skrip jemputan sahaja
Hanya pengguna yang diberikan kebenaran oleh penulis mempunyai akses kepada skrip ini dan ini selalunya memerlukan pembayaran. Anda boleh menambahkan skrip kepada kegemaran anda tetapi anda hanya boleh menggunakannya selepas meminta kebenaran dan mendapatkannya daripada penulis — ketarhui lebih lanjut di sini. Untuk lebih butiran, ikuti arahan penulis di bawah atau hubungi PIONEER-TRADER secara terus.
TradingView tidak menyarankan pembayaran untuk atau menggunakan skrip kecuali anda benar-benar mempercayai penulisnya dan memahami bagaimana ia berfungsi. Anda juga boleh mendapatkan alternatif sumber terbuka lain yang percuma dalam skrip komuniti kami.
Arahan penulis
Amaran: sila baca panduan kami untuk skrip jemputan sahaja sebelum memohon akses.
Penafian
Skrip jemputan sahaja
Hanya pengguna yang diberikan kebenaran oleh penulis mempunyai akses kepada skrip ini dan ini selalunya memerlukan pembayaran. Anda boleh menambahkan skrip kepada kegemaran anda tetapi anda hanya boleh menggunakannya selepas meminta kebenaran dan mendapatkannya daripada penulis — ketarhui lebih lanjut di sini. Untuk lebih butiran, ikuti arahan penulis di bawah atau hubungi PIONEER-TRADER secara terus.
TradingView tidak menyarankan pembayaran untuk atau menggunakan skrip kecuali anda benar-benar mempercayai penulisnya dan memahami bagaimana ia berfungsi. Anda juga boleh mendapatkan alternatif sumber terbuka lain yang percuma dalam skrip komuniti kami.
Arahan penulis
Amaran: sila baca panduan kami untuk skrip jemputan sahaja sebelum memohon akses.