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.
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.