OPEN-SOURCE SCRIPT
ATR Delta

ATR Delta is a volatility oscillator that separates the Average True Range into its up- and down-move components instead of showing a single combined value. It's built for anyone who wants to see whether current volatility is being driven more by up bars or by down bars, rather than only how large that volatility is overall — for example to judge whether a rise or a drop in volatility comes from bullish or bearish price action. Each bar's true range is assigned to the up or down side depending on whether the bar closed higher or lower than the previous close, and both sides are then smoothed independently using the same RMA-based method the classic ATR uses. The smoothing length and the two fill colors can be freely adjusted.
Calculation
Length: number of bars used to smooth the directional true range.
Appearance
Bull / Bear: two colors: one for the area between the Up line and the Delta line, the other for the area between the Delta line and the Down line.

The indicator plots two smoothed lines — one for the true range on up bars, one for the true range on down bars, mirrored below the zero line — plus a delta line placed exactly between them. The delta line sits above zero when the up side currently has more true range than the down side, and below zero when the down side has more; the further it moves from zero, the larger that imbalance. The area between the upper line and the delta line is filled in Bull Color, and the area between the delta line and the lower line is filled in Bear Color. A bar with an unchanged close is always counted on the up side.

This indicator is intended solely for market analysis and does not constitute investment advice or a guarantee of success. Use it at your own discretion and risk; past results are not indicative of future performance.
Calculation
Length: number of bars used to smooth the directional true range.
Appearance
Bull / Bear: two colors: one for the area between the Up line and the Delta line, the other for the area between the Delta line and the Down line.
The indicator plots two smoothed lines — one for the true range on up bars, one for the true range on down bars, mirrored below the zero line — plus a delta line placed exactly between them. The delta line sits above zero when the up side currently has more true range than the down side, and below zero when the down side has more; the further it moves from zero, the larger that imbalance. The area between the upper line and the delta line is filled in Bull Color, and the area between the delta line and the lower line is filled in Bear Color. A bar with an unchanged close is always counted on the up side.
This indicator is intended solely for market analysis and does not constitute investment advice or a guarantee of success. Use it at your own discretion and risk; past results are not indicative of future performance.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。