OPEN-SOURCE SCRIPT
Telah dikemas kini

ATR Stop Loss Non-Decreasing & Line

340
The script calculates a custom stop-loss level based on the Average True Range (ATR) indicator, ensuring that this stop-loss level never decreases from one bar to the next unless a reset condition is met. It also visually displays the ATR value and the calculated stop-loss level as a line on the chart.
Nota Keluaran
This indicator implements an adaptive ATR-based stop loss and take profit system designed for flexible trade management directly on the chart. It calculates trailing stop levels using the Average True Range (ATR), a volatility measure which helps dynamically adjust stop distances to current market conditions.

Key features:

ATR Calculation: Uses user-configurable ATR period and multiplier inputs to scale stop levels.

Flexible Trailing Modes: Offers two modes for managing the stop levels:

Non-Decreasing mode for the low level, which ensures the trailing stop only moves upward or stays flat to lock in gains.

Non-Increasing mode for the high level, ensuring the stop only moves downward or stays flat.

Dynamic Reset: Resets trailing stops if price closes beyond the current trail, allowing adaptation to new price action.

Visual Clarity: Plots trailing stop levels on the price chart with clear color coding (red for low stops, yellow for high stops) and draws corresponding stop lines for visual monitoring.

Overlay and Status Visualization: The ATR value is shown in the status line for quick reference.

How it works:
The script calculates candidate stop levels by adding/subtracting a multiple of ATR from current highs and lows. Depending on the selected mode, the trailing stops either lock in favorable price movement or reset when surpassed by price, making it suitable for trend-following or range-bound trading styles. This method leverages market volatility to automatically adjust stops, helping traders protect profits and manage risk more effectively than static stops.

Use cases:

Traders seeking automated volatility-based stop loss and take profit zones.

Those who want a stop system that adapts to changing market conditions.

Users preferring configurable trailing modes for custom behavior.

Intraday and swing traders looking for clear visual stop references on charts.

This script does not execute orders but serves as a visual and analytical tool to complement trading decisions by representing ATR-based stop zones dynamically.

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.