OPEN-SOURCE SCRIPT
Candle Spread + ATR SMA Analysis

This indicator combines elements from two popular open-source scripts — Candle Range Compare
by oldinvestor https://www.tradingview.com/script/6WSs256o-Candle-Range-Compare/
and Objective Analysis of Spread (VSA)
by Rin-Ninhttps://www.tradingview.com/script/2SYW2RFs-Objective-Analysis-of-Spread-VSA/
— into a single tool for analyzing candle spreads (ranges and bodies) in relation to volatility benchmarks.
🔎 What It Does
Candle Decomposition:
Plots total candle ranges (high–low) in gray, for both up and down closes.
Plots up-close bodies (open–close) in white.
Plots down-close bodies in black.
This makes it easy to spot whether volatility comes from real price movement (body) or extended wicks.
ATR & SMA Volatility Bands:
Calculates ATR (Average True Range) and overlays it as a black line.
Plots four volatility envelopes derived from the SMA of the true range:
0.8× (blue, shaded)
1.3× (green)
1.8× (red)
3.0× (purple)
Colored fill zones highlight when candle spreads are below, within, or above key thresholds.
Visual Context:
Track expansion/contraction in spreads.
Compare bullish (white) vs bearish (black) bodies to gauge buying/selling pressure.
Identify when candles stretch beyond typical volatility ranges.
📈 How To Use It
VSA context: Wide down bars (black) beyond ATR bands may suggest supply; wide up bars (white) may indicate demand.
Trend confirmation: Expanding ranges above average thresholds (green/red/purple bands) often confirm momentum.
Reversal potential: Small bodies but large ranges (gray + wicks) frequently appear at turning points.
Volatility filter: Use ATR bands to filter trades — e.g., only act when candle ranges exceed 1.3× or 1.8× SMA thresholds.
🙏 Credits
This script is inspired by and combines ideas from:
Candle Range Compare
by oldinvestor
Objective Analysis of Spread (VSA)
by Rin-Nin
Big thanks to both authors for their valuable contributions to the TradingView community.
One thing I couldnt quite get to work is being able to display up and down wicks like in the candle range compare, so I just add that indicator to the chart as well, uncheck everything but the wick plots and there it is.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
Follow me on Instagram and Youtube
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
Follow me on Instagram and Youtube
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。