OPEN-SOURCE SCRIPT
ATR Daily (Classic vs Robust, NY-Fix, Spike Control)

📘 What this indicator does
This tool provides an advanced view of daily market volatility by comparing two versions of the Average True Range (ATR):
• Classic ATR — standard Wilder smoothing
• Robust ATR — uses median-based filtering and spike-control logic to reduce distortion from abnormal candles
Both values are calculated using daily data aligned to the New York trading session, so volatility resets at the same moment each institutional trading day begins. This keeps readings consistent across crypto, forex and stocks, even on intraday charts.
⚙️ How it works (in simple terms)
The script evaluates each True Range (TR) value relative to a median-based threshold:
• Abnormally large ranges are either clamped to a limit or excluded from updating ATR
• A hard cap prevents single spikes from inflating the entire indicator
• The result is a smoother and more realistic representation of daily volatility
This allows ATR to reflect typical market behaviour instead of rare one-off events.
📊 What appears on the chart
• Two daily ATR lines (Classic and Robust)
• Histogram showing the percentage of daily range already completed
• Red bars when price exceeds 100% of daily ATR
• A data table with volatility metrics
• Background highlights on days with extreme values
💡 How traders can use it
• Identify when a market has already completed most of its typical daily move
• Compare Classic vs Robust ATR to spot news-driven distortion
• Use Robust ATR for more stable stop-loss and take-profit logic
• Track volatility expansion or contraction across sessions
⚙️ Key settings
Setting Purpose
ATR period Standard smoothing length (default 14)
Robust mode Clamp, Freeze or Off
MAD multiplier Sensitivity to outliers
Cap × median(TR) Maximum allowed spike size
Base for passed ATR Which ATR is used to measure daily %
Freeze weekends Keeps ATR unchanged on Sat/Sun
🧩 Unique concept
Unlike typical ATR indicators, this one combines robust statistics (median + MAD) with session-based fixation. ATR values update only once per New York session, creating stable volatility measurements that match institutional timing.
🔒 Source code
The script is published with protected source code to preserve its statistical structure and prevent unauthorized modification.
🧭 Summary
ATR Daily (Classic vs Robust, NY-Fix) provides a clearer and more reliable view of daily volatility.
It helps determine whether the market is still in the early phase of its daily range or already exhausted.
This tool provides an advanced view of daily market volatility by comparing two versions of the Average True Range (ATR):
• Classic ATR — standard Wilder smoothing
• Robust ATR — uses median-based filtering and spike-control logic to reduce distortion from abnormal candles
Both values are calculated using daily data aligned to the New York trading session, so volatility resets at the same moment each institutional trading day begins. This keeps readings consistent across crypto, forex and stocks, even on intraday charts.
⚙️ How it works (in simple terms)
The script evaluates each True Range (TR) value relative to a median-based threshold:
• Abnormally large ranges are either clamped to a limit or excluded from updating ATR
• A hard cap prevents single spikes from inflating the entire indicator
• The result is a smoother and more realistic representation of daily volatility
This allows ATR to reflect typical market behaviour instead of rare one-off events.
📊 What appears on the chart
• Two daily ATR lines (Classic and Robust)
• Histogram showing the percentage of daily range already completed
• Red bars when price exceeds 100% of daily ATR
• A data table with volatility metrics
• Background highlights on days with extreme values
💡 How traders can use it
• Identify when a market has already completed most of its typical daily move
• Compare Classic vs Robust ATR to spot news-driven distortion
• Use Robust ATR for more stable stop-loss and take-profit logic
• Track volatility expansion or contraction across sessions
⚙️ Key settings
Setting Purpose
ATR period Standard smoothing length (default 14)
Robust mode Clamp, Freeze or Off
MAD multiplier Sensitivity to outliers
Cap × median(TR) Maximum allowed spike size
Base for passed ATR Which ATR is used to measure daily %
Freeze weekends Keeps ATR unchanged on Sat/Sun
🧩 Unique concept
Unlike typical ATR indicators, this one combines robust statistics (median + MAD) with session-based fixation. ATR values update only once per New York session, creating stable volatility measurements that match institutional timing.
🔒 Source code
The script is published with protected source code to preserve its statistical structure and prevent unauthorized modification.
🧭 Summary
ATR Daily (Classic vs Robust, NY-Fix) provides a clearer and more reliable view of daily volatility.
It helps determine whether the market is still in the early phase of its daily range or already exhausted.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。