ATR/DTR Improved - JKnappers

435
This indicator is based on the original **ATR/DTR** script by **TraderCreatorPro**.

The original concept calculates the relationship between the current daily trading range and Average True Range (ATR), and displays:

* ATR
* DTR
* DTR as a percentage of ATR

### Modifications in this version

Modified by **JKnappers — 2026-08-12**

Changes compared with the original script:

* Uses `syminfo.tickerid` instead of `syminfo.ticker` to reference the exact chart symbol/feed.
* Adds a configurable ATR length.
* Default ATR length is 14.
* ATR is calculated from a selectable higher timeframe, defaulting to 1 day.
* Uses the **previous completed higher-timeframe ATR** as the fixed ATR benchmark.
* Keeps DTR as the **current developing high-low range**.
* Calculates the percentage as:
**Current DTR / Previous completed ATR × 100**
* Keeps the configurable percentage threshold for changing the table background color.
* Displays ATR, DTR and the current percentage in a compact table.

### Why use the previous completed ATR?

The original script uses the current developing daily candle in the ATR calculation. This means the ATR value can change during the trading session.

This modified version instead uses the ATR value from the previous completed daily candle. That provides a fixed volatility benchmark throughout the current trading day, while DTR continues to update in real time.

This makes the percentage easier to use as an intraday extension reference:

* ATR = fixed reference based on completed data
* DTR = current day's developing range
* Percentage = how much of that reference range has currently been used

### Credits

Original ATR/DTR concept and source code: **TraderCreatorPro**

Modified version: **JKnappers — 2026-08-12**

The original source code is published under the **Mozilla Public License 2.0**. This modified version retains that license and attribution.

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。