PROTECTED SOURCE SCRIPT

MSS Boxes (close-break only)

39
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.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。