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.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.