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.
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Follow me on Instagram and Youtube
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Follow me on Instagram and Youtube
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.