Meridian Scaffold [JOAT]Meridian Scaffold
Introduction
Meridian Scaffold is an advanced open-source volatility band structure that builds adaptive price envelopes around a Jurik Moving Average (JMA) baseline with integrated range-lock dampening. Unlike standard Bollinger Bands or Keltner Channels that use fixed statistical measures, this indicator constructs its bands using ATR-Fibonacci expansion levels with auto-calibrating width, overlays a ZEMA trend bias system, and includes a full volatility regime classification engine with hysteresis state transitions. The result is a band structure that adapts its behavior to the current market phase — compressing tightly during consolidation, expanding proportionally during trends, and providing clearly defined reaction levels at Fibonacci-derived distances from the adaptive baseline.
This indicator addresses a core problem with conventional band indicators: they treat all market conditions the same. A Bollinger Band expands and contracts based on standard deviation alone, with no awareness of whether the market is trending, compressing, or in a whipsaw phase. Meridian Scaffold solves this by fusing a volatility regime classifier (compression, normal, expansion) with adaptive band construction, so the bands behave differently depending on the detected market phase. During compression, the baseline locks to a simple average to prevent false signals. During expansion, the bands widen using Fibonacci ratios to project realistic target levels.
Core Concepts
1. JMA Adaptive Baseline with Range-Lock Dampening
The centerline of the band structure is a Jurik Moving Average — an adaptive filter that tracks price closely during fast moves and smooths aggressively during noise. The JMA implementation includes a full volatility tracking system that measures the relative volatility of the input signal:
// Relative volatility determines JMA responsiveness
float rv = math.min(math.max(avgVolty > 0 ? volty / avgVolty : 1.0, 1.0), maxPow)
float adaptiveAlpha = math.pow(beta, math.pow(rv, pow1))
When relative volatility drops below a configurable threshold (the "range lock" condition), the indicator switches from the JMA to a simple moving average. This prevents the baseline from oscillating during low-volatility chop, producing a flat, stable reference line that clearly communicates "no trend present." When volatility returns, the JMA resumes tracking.
2. ATR-Fibonacci Expansion Levels
Rather than using standard deviation (which assumes normal distribution) or fixed ATR multiples, the bands are constructed at Fibonacci-derived distances from the baseline. The ATR is first smoothed using a ZEMA technique (double-EMA extrapolation) to remove noise from the volatility measure itself:
float atrZ1 = ta.ema(atrRaw, 21)
float atrZ2 = ta.ema(atrZ1, 21)
float atrSmooth = atrZ1 + (atrZ1 - atrZ2)
This ZEMA-smoothed ATR is then multiplied by configurable inner and outer factors to create the band levels. The default inner band at 1.5x ATR captures normal price oscillation; the outer band at 2.8x ATR marks extended moves. Additional Fibonacci extension levels at 1.618x and 2.618x ATR provide projection targets for breakout moves.
3. Volatility Regime Classification
The indicator classifies the current volatility environment into three states using a hysteresis state machine:
Compression: ATR is significantly below its long-term average (ratio < 0.6). Bands contract, baseline locks. This phase often precedes breakouts
Normal: ATR is near its average. Standard band behavior applies
Expansion: ATR is significantly above its long-term average (ratio > 1.5). Bands widen, momentum signals are prioritized
The hysteresis mechanism prevents rapid switching between states. Entry into expansion requires a ratio above 1.5, but exit only occurs when the ratio drops below 1.2. This creates stable regime classifications that don't flicker on every bar.
4. ZEMA Trend Bias
A Zero-Lag EMA calculated on the baseline provides directional bias. When the baseline is above its ZEMA, the bias is bullish; below, bearish. The spread between the baseline and ZEMA quantifies the strength of the directional conviction. This bias colors the baseline and bands to provide immediate visual feedback on trend direction.
5. Band Squeeze Detection
The indicator monitors bandwidth (the percentage distance between outer bands relative to the baseline) against its own rolling average and standard deviation. When bandwidth drops below the average minus half a standard deviation, a squeeze condition is flagged. Squeezes represent compressed volatility that statistically tends to resolve with an expansion move.
Features
Slope-Aware Baseline Glow: The baseline renders with a multi-layer glow effect whose intensity scales with the normalized slope. Steeper trends produce more vivid glow; flat periods produce subtle, muted rendering
Regime-Adaptive Band Coloring: Band colors shift automatically based on the volatility regime — compression phases use iris/purple tones, expansion phases use ember/warm tones, and normal phases use neutral slate
Kaufman Efficiency Scoring: The Kaufman Efficiency Ratio (net price movement divided by total path length) is calculated and displayed, providing a 0-1 measure of how efficiently price is moving. Values above 0.4 indicate strong directional movement; below 0.2 indicates chop
Mean Reversion Signals: When price touches or exceeds the outer band and then re-enters the inner band, the indicator generates a mean-reversion signal. These are most reliable during normal and compression regimes
Breakout Signals: When price closes beyond the outer band during an expansion regime with volume confirmation, a breakout signal is generated. These indicate potential trend continuation
Trend Strength Composite: A composite score combining slope strength, Kaufman efficiency, R-squared linearity, and regime alignment provides a single 0-100 measure of overall trend quality
16-Row Dashboard: Displays baseline value, regime state, trend bias, bandwidth, squeeze status, Kaufman ER, slope strength, R-squared, trend composite score, band levels, regime duration, and position relative to bands
Input Parameters
Baseline:
JMA Period: Adaptive baseline smoothing length (default: 21)
JMA Phase: Lead/lag adjustment (default: 0)
JMA Power: Responsiveness curve (default: 0.45)
Range Lock Threshold: Relative volatility below which the baseline locks flat (default: 0.55)
Bands:
ATR Length: Period for ATR calculation (default: 14)
Inner Band Multiplier: ATR multiple for inner band (default: 1.5)
Outer Band Multiplier: ATR multiple for outer band (default: 2.8)
Regime:
Regime Lookback: Period for volatility regime classification (default: 50)
Visuals:
Toggles for bands, Fibonacci extensions, glow effects, squeeze markers, regime background, bar coloring, and dashboard
Zone opacity control for band fill transparency
How to Use This Indicator
Step 1: Identify the Volatility Regime
Check the dashboard or observe the band coloring. Compression (purple/iris bands) means prepare for a breakout — avoid trend-following entries. Expansion (warm/ember bands) means trend-following setups are favored. Normal (slate bands) means standard analysis applies.
Step 2: Read the Baseline Bias
The baseline color and ZEMA relationship tell you the directional bias. Only look for long setups when the baseline is above ZEMA (bullish bias) and short setups when below (bearish bias).
Step 3: Use Bands as Context Levels
The inner band defines the normal oscillation range. Price consistently above the inner upper band indicates strong bullish momentum. The outer band marks extended territory where mean-reversion risk increases. Fibonacci extensions at 1.618x and 2.618x provide projection targets for breakout moves.
Step 4: Trade Squeezes
When a squeeze is detected (gold dots on the baseline), wait for the squeeze to release. The direction of the first strong move out of the squeeze often sets the trend for the next phase. Combine with the ZEMA bias for directional confirmation.
Step 5: Monitor Trend Quality
The trend strength composite score tells you how clean the current trend is. Scores above 60 indicate high-quality trends worth riding. Scores below 30 suggest choppy conditions where band-based mean-reversion strategies may work better.
Indicator Limitations
The JMA baseline, while adaptive, still lags price during sharp reversals. The range-lock feature helps during consolidation but cannot eliminate lag during genuine trend changes
ATR-based bands assume volatility is relatively stable over the measurement period. During news events or gap openings, the bands may not accurately reflect the new volatility environment for several bars
The volatility regime classifier uses hysteresis which creates stability but also delays regime transitions. A compression-to-expansion shift may be identified several bars after the breakout begins
Fibonacci extension levels are mathematical projections, not guaranteed targets. Price may reverse before reaching them or blow through them entirely
Squeeze detection identifies compressed volatility but does not predict the direction of the subsequent expansion. Additional directional analysis is required
The indicator works best on liquid instruments with consistent volatility patterns. Thinly traded instruments may produce unreliable regime classifications
Originality Statement
This indicator is original in its integration of adaptive baseline technology with regime-aware band construction. While ATR bands and JMA are established concepts, this indicator is justified because:
The JMA range-lock mechanism that switches to SMA during low-volatility periods is a novel approach to preventing false baseline oscillations in chop — standard JMA implementations do not include this feature
ZEMA-smoothed ATR for band construction removes noise from the volatility measure itself, producing cleaner band edges than raw ATR
The three-state volatility regime classifier with hysteresis transitions provides context-aware band behavior not available in standard Bollinger or Keltner implementations
Fibonacci-derived expansion levels integrate harmonic ratio theory with volatility measurement, providing mathematically grounded projection targets
The trend strength composite score synthesizes multiple independent quality measures (slope, efficiency, linearity, regime) into a single actionable metric
Slope-aware glow rendering and regime-adaptive coloring provide instant visual feedback on market conditions without requiring dashboard reading
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Band levels, regime classifications, and signals are mathematical calculations based on historical data and do not predict future price movement. Squeeze conditions do not guarantee subsequent breakouts, and breakout signals do not guarantee trend continuation. Always use proper risk management and conduct your own analysis. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Pine Script® 인디케이터






















