PROTECTED SOURCE SCRIPT
MSS Boxes (close-break only)

What it does
MSS Boxes detects Market Structure Shifts (MSS) and draws clean, non-repainting mitigation boxes you can trade from. When price closes through the most recent swing with momentum, the candle that caused the break is captured as a box (supply for bearish, demand for bullish) and extended to the right as objective S/R.
How it works
Swings: swing highs/lows from your chosen left/right bars.
Shift: a bullish shift when price closes above the last swing high; bearish when it closes below the last swing low.
Displacement filter: optional size/ATR filter to require an impulsive break.
Box recipe: use wick-to-wick or body-only from the last opposite-colour candle before the break. Boxes don’t move after confirmation.
Lifecycle
Active → printed and valid.
Mitigated → price trades back into the box (optional strict wick rule).
Invalidated → close through the far side.
Expired → after N bars or at your session reset (e.g., NY 18:00).
What you see
Green boxes for bullish, red for bearish.
Small tag at origin (e.g., BOS↑/BOS↓).
Optional status markers (active/mitigated/invalid).
Key options
Swing length and displacement thresholds.
Box style (wicks vs body), max height cap, auto-merge overlaps.
MTF alignment (H1/M15) for plotting or alerts only.
Session reset time, max boxes, colours/opacity/label size.
MSS Boxes detects Market Structure Shifts (MSS) and draws clean, non-repainting mitigation boxes you can trade from. When price closes through the most recent swing with momentum, the candle that caused the break is captured as a box (supply for bearish, demand for bullish) and extended to the right as objective S/R.
How it works
Swings: swing highs/lows from your chosen left/right bars.
Shift: a bullish shift when price closes above the last swing high; bearish when it closes below the last swing low.
Displacement filter: optional size/ATR filter to require an impulsive break.
Box recipe: use wick-to-wick or body-only from the last opposite-colour candle before the break. Boxes don’t move after confirmation.
Lifecycle
Active → printed and valid.
Mitigated → price trades back into the box (optional strict wick rule).
Invalidated → close through the far side.
Expired → after N bars or at your session reset (e.g., NY 18:00).
What you see
Green boxes for bullish, red for bearish.
Small tag at origin (e.g., BOS↑/BOS↓).
Optional status markers (active/mitigated/invalid).
Key options
Swing length and displacement thresholds.
Box style (wicks vs body), max height cap, auto-merge overlaps.
MTF alignment (H1/M15) for plotting or alerts only.
Session reset time, max boxes, colours/opacity/label size.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.