OPEN-SOURCE SCRIPT

Crucible Range Compression [JOAT]

1 953
Crucible Range Compression [JOAT]

Crucible Range Compression detects volatility-compression episodes by blending three independent contraction proxies — Bollinger Band Width percentile, ATR percentile, and body-range Z-score — into a single intensity score. While compressed, the script tracks Cumulative Volume Delta inside the compression window to predict breakout direction. On confirmed compression exit it projects a chamber-width target line. A history strip records each completed compression with its outcome.

ảnh chụp nhanh

What makes it different
  • Single-metric volatility-contraction indicators (BBW or ATR alone) can be misled by price-level changes. The composite intensity uses three normalized metrics, each over a percentile lookback, so contraction across multiple lenses is required for a true compression read.
  • The compression chamber is drawn as a dynamic box (top and bottom bounds expanding while the compression remains active) with three nested concentric rings that visually tighten as intensity increases. A clear visual countdown to breakout.
  • Inside the chamber, CVD slope predicts breakout direction before the breakout occurs. A direction-bias gauge surfaces this prediction in a 21-segment vertical scale.
  • Two forward projection lines appear AFTER compression exits but BEFORE the breakout candle confirms — bull target at chamber-high plus width, bear target at chamber-low minus width. Once the direction confirms, only the active target survives.
  • A false-breakout signal fires when price breaks in the opposite direction of CVD's bias. A high-value warning that a fast reversal is likely.


How it works
  1. Bollinger Band Width equals (upper minus lower) divided by basis. Convert to percentile rank over a 100-bar lookback.
  2. ATR(14) percentile rank over the same lookback.
  3. Body range equals the absolute distance between close and open. Body Z equals (body minus sma(body, 20)) divided by stdev(body, 20). Map to a 0-1 score where small bodies equal 1.
  4. Intensity equals 0.40 times (1 minus BBW%) plus 0.40 times (1 minus ATR%) plus 0.20 times body score. Range 0 to 1 where 1 equals maximum compression.
  5. Compression active when intensity exceeds the user threshold (default 0.7). Chamber bounds are the running max / min of high / low while active.
  6. CVD inside the chamber: delta equals plus volume on up bars, minus volume on down bars, zero otherwise, summed since chamber start. Slope equals total delta divided by bars in chamber.
  7. On exit (intensity drops below threshold), if close above chamber high and CVD bias above 0, bull breakout. If close below chamber low and CVD bias below 0, bear breakout. If price breaks one way but CVD predicted the other, false-breakout signal.
  8. Target on confirmed direction equals breakout close plus or minus chamber width.


Reading the chart
  • Outer compression chamber box, transparency-modulated by intensity, anchored at compression start.
  • Three nested concentric rings inside the chamber, smaller and smaller, tinted by direction bias.
  • Iridescent candle recolor scales transparency with intensity (faded while compressed, vivid on expansion).
  • Forward projection lines (bull target and bear target) appear at compression exit and disappear when one direction confirms.
  • A confirmed target line plus price label persists until hit or expired.
  • bgcolor pulses: 3-bar fade on compression entry, 2-bar fade on confirmed breakout (bull / bear).
  • Chamber exit pulse: border alpha cycles for 3 bars when compression exits.
  • A right-edge intensity gauge label with intensity %, state, bias, bars in.
  • A right-side 21-segment direction-bias gauge mirroring CVD slope.
  • Pre-compression bgcolor highlight when intensity is approaching the threshold.
  • An intensity history mini-strip on the right edge showing the last 10 intensity values as colored line segments.
  • A compression history strip (last 10 completed compressions with outcomes).
  • A daily compression counter.


Signals
  • Compression entry (intensity crosses above threshold)
  • Compression exit (intensity drops below threshold, breakout pending)
  • Bull breakout confirmed
  • Bear breakout confirmed
  • False breakout (direction mismatch with CVD bias)

All gated on barstate.isconfirmed or barstate.ishistory. No future references.

Inputs
  • Compression: BB length, BB stdev multiplier, percentile lookback, activation threshold, chamber initial length, target line extension bars.
  • Visual: bullish, bearish, neutral colors. Chamber, nested rings, candles, target line, pulses, gauge toggles.
  • On-chart: compression history, intensity strip, pre-compression highlight, bias gauge, projection lines, target hit/miss labels, false-breakout revert line, state block, cycle counter, exit pulse.
  • Dashboard: position, size.


How traders use this
  • Breakout entries: wait for the confirmed bull / bear breakout signal AND the CVD-bias gauge to be aligned. False-breakout signals when these disagree are reasons to pass or fade.
  • Range trading: while compression is active (chamber visible), reactions to chamber high / low are intra-range scalp setups.
  • Target management: once the breakout fires and the target line appears, common practice is to scale out at chamber-mid first, then chamber-target. The chamber width is the implied move.
  • Compression history: see how previous compressions resolved on the current instrument. A series of Win entries means the setup has been productive recently.


Limitations
  • Compression detection requires warm-up history (100 bars for the percentile calculations). On very young charts the script is inert.
  • CVD bias inside a chamber is a probability, not a guarantee. False breakouts happen when liquidity sweeps stops on the predicted side first.
  • For instruments with very thin volume data, the CVD direction signal is less reliable.
  • The chamber width is a measured-move proxy. Actual move size can exceed or fall short.


Compatibility
Pine Script v6 open-source indicator (overlay). Any symbol, any timeframe (more bars equals more reliable percentile context). No request.security calls.

Defaults
20-bar BB, 2.0 BB stdev, 100-bar percentile lookback, 0.7 activation threshold, 20-bar initial chamber length, 40-bar target extension, mint / red / gray palette, top-right medium dashboard.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.