OPEN-SOURCE SCRIPT
Caldera Deviation Cloud [JOAT]

Caldera Deviation Cloud [JOAT]
Introduction
The Caldera Deviation Cloud is an open-source statistical deviation band system that fuses anchored VWAP with Z-score adaptive band widths, Keltner ATR blending, and higher-timeframe volatility expansion into a unified probability envelope overlay. Instead of using a single method to calculate band width, CDC triple-blends VWAP standard deviation, statistical standard deviation, and ATR-based Keltner width — whichever produces the widest reading dominates, ensuring the bands never underestimate true market dispersion. The result is a layered cloud with inner (1-sigma, ~68% probability) and outer (2-sigma, ~95% probability) envelopes that adapt to both local and macro volatility conditions.
What makes this indicator distinct from standard Bollinger Bands or VWAP bands is the fusion approach: it does not rely on a single deviation method. It also reverse-engineers historical Z-score reversal points into dynamic "fossil" support and resistance levels — price zones where statistical extremes have historically triggered reversals.

Core Engine: Adaptive Deviation Fusion
The band width calculation blends three independent deviation measurements:
Pine Script®
The wider of these three measurements is used as the base deviation, then multiplied by a macro volatility factor derived from the higher timeframe.
Probability Lattice (Z-Score Engine)
The Z-score engine computes how many standard deviations price is from its statistical mean, then smooths the result with VWMA for visual clarity:
Reversal Archaeology (Fossil Levels)
This is one of CDC's most distinctive features. The indicator detects Z-score pivot highs and pivot lows, filters them by a minimum threshold (default 1.5 sigma), and accumulates them into rolling arrays. The average of these historical reversal Z-scores is then reverse-engineered back into price levels:
Fossil Resistance = VWMA(Mean + AvgTopReversalZ * StdDev)
Fossil Support = VWMA(Mean + AvgBotReversalZ * StdDev)
These "fossil levels" represent the price zones where, on average, the market has historically found statistical extremes significant enough to trigger reversals. They shift dynamically as new reversal data accumulates and old data rolls off.
Macro Volatility Lens (HTF Expansion)
When enabled, the indicator fetches standard deviation data from a higher timeframe (default 60-minute) and compares it to its own EMA. When macro volatility exceeds its average, the bands widen proportionally:
macroMult = 1 + htfFactor * max(0, (htfStdev - htfAvgDev) / htfAvgDev)
This prevents the bands from being too tight during periods of elevated macro uncertainty, even if the local timeframe appears calm. The security calls use lookahead=off to prevent repainting.
Visual Elements
Signal Architecture
CDC generates four signal types, all confirmed-bar only:

