OPEN-SOURCE SCRIPT
ATR-Based Z-Score (with Signal Line)

The ATR-Based Z-Score is an advanced, volatility-normalized oscillator designed to identify extreme price deviations more reliably than the standard Z-Score.
By replacing the traditional Standard Deviation with the Average True Range (ATR) in the denominator, this indicator eliminates the "volatility paradox" where rapid price spikes cause standard oscillators to prematurely return to zero, even as the price continues to crash.
Why this version is superior
In a classic Z-Score calculation:
Z = (Price - SMA) / (Standard Deviation)
A sudden impulsive price drop causes the Standard Deviation to explode. Because you are dividing by a rapidly increasing number, the Z-Score often "rises" while the price is still falling.
The ATR-Based Solution:
Z = (Price - SMA) / ATR
By using a long-period ATR as the denominator, the volatility measure remains stable and "clean." This ensures that the indicator’s troughs align much more accurately with actual price bottoms, staying in the oversold territory until the momentum truly shifts.
Key Features
How to Trade with it
1. Mean Reversion (Buy the Dip / Sell the Rip)
2. Breakout Trading
Summary
✅ This indicator is designed for traders who find standard oscillators too "nervous" during volatile periods. By decoupling price deviation from immediate variance spikes, the ATR-Based Z-Score provides a rock-solid foundation for identifying true market extremes and high-probability reversal points.
By replacing the traditional Standard Deviation with the Average True Range (ATR) in the denominator, this indicator eliminates the "volatility paradox" where rapid price spikes cause standard oscillators to prematurely return to zero, even as the price continues to crash.
Why this version is superior
In a classic Z-Score calculation:
Z = (Price - SMA) / (Standard Deviation)
A sudden impulsive price drop causes the Standard Deviation to explode. Because you are dividing by a rapidly increasing number, the Z-Score often "rises" while the price is still falling.
The ATR-Based Solution:
Z = (Price - SMA) / ATR
By using a long-period ATR as the denominator, the volatility measure remains stable and "clean." This ensures that the indicator’s troughs align much more accurately with actual price bottoms, staying in the oversold territory until the momentum truly shifts.
Key Features
- Volatility Cleaning: The ATR-normalization prevents the indicator from "flattening out" during impulsive price movements.
- Integrated Signal Line: A customizable Moving Average of the Z-Score values helps filter noise and confirms entry/exit points.
- Independent Periods: You can set the Price MA (responsiveness) and the ATR (volatility baseline) separately to fine-tune the indicator to different timeframes.
How to Trade with it
1. Mean Reversion (Buy the Dip / Sell the Rip)
- Long: Wait for the Z-Score to drop below a significant level (e.g., -10.0). Enter when the Z-Score crosses back above its Signal Line.
- Short: Wait for the Z-Score to rise above +10.0 and enter when it crosses below the Signal Line.
2. Breakout Trading
- A strong push of the Z-Score beyond the +/- 7.0 levels can indicate a powerful trend breakout.
- In this case, the Signal Line crossover serves as an effective Exit Signal, telling you that the initial momentum of the breakout is fading.
Summary
✅ This indicator is designed for traders who find standard oscillators too "nervous" during volatile periods. By decoupling price deviation from immediate variance spikes, the ATR-Based Z-Score provides a rock-solid foundation for identifying true market extremes and high-probability reversal points.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.