OPEN-SOURCE SCRIPT
Обновлено ATR Stop-Loss & Targets

ATR and Supertrend-based SL/TP & Trailing System
This indicator combines Average True Range (ATR) and Supertrend logic to help traders define precise stop-loss, first target, and trailing stop-loss (TSL) levels.
⚙️ Key Features:
📏 ATR-based Stop-Loss & Target Lines:
Uses ATR (default period: 5) based on the previous day's candle for more stable risk management.
Multiplier 1 = Stop Loss
Multiplier 2 = First Target
Uses ATR(10) with a multiplier of 2.1, based on HL2.
Supertrend can be toggled ON/OFF from the settings.
This indicator combines Average True Range (ATR) and Supertrend logic to help traders define precise stop-loss, first target, and trailing stop-loss (TSL) levels.
⚙️ Key Features:
📏 ATR-based Stop-Loss & Target Lines:
Uses ATR (default period: 5) based on the previous day's candle for more stable risk management.
- Traders can choose the price source: Close, Open, or enter a manual price.
- SL and first target are calculated using multipliers:
Multiplier 1 = Stop Loss
Multiplier 2 = First Target
- 📉 Supertrend for Trailing Stop:
- Built-in Supertrend logic for trailing stop-loss management.
Uses ATR(10) with a multiplier of 2.1, based on HL2.
Supertrend can be toggled ON/OFF from the settings.
Информация о релизе
Overview: This free indicator combines ATR-based Stop Loss and Targets with a Supertrend-based Trailing Stop Loss, giving traders an all-in-one system for defining their risk, entry size, and managing trailing exits automatically.It is designed to help traders quickly determine:
- Optimal Stop-Loss and Target levels based on volatility (ATR)
- Correct position size based on maximum loss they can afford
- Dynamic trailing stop-loss using a Supertrend
⚙️ How It Works:
1️⃣ ATR-Based Stop-Loss and Target Levels
- The indicator calculates ATR (Average True Range) with a default period of 5.
- You can choose if ATR is calculated based on the current candle or the previous candle.
- Two multipliers are applied:
- Multiplier 1: For Stop-Loss
- Multiplier 2: For First Target
Input Options Available:
- Price Source: Choose from Close, Open, or manually enter a custom price. Default value is Close
- ATR Source Candle: Select Current or Previous. Default is Previous candle
- ATR Period: Default is 5 (modifiable).
- Multipliers: Set your desired levels for Stop-Loss and Target individually.
✨ Visualization:
- Horizontal lines are drawn for both Stop-Loss and First Target levels.
- Color and style of the lines are customizable (solid, dashed, dotted).
- Labels at the end of each line show exact price values.
2️⃣ Maximum Loss Control (Position Size Calculation)
- You can input a Max Loss Amount (default: 10,000).
- The system automatically calculates:
- Risk per share = difference between entry price and stop-loss.
- Position Size = (Max Loss) ÷ (Risk per share).
- Actual Calculated Loss = (Position Size × Risk per share).
✨ Visualization:
- A floating label below the candles displays:
- Position Size (rounded to nearest whole number)
- Actual Calculated Loss (based on real size, not estimation)
- Toggle ON/OFF the label using settings.
3️⃣ Supertrend Trailing Stop-Loss
- Built-in Supertrend using:
ATR Period = 10
ATR Multiplier = 2.1
Source = HL2 (High + Low / 2)
- You can choose to:
Enable or disable Supertrend
Highlight background based on trend direction
Show Buy/Sell Signals
- Alerts are available when Supertrend switches direction.
✨ Visualization:
- Uptrend = Green Supertrend Line
- Downtrend = Orange Supertrend Line
- Optional: Highlight background colors depending on trend.
Информация о релизе
Overview: This free indicator combines ATR-based Stop Loss and Targets with a Supertrend-based Trailing Stop Loss, giving traders an all-in-one system for defining their risk, entry size, and managing trailing exits automatically.It is designed to help traders quickly determine:
- Optimal Stop-Loss and Target levels based on volatility (ATR)
- Correct position size based on maximum loss they can afford
- Dynamic trailing stop-loss using a Supertrend
⚙️ How It Works:
1️⃣ ATR-Based Stop-Loss and Target Levels
- The indicator calculates ATR (Average True Range) with a default period of 5.
- You can choose if ATR is calculated based on the current candle or the previous candle.
- Two multipliers are applied:
- Multiplier 1: For Stop-Loss
- Multiplier 2: For First Target
Input Options Available:
- Price Source: Choose from Close, Open, or manually enter a custom price. Default value is Close
- ATR Source Candle: Select Current or Previous. Default is Previous candle
- ATR Period: Default is 5 (modifiable).
- Multipliers: Set your desired levels for Stop-Loss and Target individually.
✨ Visualization:
- Horizontal lines are drawn for both Stop-Loss and First Target levels.
- Color and style of the lines are customizable (solid, dashed, dotted).
- Labels at the end of each line show exact price values.
2️⃣ Maximum Loss Control (Position Size Calculation)
- You can input a Max Loss Amount (default: 10,000).
- The system automatically calculates:
- Risk per share = difference between entry price and stop-loss.
- Position Size = (Max Loss) ÷ (Risk per share).
- Actual Calculated Loss = (Position Size × Risk per share).
✨ Visualization:
- A floating label below the candles displays:
- Position Size (rounded to nearest whole number)
- Actual Calculated Loss (based on real size, not estimation)
- Toggle ON/OFF the label using settings.
3️⃣ Supertrend Trailing Stop-Loss
- Built-in Supertrend using:
ATR Period = 10
ATR Multiplier = 2.1
Source = HL2 (High + Low / 2)
- You can choose to:
Enable or disable Supertrend
Highlight background based on trend direction
Show Buy/Sell Signals
- Alerts are available when Supertrend switches direction.
✨ Visualization:
- Uptrend = Green Supertrend Line
- Downtrend = Orange Supertrend Line
- Optional: Highlight background colors depending on trend.
Информация о релизе
Heading added for clear differenciation betweeen type of ATR used. you may set the maximum loss amount in indicator, which will show user the number for shares he/she can buy/sell within SL point defined/calculated
Информация о релизе
minor update with table view. label removedИнформация о релизе
lable remove on table view and line on chartИнформация о релизе
Update as per request, The old lines remained with new tableИнформация о релизе
minor updateDisclaimer : this is just a indicator. it is not strategy for buy and sell. Please do not take trade based on this indicator
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.