Command Panel (Dashboard)
A 10-row monospace dashboard displays:
Input Parameters
Probability Lattice:
Anchor Nexus:
Keltner Fusion:
Macro Volatility Lens:
Reversal Archaeology:
How to Use This Indicator
Limitations
Originality Statement
This indicator is original in its triple-blend adaptive deviation approach. While VWAP bands, Bollinger Bands, and Keltner Channels are established concepts individually, CDC is justified because:
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Statistical deviation bands describe historical price distribution patterns but do not predict future price movement. Extreme Z-scores do not guarantee reversals. Always use proper risk management and conduct your own analysis before making trading decisions. The author is not responsible for any losses incurred from using this tool.
-Made with passion by officialjackofalltrades
Introduction
The Caldera Deviation Cloud is an open-source statistical deviation band system that fuses anchored VWAP with Z-score adaptive band widths, Keltner ATR blending, and higher-timeframe volatility expansion into a unified probability envelope overlay. Instead of using a single method to calculate band width, CDC triple-blends VWAP standard deviation, statistical standard deviation, and ATR-based Keltner width — whichever produces the widest reading dominates, ensuring the bands never underestimate true market dispersion. The result is a layered cloud with inner (1-sigma, ~68% probability) and outer (2-sigma, ~95% probability) envelopes that adapt to both local and macro volatility conditions.
What makes this indicator distinct from standard Bollinger Bands or VWAP bands is the fusion approach: it does not rely on a single deviation method. It also reverse-engineers historical Z-score reversal points into dynamic "fossil" support and resistance levels — price zones where statistical extremes have historically triggered reversals.
Core Engine: Adaptive Deviation Fusion
The band width calculation blends three independent deviation measurements:
float baseAdapt = na(vwapStdev) or vwapStdev <= 0 ? statDev : math.max(vwapStdev, statDev * 0.5)
float keltBlend = useKelt ? math.max(baseAdapt, keltW * 0.6) : baseAdapt
float adaptDev = keltBlend * macroMult
- VWAP Standard Deviation: Derived from the anchored VWAP calculation (session, weekly, monthly, or quarterly reset). This captures volume-weighted price dispersion around the institutional fair value line.
- Statistical Standard Deviation: Classic standard deviation of closing prices over a configurable lookback (default 100 bars). This provides a pure statistical measure of price dispersion.
- Keltner Thermal Envelope: ATR-based width (EMA of close with ATR multiplier) that captures range-based volatility. When enabled, this prevents the bands from being too narrow during periods where price moves are large but close-to-close deviation is small.
The wider of these three measurements is used as the base deviation, then multiplied by a macro volatility factor derived from the higher timeframe.
Probability Lattice (Z-Score Engine)
The Z-score engine computes how many standard deviations price is from its statistical mean, then smooths the result with VWMA for visual clarity:
- Z-Score: (close - SMA) / StdDev, smoothed with VWMA
- Mean Reversion Velocity: The rate of change of the Z-score, classified as EXPANDING (moving away from mean), CONTRACTING (returning toward mean), or STALLED
- Dynamic State: SHELL BREACH OB/OS (beyond historical reversal averages), ELEVATED/DEPRESSED (beyond 1 sigma), or EQUILIBRIUM (near mean)
Reversal Archaeology (Fossil Levels)
This is one of CDC's most distinctive features. The indicator detects Z-score pivot highs and pivot lows, filters them by a minimum threshold (default 1.5 sigma), and accumulates them into rolling arrays. The average of these historical reversal Z-scores is then reverse-engineered back into price levels:
Fossil Resistance = VWMA(Mean + AvgTopReversalZ * StdDev)
Fossil Support = VWMA(Mean + AvgBotReversalZ * StdDev)
These "fossil levels" represent the price zones where, on average, the market has historically found statistical extremes significant enough to trigger reversals. They shift dynamically as new reversal data accumulates and old data rolls off.
Macro Volatility Lens (HTF Expansion)
When enabled, the indicator fetches standard deviation data from a higher timeframe (default 60-minute) and compares it to its own EMA. When macro volatility exceeds its average, the bands widen proportionally:
macroMult = 1 + htfFactor * max(0, (htfStdev - htfAvgDev) / htfAvgDev)
This prevents the bands from being too tight during periods of elevated macro uncertainty, even if the local timeframe appears calm. The security calls use lookahead=off to prevent repainting.
Visual Elements
- Equilibrium Spine: The VWMA-smoothed center line (VWAP or statistical mean), plotted as a prominent purple line representing fair value.
- Core Envelope (Inner Bands): 1-sigma bands representing the ~68% probability zone. Color shifts dynamically based on price position within the cloud using color.from_gradient.
- Shell Envelope (Outer Bands): 2-sigma bands representing the ~95% probability zone. Price beyond these levels is statistically extreme.
- Nebula Gradient: A 10-layer gradient fill system creates a smooth visual transition from the spine outward through the core and shell envelopes. Upper layers use distribution (bearish) tones, lower layers use accumulation (bullish) tones.
- Fossil Levels: Cross-style plots marking the reverse-engineered support and resistance from Z-score reversal history.
Signal Architecture
CDC generates four signal types, all confirmed-bar only:
- SHELL BREACH: Price exceeds the outer (2-sigma) envelope — a statistically extreme event. Upper breach suggests distribution extreme, lower breach suggests accumulation extreme. Tooltip includes the sigma multiplier and current Z-score.
- CORE DRIFT: Price enters the zone between the inner and outer envelopes — elevated deviation but not yet extreme. This serves as an early warning before a potential shell breach.
Command Panel (Dashboard)
A 10-row monospace dashboard displays:
- LATTICE: Current smoothed Z-score value
- STATE: Statistical classification (Shell Breach OB/OS, Elevated, Depressed, Equilibrium)
- REV VEL: Mean reversion velocity direction (Expanding, Contracting, Stalled)
- SPINE: Current center line (VWAP/mean) price
- APERTURE: Current adaptive deviation width
- MACRO: HTF volatility multiplier (1.0x = normal, >1.1x = elevated macro vol)
- POSITION: Price location within the cloud (Upper Shell, Upper Core, Neutral, Lower Core, Lower Shell)
- FOSSIL R / FOSSIL S: Average Z-score at which historical reversals have occurred (resistance and support)
Input Parameters
Probability Lattice:
- Lattice Depth: Z-score lookback window (default 100)
- Lattice Damper: VWMA smoothing on raw Z-score (default 14)
- Sigma Core: Inner band multiplier, ~68% probability (default 1.0)
- Sigma Shell: Outer band multiplier, ~95% probability (default 2.0)
Anchor Nexus:
- Volume Epoch: VWAP reset period — Session, Weekly, Monthly, or Quarterly
Keltner Fusion:
- Enable Thermal Envelope: Toggle ATR-based width blending (default on)
- Thermal EMA / ATR Scale: Keltner channel parameters
Macro Volatility Lens:
- Enable Horizon Expansion: Toggle HTF volatility widening (default on)
- Horizon Timeframe / Blend Factor: HTF parameters
Reversal Archaeology:
- Fossil Depth: Rolling array size for reversal history (default 25)
- Fossil Threshold: Minimum Z-score magnitude for valid reversal (default 1.5)
How to Use This Indicator
- Use the cloud as a probability envelope — price spending time near the outer shell is statistically unusual and often precedes mean reversion.
- Watch SHELL BREACH signals at the outer bands for potential reversal setups, especially when the Reversion Velocity shows CONTRACTING (Z-score returning toward mean).
- Fossil levels provide dynamic support/resistance derived from statistical history — they shift as new reversal data accumulates, making them adaptive rather than static.
- The MACRO multiplier in the dashboard warns when higher-timeframe volatility is elevated — wider bands during these periods reflect genuine uncertainty, not just noise.
- CORE DRIFT signals serve as early warnings — price entering the core-to-shell zone may continue to the shell or reverse. Use them as alerts to pay attention, not as standalone trade signals.
- The Equilibrium Spine (center line) acts as a dynamic fair value reference — extended moves away from it tend to revert over time.
Limitations
- Statistical bands assume roughly normal price distributions, which markets frequently violate. Fat tails and gap events can exceed even the outer shell without warning.
- Z-score mean reversion is a tendency, not a guarantee — price can remain at statistical extremes for extended periods, especially during strong trends.
- Fossil levels are based on historical reversal averages and may not predict future reversal points accurately. They provide context, not certainty.
- The VWAP anchor resets at each period boundary (session, week, etc.), which can cause discontinuities in the center line and bands.
- Higher-timeframe volatility expansion depends on the selected HTF — different choices produce different macro multipliers.
- The indicator does not generate directional buy/sell signals — it provides statistical context for your own decision-making.
Originality Statement
This indicator is original in its triple-blend adaptive deviation approach. While VWAP bands, Bollinger Bands, and Keltner Channels are established concepts individually, CDC is justified because:
- The triple-blend deviation fusion (VWAP stdev + statistical stdev + Keltner ATR) ensures bands never underestimate dispersion regardless of which volatility measure is dominant.
- Reversal Archaeology reverse-engineers Z-score pivot history into dynamic price levels — a technique not found in standard deviation band indicators.
- The Macro Volatility Lens integrates higher-timeframe volatility directly into band width calculation, providing macro-aware probability envelopes.
- The 10-layer nebula gradient fill creates a visual probability density that communicates statistical significance through color intensity.
- Mean Reversion Velocity tracking provides directional context for Z-score movement, helping distinguish between expanding extremes and contracting reversals.
- The comprehensive dashboard presents statistical state, reversion dynamics, and fossil levels simultaneously.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Statistical deviation bands describe historical price distribution patterns but do not predict future price movement. Extreme Z-scores do not guarantee reversals. Always use proper risk management and conduct your own analysis before making trading decisions. The author is not responsible for any losses incurred from using this tool.
-Made with passion by officialjackofalltrades
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。