PROTECTED SOURCE SCRIPT

[ReForge] Market Structure Swing Indicator

63
[ReForge] Market Structure Swing Indicator
Protected Script – State-Driven Structural & Volatility Engine

This script is a state-driven market structure engine designed to model structural transitions, volatility regimes and liquidity behaviour within a unified framework. It is not a simple swing high/low marker or basic BOS labeler. Signals are produced only when structural, volatility and regime states align in sequence.

Structural Engine

Confirmed pivots are built using symmetric left/right bar validation. A swing level becomes actionable only after full confirmation — no predictive pivots are used.

Break of Structure (BOS) requires a close beyond a configurable percentage buffer above or below the confirmed swing. This buffered model explicitly filters wick-only violations.

The script maintains an internal structural bias variable that updates only after validated BOS events. A Change of Character (CHoCH) is defined as a BOS occurring against the active bias. This creates a state-transition model rather than isolated break signals.

Liquidity Sweep Model

Sweep detection is conditional. A valid sweep requires:

• Wick penetration beyond buffered structure
• Close back inside the structural boundary
• Optional volatility gating
• Optional VWAP regime alignment

This distinguishes continuation breaks from liquidity grabs.

Volatility Regime Engine

Volatility is not treated as a cosmetic overlay. The script integrates:

• Bollinger Band width as a percentage expansion model
• Separate width thresholds for BOS and Sweep classes
• A compression “re-arm” mechanism allowing one structural break during contraction before renewed expansion is required
• Optional ATR rising validation
• Optional Keltner breakout regime state (in-channel = neutral, outside = directional)

These operate together as a volatility state gate rather than a single filter.

VWAP Regime Model

Signals may be gated by intraday VWAP bias in two modes:

Trend Mode – allow signals aligned with VWAP bias
Reversal Mode – allow signals opposing VWAP bias

VWAP gating can be applied independently to BOS and Sweep events.

Multi-Timeframe Alignment

Optional higher timeframe confirmation can require:

• HTF VWAP alignment
• HTF RSI relative to its moving average
• Or both combined

This gating can apply to BUY/SELL only or to all signal classes.

Continuation Retest Module

After a validated BOS, a timed retest window activates. A continuation entry requires:

• Touch within a tolerance band around the break level
• Optional close confirmation in trend direction
• Optional RSI alignment
• Expiry after a defined bar count

The retest state automatically resets after trigger or timeout.

Signal Hygiene Architecture

To prevent clustering and over-firing:

• Independent cooldown timers exist per signal class
• A one-signal-per-bar priority hierarchy is enforced
• Confirmation windows are configurable
• Volatility re-arm logic prevents repetitive breakout signals

This makes the output stateful rather than reactive.

Range Detection Model

If price remains fully contained between the most recent confirmed swing high and swing low for a defined lookback window, a range state activates. Range breakouts are treated as a separate structural class and obey hygiene controls.

Quality Profiles

Preset profiles (Off, Aggressive, Balanced, Strict) dynamically adjust BB width thresholds, VWAP gating behaviour and volatility strictness. These modify gating logic rather than pivot detection.

What This Script Is NOT

• Not a repainting pivot predictor
• Not a simple HH/HL visualiser
• Not a cosmetic VWAP + BOS overlay
• Not a single-indicator crossover system
• Not a liquidity-only script

It models structure transitions, volatility expansion cycles and signal sequencing within a coordinated hierarchy.

The protected component is the interaction logic between bias transitions, volatility re-arm mechanisms, retest sequencing and multi-layer gating.

Designed for intraday futures markets where structural continuation and volatility expansion cycles are critical.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน