OPEN-SOURCE SCRIPT
Dynamic ATR Bands

Description:
The Dynamic ATR Bands indicator visualizes ATR-based stop-loss, take-profit, and trailing levels. Bands can be drawn relative to a fixed entry price or dynamically relative to the current price. It is ideal for trend-following, swing trading, and hybrid strategies, especially on volatile or noisy instruments.
Key Features:
Base ATR Bands:
Extra ATR Band:
Hybrid Entry Mode:
Clean Visuals:
How to Use:
Inputs:
Note:
This script is visual only; it does not place trades. It is designed to help plan ATR-based stop-loss, take-profit, and hybrid trade management visually on the chart.
The Dynamic ATR Bands indicator visualizes ATR-based stop-loss, take-profit, and trailing levels. Bands can be drawn relative to a fixed entry price or dynamically relative to the current price. It is ideal for trend-following, swing trading, and hybrid strategies, especially on volatile or noisy instruments.
Key Features:
Base ATR Bands:
- Plots ATR-based bands above and below a reference price.
- Acts as initial stop-loss or target guidance.
- Adjustable multiplier (default 1× ATR).
Extra ATR Band:
- Add an additional ATR band at a custom multiplier.
- Position it above or below the reference price.
- Useful for trailing stops or extended profit targets.
Hybrid Entry Mode:
- Use Fixed Entry Price: bands are drawn relative to your entry and remain fixed.
- Dynamic Mode: bands behave like standard ATR bands, moving with the current price.
- Allows visualization of hybrid ATR stop-loss and trailing strategies.
Clean Visuals:
- Color-coded bands differentiate base (solid) from extra (semi-transparent).
How to Use:
- Set ATR length and multipliers according to your strategy.
- Toggle hybrid entry mode and input your entry price, or leave off for dynamic bands.
- Set the extra band multiplier and choose its position (upper/lower).
- Use the bands as visual guides for stop-loss, take-profit, and trailing levels.
Inputs:
- ATR Length: number of periods for ATR calculation
- Base ATR Multiplier: distance of base bands from reference price
- Extra ATR Multiplier: distance for the additional band
- Extra Band Position: choose Upper or Lower
- Use Fixed Entry Price: toggle hybrid entry mode
- Entry Price: specify entry price if hybrid mode is enabled
Note:
This script is visual only; it does not place trades. It is designed to help plan ATR-based stop-loss, take-profit, and hybrid trade management visually on the chart.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.