OPEN-SOURCE SCRIPT
ATR Trailing Stop

ATR Trailing Stop (Dynamic Volatility Regimes)
==============================================
This indicator implements an adaptive ATR-based trailing stop for long positions. The stop automatically adjusts based on stock volatility, tightening during fast movements and widening during calm periods. It is designed as a trade management tool to help protect profits while staying aligned with strong trends.
How It Works
------------
* Tracks the highest high over a configurable lookback window and ensures this “top” never moves downward.
* Computes the trailing stop as:**Top – ATR × Dynamic Multiplier**
* The ATR multiplier changes depending on volatility:
* Low volatility → Wide stop (slower trailing)
* Medium volatility → Standard trailing
* High volatility → Tight stop (faster trailing)
* The trailing stop only moves upward; it never decreases.
* If price falls significantly below the stop (default: 5%), the system resets and begins trailing from a new top.
* An optional price-scale label displays:
* Current stop value
* Volatility regime (LOW / MID / HIGH)
* ATR percentage and active multiplier
Alerts
------
Two alert conditions are included:
### Trailing Stop – Near
Triggers when price moves within a user-defined percentage above the stop.
### Trailing Stop – Hit
Triggers when price touches or closes below the stop.
How to Use
----------
1. Add the indicator to any chart (daily timeframe recommended).
2. Configure:
* ATR length
* Lookback bars
* Volatility thresholds
* ATR multipliers
3. Set alerts for early warnings or stop-hit events.
4. Use the stop line as a dynamic risk-management tool to guide exit decisions and protect profits.
Notes
-----
* Designed for long-only trailing logic.
* This indicator does not generate entry signals; it is intended for stop management.
==============================================
This indicator implements an adaptive ATR-based trailing stop for long positions. The stop automatically adjusts based on stock volatility, tightening during fast movements and widening during calm periods. It is designed as a trade management tool to help protect profits while staying aligned with strong trends.
How It Works
------------
* Tracks the highest high over a configurable lookback window and ensures this “top” never moves downward.
* Computes the trailing stop as:**Top – ATR × Dynamic Multiplier**
* The ATR multiplier changes depending on volatility:
* Low volatility → Wide stop (slower trailing)
* Medium volatility → Standard trailing
* High volatility → Tight stop (faster trailing)
* The trailing stop only moves upward; it never decreases.
* If price falls significantly below the stop (default: 5%), the system resets and begins trailing from a new top.
* An optional price-scale label displays:
* Current stop value
* Volatility regime (LOW / MID / HIGH)
* ATR percentage and active multiplier
Alerts
------
Two alert conditions are included:
### Trailing Stop – Near
Triggers when price moves within a user-defined percentage above the stop.
### Trailing Stop – Hit
Triggers when price touches or closes below the stop.
How to Use
----------
1. Add the indicator to any chart (daily timeframe recommended).
2. Configure:
* ATR length
* Lookback bars
* Volatility thresholds
* ATR multipliers
3. Set alerts for early warnings or stop-hit events.
4. Use the stop line as a dynamic risk-management tool to guide exit decisions and protect profits.
Notes
-----
* Designed for long-only trailing logic.
* This indicator does not generate entry signals; it is intended for stop management.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.